1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP Questions

Discussion in 'Web Design & Development' started by MMJ, Feb 12, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. MMJ

    MMJ Guest Thread Starter

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    I have some php questions that I would appreciate if anybody can answer. :)

    Whenever a word has a dollar sign in front of it that means it is a variable right? e.g. $test

    . is like & (vb) or + (JS) right?

    More to come... :)
     
  2. MMJ

    MMJ Guest Thread Starter

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    There seems to be certain words that have a dollar sign if front of them that are not variables, e.g. $_POST

    What is that?
     
  3. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    $_POST is a variable.
    . is the string concatenation operator.
     
  4. DrP

    DrP

    Joined:
    Jul 23, 2005
    Messages:
    739
    $variable is a variable within the page being worked on.
    $_POST['variable'] was passed to the page from a form using the method POST.
    $_SESSION['variable'] was passed through the use of a session cookie.
    $_GET['variable'] is passed through the url or from a form using the method GET.
    If you have Global Variables turned on in your php.ini then all of the above would be accessible through $variable, I think. But if Global Variables is turned off then you need to refer to the variables correctly by type - as above. It's safer to Global Variables turned off btw.
    There are others, too.
     
  5. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    And when you looked in your php.ini file (to avoid confusion) it's called "Register Globals" ;)

    You can also find a list of various variables you can use by creating a php file with this in it:
    <?php
    phpinfo();
    ?>
    and uploading it to your server.
     
  6. MMJ

    MMJ Guest Thread Starter

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    Does $_POST always have to be defined?
     
  7. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    $_POST is a Superglobal, it "posts" the data received from a form that uses the method of post.

    So if you had

    <form method="post">
    whatever
    </form>

    you could use $_POST to display the data you got from the form on a page.
     
  8. MMJ

    MMJ Guest Thread Starter

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    Got it here: http://www.w3schools.com/php/php_forms.asp

    Thanks.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Questions
  1. shoff
    Replies:
    10
    Views:
    610
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/543415

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice