mrdamien
-
Posts
186 -
Joined
-
Last visited
Posts posted by mrdamien
-
-
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."; ?>
-
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...
-
In order to kill the session altogether' date=' like to log the user out, the session id must also be unset. If a cookie is used to propagate the session id (default behavior), then the session cookie must be deleted. setcookie() may be used for that.[/quote']
<?php // Initialize the session. // If you are using session_name("something"), don't forget it now! session_start(); // Unset all of the session variables. $_SESSION = array(); // If it's desired to kill the session, also delete the session cookie. // Note: This will destroy the session, and not just the session data! if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } // Finally, destroy the session. session_destroy(); ?>
-
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
-
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']; ?>
data 11111 blue streetCheck the php website for more info
-
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?
-
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).
-
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’)
-
// 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;
[SOLVED] Problem with web form
in PHP Coding Help
Posted
Headers are optional