cluce
-
Posts
354 -
Joined
-
Last visited
Never
Posts posted by cluce
-
-
you should have session_start() on the top of every page where you are passing session variables.
-
thats right my mistake. I tested this code on my computer and it works
<?php $connection=mysql_connect("localhost","root","")or die("Could not connect to MySQL"); if (!isset($connection)){ echo ("not connected"); }else{ echo "Successfully connected to MySQL"; } ?>
-
you need to specify #database#
and try this using mysqli_connect();
//connects to database
$mysqli = mysqli_connect("localhost", "root", "#password#", "#database#");
-
I agree with the otehr guy. All I would do is encrpyt passwords and have a logon page to validate user . depending on the level of security you want, you could use md5() or sha1()
more info on encryption found here
http://us2.php.net/manual/en/function.sha1.php
-
I use this code for my online application to check for blank fields. you can change it to work with your page ..
if (empty($lastname) or empty($middle) or empty($firstname) or empty($address) or empty($address_continue) or empty($city) or empty($state) or empty($zip) or empty($phone) or empty($email) or empty($position)) { $_SESSION['validate'] = "<font color = red>Please fill in all the required fields</font>"; header ("Location: o_application.php"); }else{
-
I would do two pages one registration.html and submit.php. and when they hit submit on the registration it executes the php code.
here is the registration page code I modified
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action="submit.php"> <p>User Name: <input name="username" type="text" /> <br /> <br /> Passowrd:<input name="password" type="password" /> <br /> <br /> E-mail Id:<input name="e-mail" type="text" /> <br /> <br /> Gender:<input name="gender" type="text" /> <br /> <br /> <br /> Country:<input name="country" type="text" /> <br/> <br /> Pincode:<input name="pincode" type="text" maxlength="8" /> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> </body> </html>
-
thanks for clearing that for me ..
-
I am trimming the data which didnt work but I never tried the empty function.
-
does anybody know how to check for blank spaces? I dont just mean blank, blank but actual spacebar spaces. ive tried is_null and !isset and neither one works??
-
yes, thanks I figured it out.
-
I have the foolowing error.....
Parse error: parse error, unexpected T_LOGICAL_OR in /home/content/L/a/n/LangleyLee/html/application.php on line 20
I am trying to check for empty text fields with an if condition but I dont see whats wrong. here is my code
if (is_null($lastname)) or (is_null($middle)) or (is_null($firstname)) or (is_null($address)) or (is_null($address_continue)) or (is_null($city)) or (is_null($state)) or(is_null($zip)) or (is_null($phone)) or (is_null($email)) or (is_null($position)){ $_SESSION['validate'] = "Some required fields are missing"; header ("Location: application.html"); }else{code]...
-
yeah I guess I am being lazy i didnt want to do that but I think I will. thanks for your input........
-
well I am not sure if I need to strip the tags but I am suspicious of someone messing with the form because I am getting blank emails sent to the assigned account. soI thought I would try something differeent. I know the form works because information is being sent but so is blank forms too. You have any ideas why I migth be getting these blank forms? I am using javascript to check for required fields.
-
can someone show me the correct syntax on how to fix my code to do this? I know what i have is not right.
$date = trim(strip_tags($_POST['date'])); $lastname = trim(strip_tags($_POST['lastname'])); $middle = trim(strip_tags($_POST['middle'])); $firstname = trim(strip_tags($_POST['firstname'])); $address = trim(strip_tags($_POST['date'])); $address_continue = trim(strip_tags($_POST['address'])); $city = trim(strip_tags($_POST['address_continue'])); $state = trim(strip_tags($_POST['state'])); $zip = trim(strip_tags($_POST['zip'])); $phone = trim(strip_tags($_POST['phone'])); $alternate = trim(strip_tags($_POST['alternate'])); $email = trim(strip_tags($_POST['email'])); $position = trim(strip_tags($_POST['position'])); $referred = trim(strip_tags($_POST['referred'])); $coverletter = trim(strip_tags($_POST['coverletter'])); $resume = trim(strip_tags($_POST['resume'])); $body = " \n\n Date: "$date" \n\n Last Name: "$lastname" \n\n Middle: "$middle" \n\n First Name: "$firstname" \n\n Address: "$address" \n\n "$address_continue" \n\n City: "$city" \n\n State: "$state" \n\n Zip: "$zip" \n\n Phone Number: "$phone"' \n\n Alternate Number: "$alternate" \n\n E-Mail Address: "$email" \n\n Position: "$position" \n\n Referred by: "$referred" \n\n Cover Letter or Addtional Information: "$coverletter" \n\n Resume: "$resume""; mail ($to, $subject, $body);
-
I got it but how do I read parts of the file at a time such as how do I get the usernames under one column and the passwords under the other so I can store them in two strings for looping. this is what I have .........
<?php $filename = "ad.csv"; $fp = fopen($filename, "r") or die("Couldn't open $filename"); while (!feof($fp)) { $line = fgets($fp, 1024);////I know I need to modify this into something??? echo $line."<br/>"; } ?>
-
OH. there is code to open and read the file??? IF so, I never did that before with php.
-
thats what I am thinking but I do not know to get the values from the csv file to do that
-
can someone give me some advice on how to import a csv file and make the passwords store in a hash form such as md5 or sha-1. It would be to much to code the INSERT VALUES....way. I am trying to find an easier way. Is there a feature in one of these free gui versions of mySQL that will do this????
-
thats good to know. thanks
-
I have a login page where a user logs in but I will not have a registration page. I know all about salt, md5, sha-1 and password function by mysql. I am trying to think of the best secure method in storing all the users passwords. I will not have a registration page so I dont know how I can add salt to it without that. Maybe md5 or sha-1 will be secure enought I am not sure yet. *I already have a list of the usernames and passwords that I plan on imporintg into the table .Any ideas is greatly appreciated?
-
thats right thanx
-
can someone tell me the correct way to code this statement. I am rusty with HTML and php together ...
<?php if ($priv === true) { <a href="post_topic.php">update_banner</a> };?>
-
-
I am trying to add a link on a web page that says print and when the user clicks on it the print window comes up. Does anybody have any ideas on how to do that?
[SOLVED] function help
in PHP Coding Help
Posted
I am not sure but here is link for info about it .
http://us2.php.net/manual/en/function.parse-str.php