Posted: Fri Dec 13, 2002 4:19 pm
how are you trying to enter the email into the news_news table?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$result = mysql_query($sql)
or die ("Can't execute query.");
$num = mysql_numrows($result);
$email = $resultї"email"];
if ($num != 0) {
$cookie_name_auth = "status";
$cookie_value_auth = "ok";
$cookie_expire_auth = 0;
$cookie_domain_auth = ".bve.32k.org";
setcookie($cookie_name_auth, $cookie_value_auth, $cookie_expire_auth, "/" , $cookie_domain_auth, 0);
$cookie_name_user = "user";
$cookie_value_user = "$username";
$cookie_expire_user = time()+86400;
$cookie_domain_user = ".bve.32k.org";
setcookie($cookie_name_user, $cookie_value_user, $cookie_expire_user, "/" , $cookie_domain_user, 0);
$cookie_name_email = "email";
$cookie_value_email = "$email";
$cookie_expire_email = time()+86400;
$cookie_domain_email = ".bve.32k.org";
setcookie($cookie_name_email, $cookie_value_email, $cookie_expire_email, "/" , $cookie_domain_email, 0);Code: Select all
$result = mysql_query($sql)
or die ("Can't execute query.");
$num = mysql_numrows($result);
$email = $result["email"];Code: Select all
$result = mysql_query($sql)
or die ("Can't execute query.");
$num = mysql_num_rows($result);
$result = mysql_fetch_array($result);
$email = $result["email"];Code: Select all
<?php
require("news_connect.php");
if(@$action=="submit")
{
if ((!$news_headline) || (!$news_news) || (!$news_link)) {
echo "Please fill in all fields<br>\n";
} else {
mysql_query("INSERT INTO news_news (headline,news,link,user,timestamp,email) VALUES ('$news_headline','$news_news','$news_link','$user','$email',".time().")");
echo "News added<br>\n";
}}
?>Code: Select all
mysql_query("INSERT INTO news_news (headline,news,link,user,timestamp,email) VALUES ('$news_headline','$news_news','$news_link','$user',".time()."),'$email'");Code: Select all
mysql_query("INSERT INTO news_news (headline,news,link,user,timestamp,email) VALUES ('$news_headline','$news_news','$news_link','$user',".time().",'$email')");