essjay_d12 Posted May 15, 2007 Share Posted May 15, 2007 THe following code does not seem to be displaying the submit button - so I can Send the hidden input value to the URL!?! $directory = "user/"; $file = "index.html"; echo '<form action="webtest.php" method="get" name="url">'; echo "filename: $file " . "\n"; echo '<input type="hidden" name="url" value="'; echo $directory . "/" . $file; echo '/><label><input type="submit" name="Submit" value="Submit" /></label></form>'; echo "<br/>"; echo "<br/>"; It prints the file name correctly so i know its running fine. Quote Link to comment https://forums.phpfreaks.com/topic/51497-form-not-displaying-correctly/ Share on other sites More sharing options...
pikemsu28 Posted May 15, 2007 Share Posted May 15, 2007 when you are echoing the submit button you left out a double quote to close the value of the hidden input echo '"/><label><input type="submit" name="Submit" value="Submit" /></label></form>'; Quote Link to comment https://forums.phpfreaks.com/topic/51497-form-not-displaying-correctly/#findComment-253614 Share on other sites More sharing options...
MadTechie Posted May 15, 2007 Share Posted May 15, 2007 try <?php $directory = "user/"; $file = "index.html"; echo "<form action='webtest.php' method='get' name='url'>"; echo "filename: $file \n"; echo "<input type='hidden' name='url' value='$directory/$file' />"; echo "<label>"; echo "<input type='submit' name='Submit' value='Submit' />"; echo "</label>"; echo "</form>"; echo "<br/>"; echo "<br/>"; ?> pikemsu28 was correct this code is cleaner EDIT: option #2 <?php $directory = "user/"; $file = "index.html"; ?> <form action='webtest.php' method='get' name='url'>"; filename: <?php echo $file ?> <input type='hidden' name='url' value='<?php echo "$directory/$file" ?>' /> <label> <input type='submit' name='Submit' value='Submit' /> </label> </form> <br/> <br/> PLEASE NOTE the $directory has a / and so does the hidden field!! Quote Link to comment https://forums.phpfreaks.com/topic/51497-form-not-displaying-correctly/#findComment-253619 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.