richardstan Posted September 23, 2008 Share Posted September 23, 2008 Hi i have the following script: <html> <body> <?php $imageURL; $imageHeight; $imageWidth; $URL = "http://localhost/thumbnails/thumbs.php?image=".$imageURL."&height=".$imageHeight."&width=".$imageWidth; <form action="<?php print URL?>" method="GET"> <input type="text" name= How can i set the form so that it sets the values of $imageURL, $imageHeight and $imageWidth using the text written in the form, then follows the action already defined at the top of the form to forward onto the $URL i have used? Thanks Richard. Link to comment https://forums.phpfreaks.com/topic/125528-setting-variables-using-forms/ Share on other sites More sharing options...
pocobueno1388 Posted September 23, 2008 Share Posted September 23, 2008 Quote How can i set the form so that it sets the values of $imageURL, $imageHeight and $imageWidth using the text written in the form You want these variables set BEFORE the form is submitted? So in other words, you want them to automatically set as soon as they type text into the fields? If that's what you want, I'm sure you can get it done using AJAX. You can't do that with just PHP. If what your trying to say is that they have already submitted one form and you want to fill the second one with the values of the first, then you would do this: <html> <body> <?php $imageURL = $_POST['imageURL']; $imageHeight = $_POST['imageHeight']; $imageWidth = $_POST['imageWidth']; $URL = "http://localhost/thumbnails/thumbs.php?image=".$imageURL."&height=".$imageHeight."&width=".$imageWidth; ?> <form action="<?php print $URL; ?>" method="GET"> <input type="text" name="imageURL" value="<?php echo $imageURL; ?>"> If I completely missed the question, please explain in more detail. Link to comment https://forums.phpfreaks.com/topic/125528-setting-variables-using-forms/#findComment-649036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.