I have a page where my users can input up to 10 email addresses with 10 accompanying names. Everything in this code works fine except for the last two values I want inputted (SESSIONemail and SESSIONname).
There has to be something wrong because it is always inputting NULL instead of the name or the email.
Here is the code:
Code: Select all
for($k=1;$k<=10;$k++)
{
if($_SESSION['email_'.$k])
{
$query = "INSERT INTO mail_list (m_id, m_username, m_email, m_name) VALUES ('$user_id','{$_SESSION['username']}', '{$_SESSION['email_{$k}']}', '{$_SESSION['name_{$k}']}')";
mysql_query($query) or die(mysql_error());
}
}