The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS PHP and WordPress

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #30166

    I have a question about referrals for my wordpress blog. This might be more of a PHP question than a wordpress question. After I manage to add the field to the sign-up page where the user can add a referral ID, how do I add the functionality where that referral ID can be inserted automatically in the sign-in page? I know that in PHP you can add strings at the end of a URL like?this or like?this=that but how does one make sure that this translates to a string being added to a field in the web page?


    What you mean about strings being added to the URL is being done with the PHP GET method.

    Here’s a little example:

    Referall ID:


    $refID = $_GET;

    echo "$refID"


    What is being done here, is that the browser will go to the test.php page after the submit button is pressed, using the GET method, sending the data typed in the textbox to the test.php page. Say you’ve entered a referall ID of 44, the URL would look like this after clicking the submit button:

    On the test.php file, the referall ID is saved as a variable ($refID), which is retrieved using the GET method. And since we gave the input field on the html page a name of “refID”, that’s used in the GET statement ($_GET)

    Sorry if my explanation is a bit vague, more information can be found here about the GET and POST methods.
    Oh, one tip: don’t use the GET method for sending password information, ’cause everyone would be able to see it in the URL ;)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.