Copyright © 2005-2008 Andrea Tincani

AndreaPHP | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (For.. Each with two level array)Next Topic (Syntax Highlight) New Topic New Poll Post Reply
AndreaPHP Forum : PHP General : Curiosity question...
Poster Message
neutrall
Level: Scholar


Registered: 28-03-2004
Posts: 43

icon Curiosity question...

Does anyone know why when I write this code to delete a record in a database, the browser fall into a endless loop :


<?
} elseif (isset($_GET['delete'])) {
$id htmlspecialchars($_GET['delete']);
$creature->Delete_Forest_Creature($id);
echo 
"<META HTTP-EQUIV='refresh' CONTENT='0' URL='creature.php'>";
?>



But using the META tag in the same context, but for UPDATING or INSERTING into a MySQL database will work perfectly?


<?
} elseif (isset($_POST['new_creature_submit'])) {
$creature->New_Forest_Creature($allmyvar);
echo 
"<META HTTP-EQUIV='refresh' CONTENT='0' URL='guardtools.php'>";
?>



(I've also tried without the class, using directly the UPDATE, DELETE and INSERT command and got the same result..)

[Edited by admin on 12-05-2005 at 11:58 AM GMT]

____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.

06-05-2005 at 03:49 AM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
neutrall
Level: Scholar


Registered: 28-03-2004
Posts: 43

icon Re: Curiosity question...

And maybe someone has a better way to force a screen refresh? (Whitout user intervention)

____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.

06-05-2005 at 03:50 AM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 35

icon Re: Curiosity question...

try to force the reload passing to it a random new parameter


<?
echo "<META HTTP-EQUIV='refresh' CONTENT='0' URL='creature.php?random=".$your_random_number."'>";
?>



this will reload the page with new $_GET values (in this case only a random parameter useless for the script)

[Edited by admin on 12-05-2005 at 11:54 AM GMT]

____________________________
AndreaVB

06-05-2005 at 07:44 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
neutrall
Level: Scholar


Registered: 28-03-2004
Posts: 43

icon Re: Curiosity question...

hmmm. no, I tried it but it still doesn't work.....

____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.

06-05-2005 at 03:58 PM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 35

icon Re: Curiosity question...

after looking at the tag specifics, I've noticed that it doesn't support the URL attribute, but it is part of the CONTENT value

try this:

<meta http-equiv="refresh" content="2;url=http://creature.php/">



as you can see url is a part of the Content attribute, if you specify only the seconds to wait before reload the current page will be reloaded as is, so maybe your page was reloaded with the same $_GET parameters every time

hope this helps

____________________________
AndreaVB

07-05-2005 at 08:39 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
neutrall
Level: Scholar


Registered: 28-03-2004
Posts: 43

icon Re: Curiosity question...

I just found time to test it, and this was indeed the problem, since the syntax was wrong, it was resending the same $_GET information, falling into a endless loop.

Thank you!

____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.

18-05-2005 at 04:00 AM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
AndreaPHP Forum : PHP General : Curiosity question...
Previous Topic (For.. Each with two level array)Next Topic (Syntax Highlight) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: AndreaVB

Copyright © 2005-2008 Andrea Tincani

Powered by: tForum tForum Edition b0.92p1
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team.