ibanez270dx Posted November 30, 2007 Share Posted November 30, 2007 Hello, I'd like to post some information to another PHP page, but instead of using the form buttons, I'd like to use a plain 'ol hyperlink. This is simply for aesthetics for a project I'm working on. Anybody know? Thanks, - Jeff Quote Link to comment https://forums.phpfreaks.com/topic/79493-post-using-a-hyperlink/ Share on other sites More sharing options...
phpQuestioner Posted November 30, 2007 Share Posted November 30, 2007 you can do this with PHP cURL (http://us.php.net/curl) or with AJAX or if it doesn't matter who will see the content your passing through the url (if it does not need to be secure information) you can do this: Link Page <a href="postpage.php?variable1=whatever&variable2=whatever2">Post My Data</a> Post Page <?php $variable1 = $_GET['variable1']; $variable2 = $_GET['variable2']; // do something with variables here ?> Quote Link to comment https://forums.phpfreaks.com/topic/79493-post-using-a-hyperlink/#findComment-402547 Share on other sites More sharing options...
teng84 Posted November 30, 2007 Share Posted November 30, 2007 you can use the onlclick property of JS something like onclick ="javascript: document.myform.submit();" or do this trick use css to have your button look like a link (bad and not good idea ) Quote Link to comment https://forums.phpfreaks.com/topic/79493-post-using-a-hyperlink/#findComment-402574 Share on other sites More sharing options...
448191 Posted November 30, 2007 Share Posted November 30, 2007 or do this trick use css to have your button look like a link (bad and not good idea ) I think that is the best idea in this thread. It doesn't depend on JavaScript or curl. TS says this only for aesthetics, so a solution that only affects the display is the way to go IMO. Quote Link to comment https://forums.phpfreaks.com/topic/79493-post-using-a-hyperlink/#findComment-402679 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.