Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
In the future, please place OR tags around your code.
-
This topic has been moved to PHP Math Help. http://www.phpfreaks.com/forums/index.php?topic=337285.0
-
Most likely a path issue. Post the image path dir, where the php file resides, and your include code.
-
It would mean if the user hits submit without filling in any input fields, the query will still execute and a blank entry will appear in your database, that's up to you. And again, you should be preventing SQL injections with at least the mysql_real_escape_string method. i.e. $firstname = mysql_real_escape_string($_POST['FirstName']); $lastname = mysql_real_escape_string($_POST['LastName']); $boolean = mysql_real_escape_string($_POST['boolean']); $datetime = mysql_real_escape_string($_POST['datetime']); $dropdown = mysql_real_escape_string($_POST['dropdown']);
-
This is a lot to ask of. You should Google some login tutorials to help you get started. If you get stuck at a particular point then come back and we will help you.
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=337245.0
-
Yes. This IF block will only execute if all of these conditions are true (all input fields are NOT blank and are set): if(isset($_POST['FirstName']) && $_POST['FirstName']!="" && isset($_POST['LastName']) && $_POST['LastName']!="" && isset($_POST['boolean']) && $_POST['boolean']!="" && isset($_POST['datetime']) && $_POST['datetime']!="" && isset($_POST['dropdown']) && $_POST['dropdown']!="") If you don't care that they are blank then you can take out the !="" conditions for the desired fields. You can also implement a more user friendly error checking to tell the user which fields they left blank. The if(isset($_POST['submit'])) should prevent that from happening, as in, the SQL related code should only execute when the 'Save' button is hit. Make sure you clear your database from the blank entries to ensure you're not seeing previous entries.
-
I meant something like this: //When the user hits the "save" button if(isset($_POST['submit'])) { //Checks to see if any values aren't set or are blank if(isset($_POST['FirstName']) && $_POST['FirstName']!="" && isset($_POST['LastName']) && $_POST['LastName']!="" && isset($_POST['boolean']) && $_POST['boolean']!="" && isset($_POST['datetime']) && $_POST['datetime']!="" && isset($_POST['dropdown']) && $_POST['dropdown']!="") { $firstname = $_POST['FirstName']; $lastname = $_POST['LastName']; $boolean = $_POST['boolean']; $datetime = $_POST['datetime']; $dropdown = $_POST['dropdown']; $db_table = "test"; $sql = "INSERT INTO $db_table (FirstName,LastName,boolean,datetime,dropdown) VALUES ('$firstname','$lastname','$boolean','$datetime','$dropdown')"; if($result = mysql_query($sql, $connection)) { echo 'Saved '; } else { echo "Error".mysql_error(); } } } ?> test </pre> <form action="<?php%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="'post'"> test First Name: Last Name: ID: Boolean: Date-Time: Drop-Down: One Two Three </form> <b NOTE: You need to escape your POST variables with - mysql_real_escape_string.
-
Post the current code.
-
This is b/c your first block of code will always be executed. You need to move the if(isset($_POST['submit'])){ to the top. It doesn't do anything where you have it now.
-
The www shows up for me. What's your question? This doesn't really have anything to do with PHP...
-
Website for Broadcasting Equipment Rental service
Maq replied to klimito's topic in Website Critique
You can install a plug-in YSlow, I know it's for FF, not sure what other browsers. It will analyze & optimize your images for you. https://addons.mozilla.org/en-US/firefox/addon/yslow/ -
You need parentheses: WHERE email= "mail@gmail.com" AND (activation=1 OR activation=2)
-
Can php code be used to hide the url in the web browser?
Maq replied to jej1216's topic in PHP Coding Help
AFAIK, this can't be done. Why do you need to do this anyway? -
If you did it right, it would work... What about it doesn't work?
-
Only if they can dance. Did you get an answer yet?
-
Read this tutorial: http://www.phpfreaks.com/tutorial/basic-pagination
-
In the future, please place OR tags around your code.
-
Post the actual query. Are you sure you're including 'id'?
-
What happens? Are you getting errors? One thing I noticed right away is that you're missing terminating single quotes around your SQL values.
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=336927.0
-
katsching, please start a fresh thread. This one is nearly 2 years old.
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=336918.0