![]() |
|
#1
|
|||
|
|||
Problem with some cheat :PHi
I've written down all the answers to our math test and was going to put them online for my friends, so i created 3 text files and put them in a folder together with index.php. Then i created the following script, that was supposed to look for all text files in the dir and then automatically make them to links. Then when some of the links was pressed then the page should load itself and the text file! SCRIPT:: PHP Code:
Last edited by JdS : 02-Mar-2005 at 07:14.
Reason: please insert your example PHP codes between [php] and [/php] bbcode tags
|
|||
|
#2
|
||||
|
||||
|
Sorry I didn't reply yesterday. I had already written a lot of code myself and was feeling a bit tired.
First problem, the while() loop is faulty... you are always REPLACING $file_list with each loop when you should be appending to it. So a fix could be to add the concatenating assignment operator i.e. .= to the line. $file_list .= "<a href=\"http://www.holdum.net/blaek/index.php?id=\"$file_name\">file_name</a><br />"; You SHOULD also look at the function urlencode() and use it in your code before you display the links. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
Thx, i solved the problem myself
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need advice on a disturbing problem | JUNK KED | Open Discussion Forum | 6 | 31-Mar-2005 14:51 |
| Mother board problem | mrkamran | Computer Hardware Forum | 2 | 07-Oct-2004 11:31 |
| C I/O problem | kelly80 | C Programming Language | 4 | 27-Apr-2004 21:15 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 08:53 |
| problem with php5 cgi installation | fab13 | Apache Web Server Forum | 3 | 19-Nov-2003 10:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The