php-windows Digest 13 Jun 2005 14:30:50 -0000 Issue 2693
Topics (messages 26090 through 26093):
Re: Problems with POST method...
26090 by: disguised.jedi.gmail.com
26091 by: disguised.jedi.gmail.com
MySQL Support
26092 by: Brian D. McGrew
Extension
26093 by: Brian D. McGrew
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On 6/12/05, Pablo Hern�n Saro <[EMAIL PROTECTED]> wrote:
> HTML code (the file that contains the form):
>
> <form action="file.php" method="post" name="form1" target="_self">
> <table width="95%" border="0" align="center">
> <tr>
> <td width="50%" height="26"><div align="right">Name:
> <input name="name" type="text" id="name" maxlength="50">
> </div></td>
> <td width="50%"><div align="right">Mail:
> <input name="mail" type="text" id="mail" maxlength="50">
> </div></td>
> </tr>
> <tr>
> <td> <div align="right">
> <input name="clear" type="reset" id="clear" value="Clear">
> <input name="cancel" type="button" id="cancel" value="Cancel"
> onClick="javascript:window.close();">
> </div></td>
> <td><div align="right">
> <input name="ok" type="submit" id="ok" value="Ok">
> </div></td>
> </tr>
> </table>
> </form>
>
> PHP code:
>
> <?php
> if ($name=="" || $mail=="") {
> echo "<font face='Verdana' size='4' color='red'>You must complete all
> fields.</font>";
> } else {
> echo "<font face='Verdana' size='4'>All right!</font>";
> }
> ?>
>
> When I submit the form... CRASH!!
>
> Thanks
>
> Pablo Hern�n Saro
> LRU #388723
>
OK...There are a few problems here. First of all, is
'register_globals' set to 'on' in php.ini? That is the configuration
setting that tells PHP to fill in all of the POST and GET vars as
regular variables. This is HUGE security vulnerability, so you
shouldn't use it. Instead, use this php code.
<?php
if ($_POST['name'] == "" || $_POST['mail'] == "") {
echo "<font face='Verdana' size='4' color='red'>You must complete all
fields.</font>";
} else {
echo "<font face='Verdana' size='4'>All right!</font>";
}
?>
That should work great. Or you could turn register_globals on and
allow the user to change the value of any variable in your script.
HTH,
--
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"
Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.
This message is Certified Virus Free
--- End Message ---
--- Begin Message ---
On 6/12/05, Pablo Hern�n Saro <[EMAIL PROTECTED]> wrote:
> Thanks for all!
> Finally I used $var=$_POST['var']; and works!
>
> bye
>
> Pablo Hern�n Saro
> LRU #388723
Please, when replying to messages on this list, click "Reply to All".
This will make sure the message is sent to the list. It will then be
available to everyone, and be put on the archives.
I'm posting this solution for the sake of the archives!
--
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"
Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.
This message is Certified Virus Free
--- End Message ---
--- Begin Message ---
I installed a pretty general manual installation of PHP and it's
working, I do a phpinfo() and life is good. I can't seem to get it to
connect to MySQL though. I read something about the extensions and PEAR
and all that. I've got the libraries in my Windows directory and all
that but when I do a phpinfo() I get no references to MySQL and I can't
connect to the database. MySQL is installed locally on the box.
Any ideas?
-brian
Brian D. McGrew { [EMAIL PROTECTED] || [EMAIL PROTECTED] }
---
> YOU! Off my planet!
--- End Message ---
--- Begin Message ---
Good morning,
I seem to have PHP working with IIS reasonably well, I have a .php file
with <? Phpinfo(); ?> in it and life is good. If I put that same line
in an HTML file the server doesn't know what to do with it. On Unix
with Apache and PHP I can put PHP directives in .htm[l] files and it
works. Anyone know how to do this on IIS???
-brian
Brian D. McGrew { [EMAIL PROTECTED] || [EMAIL PROTECTED] }
---
> YOU! Off my planet!
--- End Message ---