Jump to content

nadeem14375

New Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

nadeem14375's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks Guru, you are right, but at this time, I need to correct this error. can you help me? here is the php code: <a href="contents/details.html?b_id=<?php echo $business["name"]; ?>-<?php echo $business["id"]; ?>.html" style="text-decoration:none; color:#000;"><h1 style="text-transform:capitalize; margin-bottom:5px;"><?php echo $business["name"]; ?></h1></a>
  2. Dear all, I have the following php it works fine, and open the detail.php page with correct id. <a href="contents/details.php?b_id=<?php echo $business["id"]; ?>" style="text-decoration:none; color:#000;"><h1 style="text-transform:capitalize; margin-bottom:5px;"><?php echo $business["name"]; ?></h1></a> here is the url re-writing rule in .htaccess: RewriteRule ^b_id-([a-zA-Z0-9_-]+)-([0-9]+).html$ contents/details.php?b_id=$2 now trying to change the above php to work with the rewriterule, here is the updated php: <a href="contents/details.html?b_id=<?php echo $business["name"]; ?>-<?php echo $business["id"]; ?>.html" style="text-decoration:none; color:#000;"><h1 style="text-transform:capitalize; margin-bottom:5px;"><?php echo $business["name"]; ?></h1></a> this produce the following RUL and ERROR: http://localhost/sbd/contents/details.html?b_id=12-Testing%20my%20own%20business.html You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'my own business.html' at line 1 can anyone guide me, where I am wrong? Regards:
  3. Dear I want to check the condition on the same page "signup" not to go to the process page. At this time I do this as: 1. on signup page click on submit button. 2. the control goes to process_signup.php there a condition which check if the form is not filled, the control goes back to signup.php and show a message. "Please fill all the required fields". I am new to web development / php, so is this is right way to do check the form is filled or not? Regards:
  4. Dear all, I have signup form, on clicking the submit button, the control goes to "process.php". where i check the form's required fields are filled or not, if not filled it come back to signup.php and show the message. "Please fill all the required fields". 1. Is this right way to do it? 2. I want to show the message bellow the submit button, but couldn't succeed. Regards:
  5. the following example solved the problem. thanks for you response. Example #1 mysql_result() example http://php.net/manual/en/function.mysql-result.php <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (!mysql_select_db('database_name')) { die('Could not select database: ' . mysql_error()); } $result = mysql_query('SELECT name FROM work.employee'); if (!$result) { die('Could not query:' . mysql_error()); } echo mysql_result($result, 2); // outputs third employee's name mysql_close($link); ?>
  6. Dear all, new to php, so here a very easy thing which, I couldn't do. i want to select a column value from a table. for example: select name from members where member_id = 1; for this in pl/sql the code is look like: select name into v_name from members where member_id =1; the column value will be stored in v_name variable, now please guide me how it can be done in php. I want to display user name on page. Regards:
  7. dear, without md5, its ok. but when i store in database with md5, the i couldn't be able to login, as i mentioned. 1. before insertion convert to md5(). the password is now encrypted. 2. login time , before selecting from database, md5(). or only select from database. both don't let me to login. What's the problem?
  8. Thanks dear, it gives error and don't let me to login, now i remove the md5() and try to insert a row, in database. but it don't insert the password. the column name is password. the other columns are successfully inserted in table.
  9. Dear all, I am new to PHP. here I want to develop a login page. what's wrong in the following page? <?php include ('/includes/dbConfig.php'); session_start(); // username and password sent from form $email=$_POST['email']; $password=md5($_POST['password']); // To protect MySQL injection (more detail about MySQL injection) $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); $query="SELECT * FROM member_info WHERE email='$email' and password='$password'"; $result=mysql_query($query); if (mysql_num_rows($result) != 1) { //$error = "Bad Login"; echo "Bad Login"; } else { header("location:index.php"); } ?> Regards: Muhammad Nadeem
×
×
  • 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.