Jump to content

TheUkSniper

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by TheUkSniper

  1. Hi Keith, That works perfectly in both ways Thank you for your help! Kind Regards,
  2. SELECT {Whatever Variables You Want Here} FROM `images` LEFT JOIN `categories` ON `images`.`categoryid` = `categories`.`id`
  3. 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
  4. 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: xxxxxxxxxxxx@dcleisure.co.uk 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: xxxxxxxxxxxx@hotmail.com, xxxxxxxxxxxxx@dcleisure.co.uk' . "\r\n"; $headers .= 'From: iSwim Robot <iSwim@wolvesstaff.co.uk>' . "\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,
  5. Have a look at: http://www.w3schools.com/php/php_if_else.asp
  6. 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
  7. $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"];
  8. 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
  9. 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.
  10. suppose u cud use sql to move their login details to the phpbb login system
  11. is there a log for whatever program ur using to send the email so u can see if it has been sent out?
  12. [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]
  13. 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
  14. are you running the mail server off your own computer?? if so then your mail has probally been put in ur junk email folder
  15. have u got the url for the site because the wrapping should stop the scroll bars
  16. not too sure what ur asking but thats the code below u could use to disable a radio box to be checked so if the variable $status = 0... php would write into the code disabling the radio box.. no else is needed as by default it should be enabled [code]<input type='radio' name='product' <? if (isset($status == 0)) echo "value='disable'" ?> class='style5'>[/code]
  17. i didnt no text boxes did scroll bars :S if your refering to a txt area... try this [code]<textarea name="textfield" wrap="VIRTUAL">TEXT-HERE</textarea>[/code]
  18. currently i got this Page2.php - this is the main page and has the iframe for Page3.php Page3.php - autorefreshes every 5 seconds, looks up the database and checks whether the database says the pages is locked (0) or open (1). If its locked, it will take over Page2.php via js changing the page to Lock.php how would i go about doing this with AJAX... am i right by thinking i need to create a php file that checks the database to see if the page is locked and echo's either 1 or 0... then the Page2.php must contain some AJAX script to read the php file and then will change the pages location if the php file echos 0... if it is.. any one got any idea where to find some AJAX code to do this cus the parts i found just use text and html files thanx
  19. you make it practically unpossible to help you if we cant see your code... copy just a few lines from the end rather than the whole code if thats the part where the problem is :)
  20. got the ebook on learning ajax.. not read it yet tho but im not sure tht ajax can refresh results on a time limit
  21. i have got a php script i want to reload every 5 seconds when someone is on it... i currently have it in a hidden IFRAME but on each refresh u get tht clicking noise... is there anyway to either stop the clicking noise or to get php to reload without taking the user refreshing the page they are on (dont think this is possible) thanks :)
  22. when i visit another persons site, is there anyway i can change their page title? javascript:void(document.title="NEWPAGETITLE") i thought that would work in the same way as the status bar but it doesnt :( any ideas? thanks
×
×
  • 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.