Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/51497-form-not-displaying-correctly/
Share on other sites

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!!

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.