|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
REQUEST: News tutorial
Hey,
Im having some trouble completing the news tutorial posted by Matt. Seems stupid really considering all you have to do is copy the code.... But, im up to the part where im tryin to add the option to delete a particular news item. Everything was going well until i realised that when i click on the link 'Delete' it does not enter the 'if' statement: if($action=="delete"){....} However, the url changes to http://server/php/news.php?action=delete&id=7 so im guessing that the variable $action does get set correctly on the server side... Is the $action variable global and everlasting as such....i.e. does it at any point get reset or change value...?? I would appreciate any and all feedback that can be given. Cheers, Luke |
|
#2
|
||||
|
||||
|
RE: News tutorial
|
|
#3
|
|||
|
|||
|
RE: News tutorial
Yep...it most likely is that you have register_globals off on your server. I need to update some of the tutorials to work with register_globals off...
|
|
#4
|
|||
|
|||
|
RE: REQUEST: News tutorial
Me again,
Yes, that worked....i do have register_globals turned off as i read somewhere that in general it is more secure....?? True? Anyway, im still having trouble with this one.... Now when i go to read in the file 'news.txt' into the variable $data as to print it out and show the user what they are about to delete....i am returned an empty array. I am therefore also unable to actual delete that news item from the storage file. I looked in the forum and read that if you dont close the file after writing/apending it, then this can happen....but i have checked my code and i have explicitly closed the file each time after opening it. Also, Matt....if your reading this....can you please explain in a little more detail what difference the order in which we check for action='delete' etc. makes. You said: <?PHP if($action == "delete" && isset($HTTP_POST_VARS['password'])) { ?> "That line should go to the very top of our script. Definitely make it above the last snippet that checked for an action of delete." Where it looks to me that this code is indeed itself checking for the action of delete....this is rather confusing. Once again, I would appreciate yours and anyone elses helpful feedback. Thanks heaps, Luke |
|
#5
|
|||
|
|||
|
RE: REQUEST: News tutorial
Quote:
no, not true. it just makes it easier to write sloppy code which could be insecure if you don't know what you're doing. |
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > REQUEST: News tutorial |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|