Jump to content


Photo

*SOLVED* A frustrating PHP Form


  • Please log in to reply
3 replies to this topic

#1 stevesmename

stevesmename
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 10 March 2006 - 02:12 PM

<?php
if($stepdone != "done")
    {
    echo ("<form id=\"form1\" name=\"form1\" method=\"post\" action=\"step_5.php?username=".$username."&filename=".$filename."&stepdone=".$stepdone.">  <p align=\"center\">If you had made any changes be sure to save changes before continuing. </p>  <p align=\"center\">    <input type=\"submit\" name=\"Submit\" value=\"Continue\" />  </p> </form>");
    }
?>

Everything seems to look okay on the page. But when I click "Continue" the Address changes to

[a href=\"http://aaanwont01/boards/portal/create_new/step_5.php?username=admin&filename=admin084857am031006&stepdone=car%3E%20%20%3Cp%20align=\" target=\"_blank\"]http://aaanwont01/boards/portal/create_new...20%3Cp%20align=[/a]

Instead of

[a href=\"http://aaanwont01/boards/portal/create_new/step_5.php?username=admin&filename=admin084857am031006&stepdone=car\" target=\"_blank\"]http://aaanwont01/boards/portal/create_new...06&stepdone=car[/a]

WHY!!!!???? I really for the text to be centered, I tried <center></center> - It get's worse - It doesn't even display. I tried splitting the coding into two php scripts - Problem got worse - it added even more to the address string.

help please.



UPDATE LINKS

Displays

step_5.php?username=admin&filename=admin084857am031006&stepdone=car%3E%20%20%3Cp%20align=

instead of

step_5.php?username=admin&filename=admin084857am031006&stepdone=car

I hope this displays better.

Nevermind -- I HATE QUOTES!!!

Found the problem being that I didn't add an extra quote (didn't even out).
<?php
if($stepdone != "done")
    {
    echo ("<form id=\"form1\" name=\"form1\" method=\"post\" action=\"step_5.php?username=".$username."&filename=".$filename."&stepdone=".$stepdone."\">  <p align=\"center\">If you had made any changes be sure to save changes before continuing. </p>  <p align=\"center\">    <input type=\"submit\" name=\"Submit\" value=\"Continue\" />  </p> </form>");
    }
?>


fixed, this can be deleted.

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 10 March 2006 - 02:49 PM

No it shouldn't be deleted. It should be marked resolved. It may help someone else.

As for the quotes, instead of using double quotes everywhere and escaped double quotes, use single quotes to surround strings that contain double quotes:
<?php
if($stepdone != 'done')
    {
    echo '<form id="form1" name="form1" method="post" action="step_5.php?username=' . $username . '&filename=' . $filename . '&stepdone=' . $stepdone . '">  <p align="center">If you had made any changes be sure to save changes before continuing. </p>  <p align="center">    <input type="submit" name="Submit" value="Continue" />  </p> </form>';
    }
?>

Ken

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 10 March 2006 - 05:39 PM

Ken

Are we going to get the "SOLVED" button back, or can only Moderators do that now? I'd LOVE to mark mine solved...

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 10 March 2006 - 06:09 PM

I'm not a moderator and didn't mark it solved, so I guess only moderators can do that, although I think I've seen references that the original poster can change the the title.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users