By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

hyperlink in PHP

P: 2
Hi,

I saw that there was already an article about this, but if I'm implementing this, I do not get any further.

I'm stil getting an error when using the link. Can somebody tell my what the issue is? (hyperlink is at line 31)

Thank you!

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html> 
  3.  
  4. <head> 
  5.  
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  7.  
  8. <title>Getting things done</title> 
  9.  
  10. </head> 
  11.  
  12. <body>
  13.  
  14.     <?php 
  15.  
  16.         ## Make the connection with the database
  17.  
  18.             require_once 'db_access.php'; 
  19.  
  20.         ## Get the POST parameters
  21.  
  22.             $username = mysql_real_escape_string($_POST[username]);
  23.  
  24.             $password = mysql_real_escape_string($_POST[password]);
  25.  
  26.       ## Check if username exists
  27.  
  28.             if ($username=="")
  29.  
  30.               echo 'Gelieve uw gebruikersnaam in te vullen!';
  31.               echo '<a href="http://www.jdrconsultancy.be/indextest.html">Klik hier om terug te keren</a>';
  32.  
  33.             elseif ($password=="")
  34.  
  35.               echo 'Gelieve uw wachtwoord in te vullen!';
  36.  
  37.             else
  38.  
  39.               echo 'Have a nice day!';    
  40.  
  41.     ?>
  42.  
  43.  
  44. </body>
  45.  
  46. </html>
  47.  
  48.  
Oct 25 '11 #1

✓ answered by zorgi

1) What is the error?
2) Use braces for your if else block (http://php.net/manual/en/control-structures.if.php)

Share this Question
Share on Google+
2 Replies


zorgi
Expert 100+
P: 431
1) What is the error?
2) Use braces for your if else block (http://php.net/manual/en/control-structures.if.php)
Oct 25 '11 #2

P: 2
Thank you,

this helps a lot and now it works!

kind regards,

Joachim

www.jdrconsultancy.be
Nov 2 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.