Eagle07 Posted May 1, 2015 Share Posted May 1, 2015 Hey guys , so basiclly im trying to do a program based on Web get & post php , but my skills in php is not good as well . So i have this Query php ( https://github.com/vimishor/GoldSource-Server-Info ) and i want to add a post and get to the PHP in the submit by adding the method . For sending data by the link (example.com/index.php?Address=123.45.67.89&Port=27015) Quote Link to comment https://forums.phpfreaks.com/topic/296007-small-help/ Share on other sites More sharing options...
ginerjm Posted May 1, 2015 Share Posted May 1, 2015 Show us the code here. The Relevant code please. Quote Link to comment https://forums.phpfreaks.com/topic/296007-small-help/#findComment-1510529 Share on other sites More sharing options...
Ch0cu3r Posted May 1, 2015 Share Posted May 1, 2015 This is not a PHP question/problem. It requires a few lines of HTML/Javascript What you need to is add your html link(s) to the page. Apply an onclick handler to your links using jquery, fetch the ip address and port number from then href attribute of the link that was clicked and pass this info to the fetch_info_data() javascript function (located in assets/main.js). The rest will be handled by the GoldSouce-Server script for you. Quote Link to comment https://forums.phpfreaks.com/topic/296007-small-help/#findComment-1510531 Share on other sites More sharing options...
Eagle07 Posted May 2, 2015 Author Share Posted May 2, 2015 (edited) Ch0Cu3r : I think there is no need for Javascript . Html will be enough . For what i read adding a method for post in the button . And checking ( if statement ) isset POST and GET . But im its not working . If you can do what you said . It will be nice . -Please this topic must be in html Edited May 2, 2015 by Eagle07 Quote Link to comment https://forums.phpfreaks.com/topic/296007-small-help/#findComment-1510582 Share on other sites More sharing options...
Muddy_Funster Posted May 7, 2015 Share Posted May 7, 2015 you add the method post to the form element, not the button. Then, as you said, check for $_POST and $_GET in the php. e.g. <form name="sampleForm" id="sampleForm" method="post" action="your.php"> <lablel for="uName">User Name...</label> <input type="text" name="uName" id="uName" placeholder="User Name" /> <label for="pass">Password...</label> <input type="password" name="pass" id="pass" /> <input type="submit" name="submit" value="Login" /> </form> Then php something like: <?php if(!isset($_POST['submit'])){ if(!isset($_GET['variable'])){ echo"You shouldn't just come directly to this page, it needs variables to work"; } else{ //SELECT QUERY CODE GOES HERE } } else{ //POST QUERY CODE GOES HERE } Quote Link to comment https://forums.phpfreaks.com/topic/296007-small-help/#findComment-1510996 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.