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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.