This is a discussion on function problem (simple redirect) within the PHP General forums, part of the PHP Programming Forums category; I'm trying to make this function work, but I'm not good at functions. I have created a variable ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm trying to make this function work, but I'm not good at
functions. I have created a variable for testing payment equal to 1 or 0 to see what would happen based on whatever the condition is in my database (the sql stuff is not here because i have to figure this thing out first). I get a t_string error or t_varialbe but I don't know what to do to fix it. Frank code ---------- $payment = 1; echo $payment; function $payment{ if ($payment == "0"); header ("location:test_page.html"); }else{ ($payment == "1"); header ("location:test_page2.html"); } __________________________________ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ |
|
|||
|
--- Frank Tudor <frank_tudor@yahoo.com> wrote:
> function $payment{ You probably mean payment, not $payment. > header ("location:test_page.html"); The Location header has an uppercase L, a space after the colon, and an absolute URL after the space. Your example violates all three. Hope that helps. Chris ===== My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp |