Re: PHP calling PHP?

From: Grant <grant(at)conprojan(dot)com(dot)au>
To: Steve Werby <steve-lists(at)befriend(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PHP calling PHP?
Date: 2001-05-10 04:54:58
Message-ID: Pine.LNX.4.21.0105101445030.11225-100000@webster.conprojan.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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>

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Roberto Mello 2001-05-10 05:03:48 Re: PHP calling PHP?
Previous Message Steve Werby 2001-05-10 04:36:46 Re: PHP calling PHP?