Jump to content

Small help


Eagle07

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Eagle07
Link to comment
Share on other sites

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
}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.