Jump to content

mrdamien

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by mrdamien

  1. Headers are optional bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
  2. mgallforever pointed out your putting the mail() paramaters in the wrong way: mail(to,subject,message[,headers]); try <?php $to = "bowlingklubkranj@gmail.com"; $user = $_POST["user"]; $email = $_POST["email"]; $comments = $_POST["comments"]; $subject= "From: $email"; mail($to, $subject, $comments); echo "Hvala za sporocilo."; ?>
  3. Try this: <?php $to = "bowlingklubkranj@gmail.com"; $user = $_POST["user"]; $email = $_POST["email"]; $comments = $_POST["comments"]; $headers = "From: $email"; mail($to, $comments, $headers); echo "Hvala za sporocilo."; ?> $_REQUEST is something else...
  4. mrdamien

    SQL Issue

    If I understand correctly, you'll want a query similar to something like this: SELECT users.user_id, COUNT(posts.post_id) AS u_postcount FROM users INNER JOIN posts ON users.user_id = posts.fk_users INNER JOIN threads ON posts.fk_threads = threads.threads_id WHERE threads.threads_id = ? GROUP BY users.user_id; meaning select the users and their postcount, but only the users that have posted on threads_id
  5. Sessions. You can do index.php <? session_start(); $_SESSION['varname'] = "data"; $_SESSION['address'] = "11111 blue street"; ?> page2.php <? session_start(); echo $_SESSION['varname'] . " " . $_SESSION['address']; ?> Check the php website for more info
  6. mrdamien

    SQL Issue

    Sorry but I don't understand what the problem is. Is it not efficient enough? Did you want an INNER JOIN instead of a LEFT JOIN?
  7. Well, since I don't know what this is for I'll just start by saying, encryption is not a reliable way to protect info. 1) PHP offers some premade functions http://ca.php.net/base64%20encode http://ca.php.net/manual/en/function.base64-decode.php <?php echo base64_encode('This is an encoded string'); //VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw== ?> <?php echo base64_decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='); //This is an encoded string ?> 2) Making your own encryption scheme (a good one) takes a lot of math skills (that I don't have).
  8. Though there is nothing wrong with that, an easyer method is to use mysql_insert_id() http://ca3.php.net/manual/en/function.mysql-insert-id.php # use this statement to enter the patient data $sql_1= INSERT INTO patients (f_name, l_name, phone_num) VALUES (‘$f_name’, ‘$l_name’, ‘$phone_num’); $res_1 = mysql_query($sql, $conn) or die(mysql_error()); #get the patient id based on the last insert $id = mysql_insert_id($conn); #enter the data in the appointment table $sql_3 = INSERT INTO appointment (appt_date, appt_time, id) VALUES (‘$appt_date’, ‘$appt_time’, ‘$id’)
  9. // grab players id $sql_id = "SELECT `id` FROM `cf_users` WHERE username = $username;"; $username is not quoted so the query would turn out to be: SELECT `id` FROM `cf_users` WHERE username = test;
×
×
  • 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.