wannes
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by wannes
-
-
My apologize if this should be here since this involves SQL.
My user can register himself ( just an email ) to a mail list.
He will get a mail after that, but the message in the mail should differ:
If there are under 100 people in the DB he should get something like " you are one of the 100 first people ", if there are more then 100 people it should say " sorry, to late ".
I can seem to get it to work so help would be awesome
( ps, I kinda need an anwser fast :s )
$sqlInsert = "INSERT INTO j5_maillist (email) VALUES('$email')"; $sql = "SELECT COUNT(email) FROM j5_maillist AS aantalEmails"; $result = mysql_query($sql); if( mysql_num_rows($result) <= "3" ){ $message = 'you are one of the 100 first people '; } else { $message = 'sorry, to late '; } $to = $email; $subject = 'Nihonto Appreciation Day'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: '.$email.'' . "\r\n"; $headers .= 'From: Nihonto Appreciation Day' . "\r\n"; mail($to, $subject, $message, $headers); return mysql_query($sql);
Ajax file upload problem
in PHP Coding Help
Posted
I'm trying to upload a file using ajax, but I have some problems.
First I'll show the code :
HTML
PHP
Here I get the error <b>Notice</b>: Undefined index: upload in <b>/Applications/MAMP/htdocs/2011-2012/kerstkaart/includes/index.php</b> on line <b>16</b><br /> and the var_dump gives an empty array
AJAX
What I try to do here is getting the value of the selected file and redraw my canvas ( HTML5 ) so that the chosen pic is the background.
The file i upload to test is a gif of 4KB, so not that big.
Can anyone help me with this confusing problem ?
Thanks,