Everybody uses double quotes, from the people at PHP.net to some people who make big open-source projects. But why? Its MUCH slower, and using single quotes in more professional. Why doesn't everybody use single quotes?
Just wondering. Sorry if this is off-topic.
Since PHP can't compute anything with large numbers, and my server doesn't have GMP installed, I made a few quick functions that can add, multiply, and find the factorials of large numbers.
With my function, the exact value of 51! can be evaluated in 3 seconds.
Of course, since I rushed...
You really have a few choices.
1. Write a secure code that runs sessions. Sessions cannot be edited by the user (Unless you leave a security whole in your script), so they're very safe, and very easy to work with. Problem, you have to login every time.
2. A cookie that will directly contain...
You can send MySQL queries without being logged in.
To add a row to a MySQL table, you need to use something like this:
$q = "INSERT INTO `table` (`$_name`, `$_email`) VALUES ('$name', '$email')";
mysql_query($q);
I'm not sure if your columns are actually named $_name, or _name. Only PHP...
You have both PHP and HTML errors. The action is going to send.php, so the PHP code must be on send.php.
As for the PHP part:
Never use request. Its unsafe. You correctly set $email, but $message is still unset if you have register globals off. Also, you shouldn't use double quotes. It slower...
I recently made a site in PHP and MySQL where you can, with a valid code, add a poll with 2-5 choices. Your poll is added automatically, and everybody can vote on it.
I have three tables:
-Codes (Stores valid codes)
-Polls (Stores the questions, information about who added the poll, and the...
$$name[1] = 2;
// This will set a variable with a name of $name[1] to 2. But, I want to do this:
$($name)[1] = 2;
// I want it to make the variable to be an array. I know I can use $$name = array(), but that's not very dynamic.
Thanks!
Use single quotes when you can.
$headers = 'Webmaster <cada@dd.com>';
mail('email', 'subject', 'contents', 'From: ' . $headers);
Try to avoid things like:
$x = 'f';
$x .= 's';
$x .= 'y';
Its better just to use one line of statement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.