
TheUkSniper
Members-
Posts
23 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
TheUkSniper's Achievements

Newbie (1/5)
0
Reputation
-
Hi Keith, That works perfectly in both ways Thank you for your help! Kind Regards,
-
SELECT {Whatever Variables You Want Here} FROM `images` LEFT JOIN `categories` ON `images`.`categoryid` = `categories`.`id`
-
Hello, Never had to use a IF query before in this way so not sure if its possible. My Query is What I want to do is if `SA_Subscriptions`.`CCat` = 0, I want to join SA_Prices To SA_Lessons on column LPRate1. If it does not equal 0, I want the join to be on comum LPRate2. Is this possible to do? Kind Regards, Alex
-
Hello, The error I'm getting is coming from the remote mail client. Services like hotmail are recieving the mail but one company that I have to send emails too is not (even though it was before). This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [email protected] SMTP error from remote mail server after end of data: host mail.dcleisure.co.uk [195.224.182.114]: 550 This message is spam and is rejected. Code I am using is as follows; // subject $subject = 'iSwim Registration'; // message $message = ' <html> <head> <title>iSwim Registration</title> <style type="text/css"> <!-- body {font-family: Verdana, Arial, Helvetica, sans-serif} .style1 {font-weight: bold} .style2 {color: #0089CE} --> </style> </head> <body> <p align="left" class="style1"><img src="http://www.wolvesstaff.co.uk/iswim/images/iswimheader.png" width="536" height="124"></p> <h3 class="style2">Your registration to iSwim is now complete!</h3> <p>Your temporary password is: Blah</p> <p>Once you have logged in, you can change this password to something more memorable!<br> We look forward to seeing you online soon!</p> <p><span class="style1">iSwim Administration Team</span><br> </p> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset="iso-8859-1"' . "\r\n"; // Additional headers $headers .= 'To: [email protected], [email protected]' . "\r\n"; $headers .= 'From: iSwim Robot <[email protected]>' . "\r\n"; // Mail it $sendMail = @mail($to, $subject, $message, $headers); The headers with the To: email address obviously have been changed for testing purposes, this would usually be a variable set prior to the page being loaded. Kind Regards,
-
Have a look at: http://www.w3schools.com/php/php_if_else.asp
-
Hello, Been using the mail() function for some time now, but since I have moved to a new host, my mail is getting bouncebacks 550 (Email is detected as spam). Any ideas on why this may be if the script has not changed? Kind Regards, Alex
-
$q6 = showMyResults(q6); // -> this calls the funtion that converts arrays (multiple options e.g checkboxes) into a string $q7 = $_POST["q7"]; // -> this calls the result directly Radio buttons can only have 1 option selected so you would call for the result directly using $q7 = $_POST["q7"];
-
Hi, change this >>> <?php include "connect.php"; $tableName = "results"; $q1 = $_POST["q1"]; $q2 = $_POST["q2"]; $q3 = $_POST["q3"]; $q4 = $_POST["q4"]; $q5 = $_POST["q5"]; $q6 = $_POST["q6"]; $q7 = $_POST["q7"]; $q8 = $_POST["q8"]; $q9 = $_POST["q9"]; $insert = mysql_query("INSERT INTO $tableName (id,qone,qtwo,qthree,qfour,qfive,qsix,qseven,qeight,qnine) VALUES ('','$q1','$q2','$q3','$q4','$q5','$q6','$q7','$q8','$q9')") or die(mysql_error()); ?> to >>> <?php include "connect.php"; function showMyResults($a) { $array = $_POST["$a"]; $count = count($_POST["$a"]); $i = 0; $v = 0; while($i<$count) { if ($i == 0) $output .= $array[$i]; else $output .= ", ".$array[$i]; $i++; } return $output; } $tableName = "results"; $q1 = showMyResults(q1); $q2 = showMyResults(q2); $q3 = showMyResults(q3); $q4 = showMyResults(q4); $q5 = showMyResults(q5); $q6 = showMyResults(q6); $q7 = $_POST["q7"]; $q8 = showMyResults(q8); $q9 = showMyResults(q9); if (isset($_GET["submit"])) $insert = mysql_query("INSERT INTO $tableName (qone,qtwo,qthree,qfour,qfive,qsix,qseven,qeight,qnine) VALUES ('$q1','$q2','$q3','$q4','$q5','$q6','$q7','$q8','$q9')") or die(mysql_error()); ?> Also Change >>> <form action="<?php echo $PHP_SELF;?>" method="post"> To >>> <form action="<?php echo $PHP_SELF;?>?submit" method="post"> This will stop the script trying to insert rows when it doesn't have any data. I would also suggest changing some of your check boxes to radio buttons else you will have multiple answers when only one is necessary. How I have currently changed your code will show multiple selections e.g Male and Female in the DB if both boxes are checked. Alex
-
Very true, but considering alot of people have a single password for all websites and programs they use, should'nt you as a code developer be protecting them further. It goes further than what a hacker is going to do with your site when he has email addresses and passwrods of potentially thousands of users.
-
suppose u cud use sql to move their login details to the phpbb login system
-
is there a log for whatever program ur using to send the email so u can see if it has been sent out?
-
[code]if((((($_REQUEST['who'] == 1) || ($_REQUEST['who'] == 2) || ($_REQUEST['who'] == 3) || ($_REQUEST['who'] == 4) || ($_REQUEST['who'] == 5))))) >>> { <<< $num = mysql_num_rows(mysql_query("SELECT * FROM staff where level='".$_REQUEST['who']."'")); $row = mysql_fetch_array(mysql_query("SELECT * FROM staff where level='".$_REQUEST['who']."'")); mysql_query("INSERT INTO privmsgs (msg_title, msg_txt, msg_read, msg_date, msg_time, msg_ip, msg_to, msg_from) VALUES(\"".$_REQUEST['subject']."\",\"".nl2br($_REQUEST['message'])."\",\"0\",\"".date('j-m-Y')."\",\"".time()."\",\"".$_SERVER['REMOTE_ADDR']."\",\"".$row['username']."\",\"".$_REQUEST['msg_from']."\")"); >>> } <<< echo 'Your message has been sent to '.$num.' users.<p><a href="privmsgs.php">Go Back to Inbox</a>'; >>> } <<< elseif[/code] well im guessin u need that while there because you open one bracket yet close it twice.. the code u changed has that bracket so im suprised u havent got a parse error for an unexpected } [code]while($row = mysql_fetch_array($result)){[/code]
-
Basically, it all used to work, untill I changed [code] $sql = "SELECT * FROM staff where level='".$_REQUEST['who']."'"; $result = mysql_query($sql); $num = mysql_num_rows($result); while($row = mysql_fetch_array($result)){[/code] To this: [code] $num = mysql_num_rows(mysql_query("SELECT * FROM staff where level='".$_REQUEST['who']."'")); $row = mysql_fetch_array(mysql_query("SELECT * FROM staff where level='".$_REQUEST['who']."'"));[/code] [/quote] no immediate probs in ur code but if tht was exactly what u have changed.. u started a while function on the original and then stopped using it on the replaced code.. that may be a problem if u need that function to run.. why not just change the code back :S
-
are you running the mail server off your own computer?? if so then your mail has probally been put in ur junk email folder
-
:) easy mistake!