[PHP] A PHP UPDATE problem

2003-03-08 Thread Terry Lau
Hello,
I am creating a polling system. Its operation likes this:
when the people vote the item, it updates the database by adding 1 for the 
item automatically.
The part of code is showed here:

?php
$colname_rsAddVote = 1;
if (isset($HTTP_POST_VARS['Vote'])) {
$colname_rsAddVote = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['Vote'] : 
addslashes($HTTP_POST_VARS['Vote']);
}
mysql_select_db($database_cnTesting, $cnTesting);
$query_rsAddVote = UPDATE Testing SET GetVotes = GetVotes + 1 WHERE VoteID 
= %s, $colname_rsAddVote);
$rsAddVote = mysql_query($query_rsAddVote, $cnTesting) or 
die(mysql_error());
?
In fact, I use Dreamweaver MX to create the page.
But When I run the page, it shows an error. I don't how to reform it. 
Thanks!!

Terry



_
¤µ¤é¬P®y http://www.msn.com.hk/fortune/west/ ¹Bµ{ 

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


[PHP] mail() in Linux

2003-03-04 Thread Terry Lau
Hello,
   I want to use the mail() in my Linux computer.But I don't know how to 
set the php.ini file to enable it.I am using the SMTP server provided by 
ISP. Do I need to setup my own mail server?
Thanks!

Terry



_
¤µ¤é¬P®y http://www.msn.com.hk/fortune/west/ ¹Bµ{ 

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


[PHP] cookie problem..

2003-02-21 Thread Terry Lau
Hello,
I want to set a cookie when I enter a text into the text field, and it 
shows the text I submitted immediately, thus I write a sample php code like 
this:

?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie(name, $HTTP_POST_VARS['Name'], time()+86400*10);
}
echo $name;
?
(I set the text field is Name and the data will be sent to another page)
In another page, I insert ?php echo $HTTP_COOKIE_VARS['name']; ? in the 
beginning of the code.

Is the code right?

Then I run the test, I enter a name into the text field and submit it. But 
it shows Notice: Undefined index: name in .., it can't show the name I 
submitted.
Why?Anything wrong??

Thanks!!
Terry


_
¤µ¤é¬P®y  http://www.msn.com.hk/fortune/west/ ¹Bµ{ 

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


[PHP] cookie problem....

2003-02-13 Thread Terry Lau
Hello,
   I created a PHP page that included cookie, here is the PHP code:
?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie(Name, $HTTP_POST_VARS['Name'], time()+86400*10);
}
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=big5
/head

body
form name=form1 method=post action=request.php
 pName: 
   input name=Name type=text id=Name
 /p
 p
   input type=submit name=Submit value=Submit
 /p
/form
/body
/html

But when I called the cookie variable in another page, it showed 
Notice: Undefined index: Name in. Here is the PHP code in another 
page:

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=big5
/head

body
HI!! ?php echo $HTTP_COOKIE_VARS['Name']; ? 
/body
/html

Any problems in my PHP pages? How to solve it?
THANKS!!
 Terry



_
MSN ¬Ûï´£¨Ñ±z³Ì²³æªº¤è¦¡¤À¨É¨Ã¦C¦L±zªº¬Û¤ù¡A½Ð²¾¦Ü :  
http://photos.msn.com.hk/support/worldwide.aspx  


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



[PHP] I have a problem while installing...

2003-01-09 Thread Terry Lau
Hello,

I'm using Red Hat Linux 8.0. The Apache Server 2.0 and php 4.2.2 are 
installed when I install Linux. The server is installed in /var/. So, I 
don't know how to follow the installation instructions described in your 
web to set up php. Do I need to install apache and php again? Furthermore, 
I don't know what i need to edit the php.ini file and I have modified the 
httpd.conf file. Thus, could you feel free to describe the detailed 
instruction for me? 
Thanks for your help!

Terry


_
¨Ï¥Î MSN Messenger¡A»PªB¤Í¦b½u¤W²á¤Ñ: http://messenger.microsoft.com/tc 


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