PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
mainy
Forum Newbie
Posts: 1 Joined: Sun Apr 04, 2004 8:37 am
Post
by mainy » Sun Apr 04, 2004 8:37 am
why can i not get this to work? i want to relocate my window page.
Code: Select all
$numrows = ora_numrows($cursor);
if ($numrows=="1"){
echo "<script language="JavaScript">";
echo "window.location="page7.html"";
echo "</script>";
return;
else
echo "record not found";
}
any help would be great
vigge89
Forum Regular
Posts: 875 Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden
Post
by vigge89 » Sun Apr 04, 2004 2:22 pm
just a reminder, you cannot use [php_man]header[/php_man] if you already have sent output to the browser...
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Sun Apr 04, 2004 5:37 pm
mainy wrote: why can i not get this to work? i want to relocate my window page.
any help would be great
I'm so glad you told us what was wrong.
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 5:42 pm
mainy wrote:
Code: Select all
$numrows = ora_numrows($cursor);
if ($numrows=="1"){
echo "<script language="JavaScript">";
echo "window.location="page7.html"";
echo "</script>";
return;
else
echo "record not found";
}
obviously this is what is wrong. Was it really that hard for you to understand that he was trying to redirect, and this wasn't working?? Wow...
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Sun Apr 04, 2004 5:46 pm
yes but he didn't say what exactly happened, sorry I can't read minds.
posting a script and saying it doesnt work isnt exactly a good way to get help, and besides, you didn't fix it, you just gave him an alternative.
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 5:48 pm
i didn't try to fix it. It was never my intention to 'fix' anything with it.
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Sun Apr 04, 2004 5:49 pm
See, I ran it myself and got this:
Parse error: parse error, unexpected T_ELSE in C:\Documents and Settings\Administrator\Desktop\Server\test.php on line 7
Now if he had've told us that, I could've said just to add two brackets:
Code: Select all
//change:
return;
else
//to
return;
}
else {
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Sun Apr 04, 2004 5:50 pm
Illusionist wrote: i didn't try to fix it. It was never my intention to 'fix' anything with it.
"what's wrong with my sql?"
"try using fopen"
sure, it works, but he might've wanted to use javascript.. for some unknown reason.
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 5:57 pm
"what's wrong with my sql?"
"try using fopen"
Ya, that wouldn't work. Nice try though! Atleast my suggestion was correct, yours.. just wrong.
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Sun Apr 04, 2004 6:00 pm
Ya, it would.
everything databases can do, text files can too.
Don't start acting all high and mighty.
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 6:07 pm
ya, ok, But a specific question regarding an sql statement, and a reply of "use fopen()" is totally wrong. For that to be possible, one would have to move everything from the database into a textfile.
Sorry dude