|
Posted by Stefan Rybacki on 07/13/05 17:57
ft310 wrote:
> The following code is lifted from an html / php page -- all of the error
> checking and other stuff is removed but is there and working in the actual
> page.
> The issue is moving between html variables and php variables.
>
> I understand html variables holdCounty, holdState and County are not
> available to a $_Post function until the Submit function is engaged.
>
> My question: Is there anyway, short of the round trip caused by either
> clicking the Submit button or simulating the same action in javascript, to
> move the html variables into a php context. It is very hard to justify this
> methodology as there are all sorts of User impacts. I can not believe this
> is a unique issue and it must have been solved before. I'm a newbee and need
> help please as I hate making Users work -- bad form.
>
> $localCounty=$_POST[holdCounty] ;
> $localState=$_POST[holdState] ;
> $localTest=$_POST[County] ;
>
> $s_sqlT1="SELECT Town, Area, State, County FROM LocationsGB " ;
> if ($localTest=="All")
> {
> $s_sqlT2 = "" ;
> }
> else
> {
> $s_sqlT2="WHERE County='".$localCounty."' AND
> State='".$localState."' " ;
> }
> $s_sqlT3="GROUP BY State, Town ORDER BY State DESC, Town, Area" ;
> $s_sqlT0=$s_sqlT1.$s_sqlT2.$s_sqlT3 ;
>
> $dbt=mysql_connect('localhost', 'rhodeisl_ft310', 'billwilson') ;
> mysql_select_db('rhodeisl_RISC',$dbt) ;
> $resultT=mysql_query($s_sqlT0,$dbt) ;
>
> At the end of this there is no information returned from the database.
>
> NOTES:
> A. The full SQL statement is constructed ($s_sqlT0) but the values for
> $localCounty and $localState are not there
> B. Appropriate information is in the database.
> C. It appears the SQL statement works when tested standalone.
> D. holdCounty and holdState are html form text boxes and have information
> in them
> E, County is the result of an html drop down list selection
>
> tooheys@fullchannel.net
>
>
What does print_r($_POST) say?
[Back to original message]
|