Jump to content

[SOLVED] PHP form


didgydont

Recommended Posts

hi all im either trying to echo a form or i need to post a post from the form before

 

 

echo "<form action="finishjob.php" method="post">" ;

echo "Job: <input type="text" name="jobnumber" value=$jobnum /> <br />" ;

echo "Status: <select name="status">"  ;

echo "<option value="Ongoing">Ongoing</option>" ;

echo "<option value="Finished">Finished</option>"  ;

echo "</select>";

echo "<br />" ;

echo "<input type="submit" VALUE="Update Job" />" ;

echo "</form>" ;

 

Link to comment
Share on other sites

Maybe try

 

<?php

echo '<form action="finishjob.php" method="post">
Job: <input type="text" name="jobnumber" value=$jobnum />
Status: <select name="status">
<option value="Ongoing">Ongoing</option>
<option value="Finished">Finished</option>
</select>
<input type="submit" VALUE="Update Job" />
</form>';

?>

 

 

What is the problem?

Link to comment
Share on other sites

When you use quotes inside quotes, or single quotes inside single quotes, you must escape them:

 

echo "This would \"work\"."; //This would "work".
echo "This wouldn't "work"";  // Compile error
echo 'This would \'work\''; //This would 'work'
echo 'This would 'work''; //Compile error 

Link to comment
Share on other sites

Maybe try

 

<?php

echo '<form action="finishjob.php" method="post">
Job: <input type="text" name="jobnumber" value=$jobnum />
Status: <select name="status">
<option value="Ongoing">Ongoing</option>
<option value="Finished">Finished</option>
</select>
<input type="submit" VALUE="Update Job" />
</form>';

?>

 

 

What is the problem?

 

the form worked but $jobnum didnt work just printed as it looks instead of value gonna try other methods now

Link to comment
Share on other sites

well try echoing each line seperate and use the folliwng

 

echo "<HTML etc etc value = '"$jobnum.."'>"

 

thats the way i always do it - plus it helps to make your variabels easy to find in code because editors will color them as teh string, where as this way they will apear as variables

 

gdlk

Link to comment
Share on other sites

When you use quotes inside quotes, or single quotes inside single quotes, you must escape them:

 

echo "This would \"work\"."; //This would "work".
echo "This wouldn't "work"";  // Compile error
echo 'This would \'work\''; //This would 'work'
echo 'This would 'work''; //Compile error 

 

this is the winner thank you so much !!

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.