edbr 22 Junior Poster
if(condition)
{
//do stuff
}
you can also use this, it saves the test mail into a folder of your choosing as a file works ok, http://www.toolheap.com/test-mail-server-tool/. free BTW
this might help you, i did a search on site https://www.daniweb.com/web-development/php/threads/273362/add-required-fields-to-php-contact-form
why is this commented out?
<?php
include("plogin.php");
//$_SESSION["userId"] = $_POST['id'];
//$userId = $_POST['id'];
and put
session_start();
at the begining
i just teseted yor code and both mails were sent. Problem is elsewhere then i would say
well although you are still using mysql
you could do something like
$query = "SELECT COUNT(id) FROM members";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "There are ". $row['COUNT(id)'] ." members.";
echo "<br />";
}
@mattster yes i wanted to try to add a hearer in a $_POST to test the validation, such as test message to an address of mine , i cant fing an examle and i just dont know how to code one. i am not a huge fan of recaptcha as it is not that poular with all users,im trying now with a math question answer but avoiding language so a 2+2 or 9-8 type thing.
@borzoi great thinking, i thought you might have it but no chron job or any stray file that i can find.
i will go through the failed/returned mails aginn see if i can find a clue.
I had noticed a lot of returned mails with spam content arriving daily. i renewed the old mailing scripts (which was overdue) to include jquery clientside(irrelevant i know) and serverside switched to phpmailer adding a captcha as well as the existing honeytrap that i had before. now although less im still getting a few.
Anyway to the point, I have been looking for some code that i could use to try and inject a spam like mail to my own address for the pupose of testing these and other web forms, I do not know how to do this , vaguely to add new headers but not how to do it. Can any one provide a test I could use? I promise im not a spammer
Try
RewriteEngine On
RewriteRule ^([^/]*)\ /web/index.php?a=profile&u=$1 [L]
could this be a dtetime format issue? I would echo all the values to see how they compare
well this is embarasing. i changed to preparing an array and i caught the exeption (not sure why i didnt before ) it was a problem caused by my bad typing (again) in lines 33 and 34 i left some spaces
:over_30_high '.
thanks for your help, I was having trouble seeing this code through the red mist that was forming :)
@pritaeas you mean try and catch? i did that already but tried again and got naff all returned. im thinkingh of repacing this update with a standard procedule update to try and pin it down. Im guessing the code looks ok to you?
I also replaced the where clause with its unique id and added the PDO::PARAM_INT back which i had removed. I know this is something dumb but im getting to the spent too much time on this state.
@jstfsklh211 thanks but still the same
@pritaeas you mean try and catch? i did that already but tried again and got naff all returned. im thinkingh of repacing this update with a standard procedule update to try and pin it down. Im guessing the code looks ok to you?
I also replaced the where clause with its unique id and added the PDO::PARAM_INT back which i had removed. I know this is something dumb but im getting to the spent too much time on this state.
@jstfsklh211 thanks but still the same
well it was an error but still not updating, im pretty noobiw with PDO but i thought this was not so difficult. It definitely connects, the values have been passed , so im guessing the error is in the update code or bind value code. i just cant see it and ive been looking at it way to long mow :)
$sql ="UPDATE late SET late = :late,
late_low = :late_low,
late_high = :late_high,
late_peak = :late_peak,
over_14 = :over_14,
over_14_low = :over_14_low,
over_14_high = :over_14_high,
over_14_Peak = :over_14_Peak,
over_30 = :over_30,
over_30_low = :over_30_low,
over_30_high = :over_30_high,
over_14_Peak = :over_14_Peak,
tax = :tax
WHERE title =:title";
$stmt = $dbh->prepare($sql);
$stmt->bindValue(':title', $_POST['title']);
$stmt->bindValue(':late', $_POST['late']);
$stmt->bindValue(':late_low', $_POST['late_low']);
$stmt->bindValue(':late_high', $_POST['late_high']);
$stmt->bindValue(':late_peak', $_POST[' late_peak']);
$stmt->bindValue(':over_14', $_POST['over_14']);
$stmt->bindValue(':over_14_low', $_POST['over_14_low']);
$stmt->bindValue(':over_14_high', $_POST['over_14_high']);
$stmt->bindValue(':over_14_Peak', $_POST['over_14_Peak']);
$stmt->bindValue(': over_30', $_POST['over_30']);
$stmt->bindValue(':over_30_low', $_POST['over_30_low']);
$stmt->bindValue(':over_30_high ', $_POST['over_30_high']);
$stmt->bindValue(':over_14_Peak ', $_POST['over_14_Peak']);
$stmt->bindValue(':tax', $_POST['tax']);
$stmt->execute();
if ($stmt)
{
echo '<p>Rows updated: ' . $stmt->rowCount() . '</p>';
}
else
{
echo '<p>Update failed</p>';
}
struggling with this update in PDO, i have hacked away at it in frustration, but i cannot see my error