Re: php 4.0.5 to php 4.2.2

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

 



----- Original Message -----
From: "Chris Mach" <cjmach@learn.senecac.on.ca>
To: <php-db@lists.php.net>
Sent: Tuesday, April 22, 2003 4:15 PM
Subject: Re:  php 4.0.5 to php 4.2.2


> ok, let me see if i understand what your saying....
>
> so for $_POST['copy'] I have to go....
>
> $myrow['copy'] = $_POST['copy']
>

You have this code:
 if ($submit) {
           $sql = "INSERT INTO news (title,copy) VALUES ('$title','#~!&')";
           $result = mysql_query($sql);
           echo "Thank you! Information entered.\n";
           } else{
 ?>          <form method="post" action="<?php echo $PHP_SELF?>">
            Enter Title:<br><input type="text" name="title"><br>
            Enter Copy:<br><textarea name="copy" cols="75"
rows="10"></textarea><br>
            <input type="Submit" name="submit" value="Enter information">
            </form>
...

With register_globals off, each of the form values are in the variables
$_POST['title'], $_POST['copy'], and $_POST['submit'] and not $title,$copy,
and $submit.
It might be easier for you if your on a Apache server to use a .htaccess
file and turn register_globals back on.

If you can't do that, then the sql needs to be changed to:
$sql = "INSERT INTO news (title,copy) VALUES
('{$_POST['title']}','$_POST['copy']')";

and any you have to find all of the references to the globals in the form
(and on every form).




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux