Re: PHP calling PHP?

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



> 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@xxxxxxxxxxxxxx





[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux