justlukeyou Posted April 2, 2011 Author Share Posted April 2, 2011 Hi, I have changed it to the following code but it still doesn't work. Do I need to change the second piece to post_image? if (isset($_POST['image_x'], $_POST['image.x'])) { $membername = mysql_real_escape_string(trim($_POST['membername'])); <form action="" method="post"> <?php if($error) echo "<span style=\"color:#ff0000;\">".$error."</span><br /><br />"; ?> <label for="membername">Username: </label> <input type="text" name="membername" value="<?php if($_POST['membername']) echo $_POST['membername']; ?>" /><br /> <label for="password">Password: </label> <input type="password" name="password" value="<?php if($_POST['password']) echo $_POST['password']; ?>" /><br /> <label for="password2">Retype Password: </label> <input type="password" name="password2" value="<?php if($_POST['password2']) echo $_POST['password2']; ?>" /><br /> <label for="email">Email: </label> <input type="text" name="email" value="<?php if($_POST['email']) echo $_POST['email']; ?>" /><br /><br /> <input type="image" value="submit" name="image" src="http://www.ukhomefurniture.co.uk/images/homepageregister.PNG" > Quote Link to comment https://forums.phpfreaks.com/topic/232223-using-image-as-submit-button/page/2/#findComment-1195877 Share on other sites More sharing options...
PFMaBiSmAd Posted April 2, 2011 Share Posted April 2, 2011 $_POST['image.x'] doesn't exist and won't ever be set. From the link I posted - Because foo.x and foo.y would make invalid variable names in PHP, they are automagically converted to foo_x and foo_y. That is, the periods are replaced with underscores. So, you'd access these variables like any other described within the section on retrieving variables from external sources. For example, $_GET['foo_x']. All you need to use is - if(isset($_POST['image_x'])){ Quote Link to comment https://forums.phpfreaks.com/topic/232223-using-image-as-submit-button/page/2/#findComment-1195878 Share on other sites More sharing options...
justlukeyou Posted April 3, 2011 Author Share Posted April 3, 2011 Brilliant, thanks mate. Got there in the end. Thanks alot everyone. Quote Link to comment https://forums.phpfreaks.com/topic/232223-using-image-as-submit-button/page/2/#findComment-1196280 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.