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
https://forums.phpfreaks.com/topic/81888-solved-php-form/
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
https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416060
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
https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416092
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
https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416178
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
https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416180
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
https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416183
Share on other sites

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.