phpjayx Posted July 23, 2013 Share Posted July 23, 2013 I'm testing out a simple form. I'm wanting to have this code be available to other websites to use to allow them to send a couple of variables over to my site..... my test code isn't even working. I'm sure its something simple I'm doing incorrectly. Any help would be appreciated. Thanks in advance. ------------------------------------------------------ <form action="" method="post"><div id="entry_fields"> <input class="textfield" id="email" placeholder="Email" autocorrect="off" type="text" autocapitalize="off"> <input class="textfield" id="name" type="password" placeholder="Name" autocorrect="off" autocapitalize="on"></div> <div> <input type="button" value="Link to site" onClick="window.location.href='http://www.tester.com/MainPage.php?email=<?php echo $email?>'"> </div> </form> Link to comment https://forums.phpfreaks.com/topic/280412-using-php-to-send-data-from-one-site-to-another/ Share on other sites More sharing options...
AbraCadaver Posted July 23, 2013 Share Posted July 23, 2013 $email is not defined until the submit button is clicked and then it is passed to the action as post data. I can't quite tell what you are doing, but depending on the receiving page, use method post or get. Also, you didn't give your inputs a name: <form action="http://www.tester.co...Page.php" method="get"> <div id="entry_fields"> <input type="text" name="email"> <input type="password" name="password"> </div> <div> <input type="submit" name="submit" value="Link to site"> </div> </form> Now on the receiving page ("http://www.tester.co...Page.php) you use: echo $_GET['email']; Link to comment https://forums.phpfreaks.com/topic/280412-using-php-to-send-data-from-one-site-to-another/#findComment-1441791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.