Hello again,

I would appreciate if someone could help me out with this one.

Thanks again

--Pushpinder




On Friday, August 8, 2003, at 11:46 AM, Pushpinder Singh Garcha wrote:


Hello All,

I am using php and mysql in my application which allows users to search/query a database. The database is cast and has about 32 rows per record. When the user fires the query, the result is in the form of a table that contains only the 6 important rows of the entire record. Also there is a provision to allow the user to see the full record set by clicking on the link under the 'complete profile' contained in the table. (as shown below). The name of this script is lookup_results.php

Here is the result for a companies in city = 'Charlotte' / Primary key of the table is the name of the company.
----------------------------------------------------------------------- ----------------------------------------------------------------------- -----------------------------
Company Name Main Contact City Website E-Mail Complete Profile
----------------------------------------------------------------------- ----------------------------------------------------------------------- -----------------------------
PSG Pushpy Charlotte http://www.psg.com [EMAIL PROTECTED] --Link--
TFNA Napier Charlotte http://www.psg.com [EMAIL PROTECTED] --Link--
Micro Bates Charlotte http://www.psg.com [EMAIL PROTECTED] --Link--
CNN Garcha PS Charlotte http://www.psg.com [EMAIL PROTECTED] --Link--
----------------------------------------------------------------------- ----------------------------------------------------------------------- -----------------------------



To see the complete profile of the company I use href=\"full_profile_1.php?name=".$row['company'].
So once we are on the full_profile_1.php, we can see all the contents of the record. Also we display a form where we can edit the results in place. The logic works like this.


// full_profile_1.php LOGIC


<?


session_start();

if (isset($_SESSION['validuser']))
  {

    if($submit)
      {
               update the changes that the user has made to the form


My question here is " How do I get the name of the company that was passed to this script as a $_GET Parameter. I cannot use the
$company because it is out of scope. The only other option would be to use $_SESSION['link'] .... i.e. Store the names of the
companies in a session array. So now the array as per the example above would be {'PSG','TFNA', 'Micro', 'CNN' } . The way this
will work is how do I get the index of the 'link' array that is applicable in this example.


Here the name of the company would be $company = $_SESSION['link'][0];
If we had clicked the second row of the results table the name of the compnay would have been 'TFNA' i.e. $_SESSION['link'][1]
and so on. How do I pass the index. ???





}


   else
      {

$company = $_GET['name'];
USE <form name="form1" method="post" action="full_profile_1.php">
AND display all the rows of the record where company_name ='company'


}

}

else {
     redirect the user to the ERROR Page
}

// end of pseudo- code


Thanks in advance guys. I know this may sound a lil' vague , but I have tried to present the logic and the problem.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to