Need help with PHP.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vagabond
    New Member
    • Apr 2006
    • 17

    Need help with PHP.

    I am trying to write a PHP script for tracking information and storing it in text files. The program has gotten to the point that I now need several php pages for the program to work however I can't find information on passing information from one PHP page to another. I know how to read the $_ENV with CGI to pass the information but am trying to learn PHP over CGI.

    Is there a way to read the URL information for something like this example in PHP?

    Example URL
    This website is for sale! yourcompany.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, yourcompany.com has it all. We hope you find what you are searching for!


    Or is there some other function I have over looked to pass this information from say

    valog.php to vaadditem.php

    P.S. Thx in advance for any help.

    For now I am using the below section to passin formation between scripts. Scripts are a combination of HTML and PHP.

    Should I just be using an Include statement to pass this information instead or is using the session command better or like I originaly posted is there a way to get the information from the link.



    <?php
    session_start() ;

    if($_SESSION[page] == ""){
    Display_Login_M enu();
    }
    else if($_SESSION[page] == "Open Pilots DB"){
    Open_function_D B();
    }
    else if($_SESSION[page] == "Add_Log_Entry" ){
    Add_Log_Entry($ array);
    } else {
    echo "Error!Noth ing to do!";
    }

    // Start of functions
    function Add_Log_Entry($ array){
    $_SESSION = "Do_Next_Functi on"
    //some HTML
    <div align="center"> <font color="#6699CC" ><a href="../valog/addlog.php">Add New Flight</a></font></div>

    This is where I get stuck I can no longer pass the information from the HTML menu to the next script unless I setup a session in advance but I would think there would be an easier way to just pass that information using the link and readding it directly from the link.

    }
    ?>
    Last edited by Vagabond; Apr 24 '06, 03:59 AM.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You can read data from the URL using the super global array $_GET.

    for you example URL then

    $_GET['vegtible'] === "munchies"

    would be true

    Comment

    • Vagabond
      New Member
      • Apr 2006
      • 17

      #3
      Thx again for the help. That was what I was looking for and how I thought it should work. I must have done something wrong before because I would get a page not found error before but I do have it working now with your help and I can stop using session information for that stuff.
      Last edited by Vagabond; Apr 24 '06, 12:44 PM.

      Comment

      Working...