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>" ; Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 !! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.