SitePoint Sponsor |
|
User Tag List
Results 1 to 20 of 20
Thread: Cross-Site Scripting
-
Jan 15, 2005, 22:07 #1
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cross-Site Scripting
Does anyone know of any code for "cross-site" scripting? I want to access a directory from another site and run the files through a while loop to put them in a mysql database.
This is because my files are one server, and my site is on another. The reasoning for the setup ois that the site can become very slow with the file downloads, and theres also limited space on the server I'm hosting hte pages on.
-
Jan 15, 2005, 22:16 #2
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Look at FTP Functions
-
Jan 15, 2005, 22:31 #3
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is FTP the only option? I have a weird problem with FTP on my server in that only the local IP address works, as opposed to 65.97.19.150.
-
Jan 15, 2005, 22:35 #4
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is FTP the only option?
-
Jan 15, 2005, 22:39 #5
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It is. How would this be accomplished? There's no index file for it, so I can't parse that...what do you suggest?
-
Jan 15, 2005, 22:45 #6
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Then you can't. Fix your NAT router and use FTP. Or use the auto-generated DirectoryIndex in apache.
-
Jan 15, 2005, 22:51 #7
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, I'm saying I do have apache, but that I don't know how to use the DirectoryList. Could you suggest some PHP functions, or maybe a tutorial?
-
Jan 15, 2005, 22:56 #8
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Do you have any virtual hosts on the server or is it a stock setup?
-
Jan 15, 2005, 22:58 #9
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's stock.
-
Jan 15, 2005, 23:53 #10
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yeah I attempted the FTP, it didnt work. Whats your idea on apache's directory list parsing?
-
Jan 16, 2005, 00:21 #11
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
First get indexes to work. Add a line like this in httpd.conf and restart apache:
Code:<Directory /> Options Indexes AllowOverride None </Directory>
-
Jan 16, 2005, 00:29 #12
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's already there.
-
Jan 16, 2005, 00:30 #13
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Then do you have any directives further down that would turn Indexes off?
-
Jan 16, 2005, 00:34 #14
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Not to my knowledge. Directory Indexing is on, I just don't know how to parse it.
-
Jan 16, 2005, 09:37 #15
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Alright, I'm back, sorry. So do you know how to accomplish it?
-
Jan 16, 2005, 09:58 #16
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
So then you'd read the directory index in with fgets() or similar and parse the file with preg_match().
-
Jan 16, 2005, 10:03 #17
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well, I have actually looked in to learning how to use regular expression, but I can't figure it out. Seems to be over my head. How would I "match" names of 100+ files anyway?
-
Jan 16, 2005, 10:11 #18
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Look at preg_match_all(). If you can match one, you can match billions of them. They all get stored in a nice two dimensional array that you can manipulate to your heart's content.
-
Jan 16, 2005, 10:19 #19
- Join Date
- Jan 2005
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What will the array look like? This is a hell of a lot more complicated than i thought it would be. I don't know how to use arrays either.
-
Jan 16, 2005, 10:42 #20
- Join Date
- Nov 2004
- Location
- Parry Sound, ON
- Posts
- 725
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sorry, I don't have time to write the script for you. RTFM , try writing some code, come up with some more specific questions, and I'll be glad to help.
Bookmarks