didgydont Posted December 16, 2007 Share Posted December 16, 2007 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 More sharing options...
phpSensei Posted December 16, 2007 Share Posted December 16, 2007 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 More sharing options...
PC Nerd Posted December 16, 2007 Share Posted December 16, 2007 your quotes are cancellingout. try just doing plain html: ?> <html etc> <?php or : echo "<form action = 'finishjob.php' method = 'POST'>\n"; gdlk Link to comment https://forums.phpfreaks.com/topic/81888-solved-php-form/#findComment-416088 Share on other sites More sharing options...
corbin Posted December 16, 2007 Share Posted December 16, 2007 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 More sharing options...
didgydont Posted December 16, 2007 Author Share Posted December 16, 2007 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 More sharing options...
PC Nerd Posted December 16, 2007 Share Posted December 16, 2007 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 More sharing options...
didgydont Posted December 16, 2007 Author Share Posted December 16, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.