Re: Need urgent help on post php long code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, April 21, 2005 12:55 am, Pieter du Toit said:
> I have the following code:
> $result = mysql_query("SELECT users.user_first_name, users.user_last_name,
> users.user_cell, users.user_idnom, users.user_email, users.user_adres1,
> users.user_adres2, users.user_pcode, users.user_city, users.user_prov FROM
> users WHERE users.user_id = '$user_id'");
>
> extract($row);
>
> $ewal_result = mysql_query("SELECT DECODE(ewallet.ewal_pass,
> '{$config["password_password"]}') AS ewal_pass FROM ewallet WHERE
> ewallet.user_id = '$user_id'");
>
> extract($row);
>
> dprint($row);
>
> $Co_ID = $config["e_wallet"]["Co_ID"];
>
> $Outlet = $config["e_wallet"]["Outlet"];
>
> $transac = get_nextid($_SESSION["database"], "transacs", "tran_id",
> "tran");
>
> !!!!! this is where i echo all my required vars to post, and i get a value
> for each, but when i post to the next form only $co_id and $outlet is
> posted
> !!!!!!

POST variables come from the HTTP interaction.

HTTP is stateless -- Nothing from one POST will get carried over to the
next unless *YOU* do something to make that happen.

You can pass them as HIDDEN INPUT, you can put them in your SESSION, you
can hire/train a squirrel to read them and repeat them, but they ain't
gonna get carried over unles YOU do it.

Neither $co_id nor $Outlet is POSTed.  You assign them in your script, so
of course they have values.

>
> echo "Admin testing<br>";
>
> echo "coid = ".$Co_ID;
>
> echo "Outlet = ".$Outlet;
>
> echo "user_email = ".$user_email;
>
> echo "ewal_pass = ".$ewal_pass;
>
> echo "user_id = ".$user_id.$transac;
>
> echo <<< END

These other variables would work *ONLY* if you manage to transmit $user_id
(used in the queries above) from page to page.


> <input type="hidden" name="Co_ID" value="$Co_ID">
>
> <input type="hidden" name="Outlet" value="$Outlet">
>
> <input type="hidden" name="UserName" value="$user_email">
>
> <input type="hidden" name="Password" value="$ewal_pass">
>
> <input type="hidden" name="Reference" value="$user_id:$transac">
>
> <input type="hidden" name="Lang" value="ENG">

Here you are passing two variables you're going to ignore anyway ($Co_ID
and $Outlet) and *NOT* passing $user_id you need in your queris, and,
well, I don't really know what you are trying to do with the other four
variables, but you've given me a headache. :-)

Sit down with a pencil and figure out exactly what data you need to
transmit from page to page, and what you can just lookup again, and where
the data will come from.

I say again:  POST data will not propogate itself. You MUST
store/propogate it in $_SESSION or as more hidden INPUT or propogate at
least the $user_id so you can look up their info again.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux