Jump to content

Archived

This topic is now archived and is closed to further replies.

stevesmename

*SOLVED* A frustrating PHP Form

Recommended Posts

[code]<?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>");
    }
?>[/code]

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.



[u]UPDATE LINKS[/u]

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).
[code]
<?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>");
    }
?>[/code]


fixed, this can be deleted.

Share this post


Link to post
Share on other sites
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:
[code]<?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>';
    }
?>[/code]

Ken

Share this post


Link to post
Share on other sites
Ken

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.