Jump to content

garydt

Members
  • Posts

    321
  • Joined

  • Last visited

    Never

Everything posted by garydt

  1. I've got a mail script, i'm not getting errors but i'm not getting emails either. $username = $row_Recordset4['usernm']; $from = 'test@uk.com'; $to = 'gary@garyt.co.uk'; $body = "test"; $headers = "From: info@example.com \r\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; mail($to, "An HTML Message", $body, $headers); php.ini file- [mail function] ; For Win32 only. ;SMTP = smtp.tiscali.co.uk ;smtp_port = 25 ; For Win32 only. sendmail_from = me@localhost.com sendmail_path = C:\Program Files\xampp\sendmail pop3_server= pop.tiscali.co.uk pop3_username= garydt88 pop3_password= garytanner
  2. I've sorted the above problem and i'm not getting errors but i'm not recieving the emails. Why would this be?
  3. I'm still getting error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for gary@garyt.co.uk in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 200 What does it mean?
  4. Thanks. I tried- // send emmail $big = $row_Recordset2['bigimagename']; $username = $row_Recordset4['usernm']; $from = 'test@uk.com'; $to = 'gary@garyt.co.uk'; $body = "test"; $headers = "From: info@example.com \r\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; mail("gary@garyt.co.uk", "An HTML Message", $body, $headers); And i got error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for gary@garyt.co.uk in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 200
  5. The error i'm getting is Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 194 $big = $row_Recordset2['bigimagename']; $username = $row_Recordset4['usernm']; $from = 'test@uk.com'; $to = 'gary@garyt.co.uk'; mail($to,$from,$big,$username); the settings in php.ini are [mail function] ; For Win32 only. ;SMTP = smtp.tiscali.co.uk ;smtp_port = 25 ; For Win32 only. sendmail_from = me@localhost.com sendmail_path = C:\Program Files\xampp\sendmail pop3_server= pop.tiscali.co.uk pop3_username= garydt88 pop3_password= garytanner What have i got wrong?
  6. The first 1 worked. Thanks alot.
  7. I get error - Column 'bigcaption' cannot be null when the user doesn't input anything for this field. Yet I've got other fields setup exactly the same and they work. I've tried setting 'bigcaption' to null and not null. both give the error. mysql_select_db($database_elvisdb, $elvisdb); $insertSQL = sprintf("INSERT INTO images (imageName, bigimagename, usnm, bigcaption) VALUES ('$smallimage', '$smallpics', '$user', %s)", GetSQLValueString($_POST['textfield'], "text")); $Result1 = mysql_query($insertSQL, $elvisdb) or die(mysql_error()); mysql_select_db($database_elvisdb, $elvisdb);
  8. Thanks i put- $fieldname = $_FILES['file']; list($width, $height, $type, $attr) = getimagesize($fieldname); and i get- Notice: Array to string conversion in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 42 Warning: getimagesize(Array) [function.getimagesize]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 42
  9. $chktype is givng image/pjpeg is that right?
  10. When the user uploads an image the script checks to see if its a jpeg. If it isn't it will redirect to another page but its redirecting regardless of the image being a jpeg or not. $chktype = $_FILES['file']['type']; if ($chktype!='jpeg' or $chktype!='JPEG') { header("Location: regform2.php"); exit; }
  11. Thanks. I've got a header location command at line 87, im not outputting anything to the screen before that so i can't see why i'm getting modifying header error.
  12. I can't see what I'm outputting to the screen before the headers as i'm gettinng 'cannot modify header' error. <?php require_once('Connections/elvisdb.php'); ?> <?php session_start(); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $user = ($_SESSION['MM_Username']); mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset3 = "SELECT * FROM userinformation ORDER BY id DESC"; $Recordset3 = mysql_query($query_Recordset3, $elvisdb) or die(mysql_error()); $row_Recordset3 = mysql_fetch_assoc($Recordset3); $totalRows_Recordset3 = mysql_num_rows($Recordset3); $field = $row_Recordset3['id']; $pass = $row_Recordset3['password']; $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE userinformation SET usernm=%s WHERE id='$field'", GetSQLValueString($_POST['textfield'], "text")); mysql_select_db($database_elvisdb, $elvisdb); $Result1 = mysql_query($updateSQL, $elvisdb) or die(mysql_error()); // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['textfield'])) { $loginUsername=$_POST['textfield']; $password=$_POST['hiddenField']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "logdonuserpagenew.php"; $MM_redirectLoginFailed = "logdonuserpagenew.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_elvisdb, $elvisdb); $LoginRS__query=sprintf("SELECT usernm, password FROM userinformation WHERE usernm=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $elvisdb) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; header("Location: logdonuserpagenew.php"); } } }
  13. I've made a page where it gets photos from a database and puts them into a seperate cell of a html table. Each photo has a link to another webpage. When i test the code each photo has a blue box/border around it. After i've clicked a photo the box/border turns brown as if i've set the a:link and a:visited to those colors but i haven't. Even when i set these to black the box/border around each photo still remains blue and, after i've clicked it, brown. How do i get rid of these boxs/borders? <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 {color: #FFFFFF} .style3 {color: #000099} body { background-color: #000000; } ul, li { color: #ffffff; } #Layer1 { position:absolute; left:7px; top:165px; width:180px; height:328px; z-index:1; } body,td,th { color: #FFFFFF; } --> </style> <td valign="top" ><a href="userpage.php?name=<?php echo $uname; ?>"><img src="<?php print $row_Recordset2['imageName'] ?>"></a></td>
  14. Thanks. Tried that, still no joy. What else can i try?
  15. In the php.ini I put this- [mail function] ; For Win32 only. ;SMTP = smtp.tiscali.co.uk ;smtp_port = 25 ; For Win32 only. sendmail_from = $From sendmail_path = C:\Program Files\xampp\sendmail pop3_server= pop.tiscali.co.uk pop3_username= garydt88@tiscali.co.uk pop3_password= garytanner I'm still getting error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for garydt88@tiscali.co.uk in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 55
  16. Thanks, How do i send it from the local server?
  17. I've changed the code to- mail("$To", "$Subject", "$Message", "From: $From" ); and i get error- Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for garydt88@tiscali.co.uk in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 55 Does this mean the mail server at tiscali is rejecting it? What can i do to resolve it?
  18. Thanks. I changed the code to what you said but i'm still getting the same error. mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = "SELECT email FROM userinformation"; $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $From = $row_Recordset2['email']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $user = ($_SESSION['MM_Username']); $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']); } mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = sprintf("SELECT * FROM images WHERE usnm = '$user'", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $Message = $row_Recordset2['imageName']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $To = "garydt88@tiscali.co.uk"; $Subject = "photo"; mail("$To", "$Subject", "$From", "$Message"); I also changed the php.ini - [mail function] ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = $row_Recordset2['email']
  19. I'm trying to get the website to email me some values but i get error- Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 48 This is in the php.ini- [mail function] ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = garydt88@tiscali.co.uk <?php require_once('Connections/elvisdb.php'); ?> <?php session_start(); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $user = ($_SESSION['MM_Username']); $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']); } mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = sprintf("SELECT * FROM images WHERE usnm = '$user'", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $from = $row_Recordset2['usnm']; $photo = $row_Recordset2['imageName']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $to = "garydt88@tiscali.co.uk"; $header = "photo"; mail($to,$from,$header,$message); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> registration complete </body> </html> <?php mysql_free_result($Recordset1); ?>
  20. Thanks. It's not in my spam folder. I've done new coding- $user = ($_SESSION['MM_Username']); $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']); } mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset1 = sprintf("SELECT * FROM images WHERE usnm = '$user'", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $elvisdb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $from = $row_Recordset2['usnm']; $photo = $row_Recordset2['imageName']; $totalRows_Recordset1 = mysql_num_rows($Recordset1); $to = "garydt88@tiscali.co.uk"; $header = "photo"; mail($to,$from,$header,$message); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> registration complete </body> </html> <?php mysql_free_result($Recordset1); ?> and i get error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\epeople\regcomplete.php on line 48 registration complete Even though i haven't changed my php.ini file.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.