Jump to content

cluce

Members
  • Posts

    354
  • Joined

  • Last visited

    Never

Posts posted by cluce

  1. 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{

  2. 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>
    

  3. 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]...

  4. 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.

  5. 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);

  6. 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/>";
    }
    ?>
    

  7. 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?

×
×
  • 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.