Re: PHP calling PHP? - Mailing list pgsql-php

From Grant
Subject Re: PHP calling PHP?
Date
Msg-id Pine.LNX.4.21.0105101445030.11225-100000@webster.conprojan.com.au
Whole thread Raw
In response to Re: PHP calling PHP?  ("Steve Werby" <steve-lists@befriend.com>)
Responses Re: PHP calling PHP?  (Roberto Mello <rmello@cc.usu.edu>)
Re: PHP calling PHP?  (Roberto Mello <rmello@cc.usu.edu>)
List pgsql-php
> You cut out my example which demonstrated a way to use variable variables to
> access a variable name consisting solely of a number.  Though I did say
> variables cannot have numbers in their name, I really meant that they cannot
> consist solely of numbers.  The reason I made the point and posted the
> example was b/c I've seen programmers who wanted to apply numeric variable
> names from within a loop and this workaround allows this to be done.

Sorry dude, but yes! Variables inside variables are very elite.

For instance:

Question: "Please help, I'd like dynamic field names, how can I do this?!"

<HTML>
<BODY>

<?

if (isset($username)):

echo "Username is <B>" . $$username . "</B><BR>\n";
echo "Password is <B>" . $$password . "</B><BR><BR>\n";
echo "<A HREF=$PHP_SELF>Back</A>\n";

else:

$time = date("U");
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=\"POST\">\n";
echo "Username: <INPUT
TYPE=\"TEXT\" NAME=\"$time" . "_u\" AUTOCOMPLETE=\"OFF\"><BR>\n";
echo "Password: <INPUT TYPE=\"PASSWORD\" NAME=\"$time" . "_p\"><BR>\n";
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"username\" VALUE=\"$time" . "_u\">\n";
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"password\" VALUE=\"$time" . "_p\">\n";
echo "<INPUT TYPE=\"SUBMIT\" NAME=\"Submit\" VALUE=\"Submit\">\n";

endif;

?>

</FORM>

</BODY>
</HTML>


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org




pgsql-php by date:

Previous
From: "Steve Werby"
Date:
Subject: Re: PHP calling PHP?
Next
From: Roberto Mello
Date:
Subject: Re: PHP calling PHP?