Jump to content

*SOLVED* A frustrating PHP Form


stevesmename

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.
Link to comment
https://forums.phpfreaks.com/topic/4607-solved-a-frustrating-php-form/
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

Archived

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

×
×
  • Create New...

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.