Jump to content

poqoz-87

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

poqoz-87's Achievements

Member

Member (2/5)

0

Reputation

  1. i m learning how to have session in my form. like for example, after the user insert their information in the application form, they will then be redirected to another page. the another page is where they will have to print out their form - with their info added in. but i m unsure how to go about doing it. can someone show me?
  2. should the session.save_path has the same directory path as the extension_dir?
  3. i have tried using this php code example for session. the php code that i am using is this: i get this code at this website: http://www.tizag.com/phpT/phpsessions.php <?php session_start(); $_SESSION['views'] = 1; // store session data echo "Pageviews = ". $_SESSION['views']; //retrieve data ?> the output supposedly should just has Pageviews = 1. but i receive this error. the error that i get is this: PHP Warning: session_start() [function.session-start]: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:/ <the path name of the folder>) in Unknown on line 0. what does this error means n how can i solve this error?
  4. i has already solve the problem it lies in the javascript validation code
  5. its looks very weird. i can insert the user information into the database, but when i add in some javascript code to validate (for example, if the user forgot to enter their first name, there will be a pop-up error message), i cannot insert the user information into the database. and vice-versa. if i can validate, i cannot insert the information into the ms sql database. i dunno what went wrong. can someone shine the light here?
  6. i m trying to validate radiobutton n checkbox but to no avail. this is the code that i m currently using in validating the radiobutton <script language="JavaScript"> function checkForm() { var cgender with(window.document.msg) { cgender = gender; } if(trim(cgender.value) == '') { alert('Please select ur gender); cgender.focus(); return false; } else { cgender.value = trim(cgender.value); </script> <form name="msg" id="msg"> Gender: <input name="gender" type="radio" value="male" /> Male <input name="gender" type="radio" value="female" /> Female <input type="submit" name="submit" value="Submit"onClick="return checkForm();"> i have try using the above code to validate my radiobutton but it does not work at all. can someone tell me what went wrong in my code n also, how to validate check box n dropdown list?
  7. i has this idea in mind but it cant seem to work. i m using ms sql database, by the way:) this is the scenario: the user will have to fill in the membership form. when they click onto the submit button in the membership form, the information-that the user key in, will be displayed in the next page. this is the code that i am using to display the info-that the user key in to be display onto the next page <form action="action.php" method="get"> <p>Your name: <input type="text" name="name" /></p> <p>your age: <input type="text" name="age" /></p> <p><input type="submit" /></p> Hi <?php echo htmlspecialchars($_GET['name']); ?>. You are <?php echo (int)$_GET['age']; ?> years old and this is the thing that until now, i finding difficulty with. in the action.php page, the user will then have to click onto the submit button in order for their information to be inserted in the ms sql database. can someone help me as in, how am i suppposed to get the info-that the user key in from the action.php page,to be inserted in the ms sql database?
  8. is it possible to have an image in an echo statement? this is my echo statement >> echo("<br/><br/><br/><fieldset><legend>Success!</legend><br/>Your application form has been successfully stored in our database.</fieldset>"); i want to put an image in the echo statement. i have tried using <img src="Desktop/pictures.is.best/scs.jpg" width="176" height="83" /> in the echo statement, but still, there are no image in the browser. can someone tell me how can i insert an image in the echo statement?
  9. thank you. it work now-after i change E-ALL to E-WARNING in the php.ini.
  10. can someone tell me what does this error means? n how can i solve it? this the error that i m referring to: PHP Notice: Undefined index: gender in C:\Inetpub\wwwroot\done-all-de-steps\Untitled-6-1n2n3n4nbannern7err.php on line 112
  11. oopss. sorry. i m using php document and the database that i am using is ms sql database. i can connect the php document to the ms sql database. the codes that i am using to connect the php doc to the database is this: <?php if (!empty($_POST["submit"])) { $conn = mssql_connect("<my ip address>", "<my user name>", "<my pwd>"); mssql_select_db("lalalalalala", $conn); $sql = "INSERT INTO Hello (fname,lname)VALUES ("; $sql .= "'" . $_POST["fname"] . "', "; $sql .= "'" . $_POST["lname"] . "')"; mssql_query($sql, $conn); mssql_close($conn); echo("<p>Entry added to database!</p>"); } ?> what i am now trying to do is to validate both of these two fields(fname & lname), when the user clicks onto the submit button. can someone give me an example of code on how to validate both of these two fields?
  12. i can insert the fields into the ms sql database. what i am now trying to do is to validate the fields in the document. i have tried validating the fields, but then later, i cannot insert the data into the database. can someone show me an example of how to validate fields in a document?
  13. haven yet finish. why issit when i want to add label called "gender", the data is not being inserted to the ms sql database? there is no error. its just that the data is not being inserted into the ms sql database. this is the codes that i m using now: <?php if (!empty($_POST["submit"])) { $conn = mssql_connect("<my ip address>", "mei", "mei"); mssql_select_db("lalalala", $conn); $sql = "INSERT INTO users (name, email,residence,Gender) VALUES ("; $sql .= "'" . $_POST["name"] . "', "; $sql .= "'" . $_POST["email"] . "', "; $sql .= "'" . $_POST["residence"] . "', "; $sql .= "'" . $_POST["Gender"] . "')"; mssql_query($sql, $conn); mssql_close($conn); echo("<p>Entry added to database!</p>"); } ?> <form method="post"> Name: <input type="text" name="name" /><br /> Email: <input type="text" name="email" /><br /> Residence: <input type="text" name="residence" /><br /> Gender: <input name="Gender" type="radio" value="" /><label>Male</label> <input name="Gender" type="radio" value="" /><label>FeMale</label><br /> <input type="submit" name="submit" value="Add to database" /> </form> i have tried using the codes, that u-mmarif4u send it to me, but to no avail. can someone help out?
×
×
  • 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.