Jump to content

EmperorJazzy

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Everything posted by EmperorJazzy

  1. Was getting to it! Oh so impatient. Thnx Dark/Ace and others... P.S jeremyp77@hotmail.com
  2. Have reverted to the following and it works. Thanks All..... (else if else if else if) $direct_site = "http://www.internetfella.com.au"; ?> <script> document.location = '<? echo $direct_site; ?>'; </script> <?
  3. Nope... I tried that initially. Sorry. But I'd like it to be dynamic so I can choose where to send the user. Thus the type of code.
  4. Ok, past that issue because of a silly $_POST being left out. Little things. :S Now... the next part was to redirect the user. The below is the code I'm using, however, is not redirecting the page. Ideas? $direct_site = "http://www.internetfella.com.au"; header("Location: " . $direct_site . "");
  5. Yupe... that makes sure there is data for the username. Username checks are working already. Anything on the password comparison end?
  6. Full code... Sorry for delay in posting. <html> <head> <title>Website Title</title> <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { mysql_connect("localhost","username","password") or die("Unable to connect to SQL server"); mysql_select_db("database") or die("Unable to select database"); $query = "SELECT * FROM tblUsers WHERE usrnme='" . $_POST['usrnme'] ."'"; $fldchk = mysql_query($query) or die('mysql_error with query - '.$query); if (mysql_num_rows($fldchk) > 0) { $pwchk = mysql_result($fldchk,0,"PWord"); if ($pssword == $pwchk) { $_SESSION["usrnme"] = $_POST["usrnme"]; $log_user = $usrnme; // Use the session variable utype to show or hide the Admin links $ordersite = "index1.php"; $direct_site = "http://www.internetfella.com.au"; header("Location: " . $direct_site . ""); } else { $wrongpw = 1; } } else { $usrex = 1; } } ?> </head> <body> <form method="post" action="index.php"> Username <input type="text" name="usrnme" size="10" maxlength="10"> <br> <br> Password <input type="password" name="pssword" size="10" maxlength="10"> <br> <a href="mailto:user@home.com.au"><small>Forgotten your password?</small></a> <input type="image" src="images/rings.jpg" name=login alt="Login"> </form> <p> <?php if ($usrex == 1) { ?> This user is not in the system. <br> Please <a href="mailto:user@home.com.au">email us</a> for account enquiries. <?php } elseif ($wrongpw == 1) { ?> Incorrect password for <strong><? echo $_POST["usrnme"]; ?></strong>. <br> Please <a href="mailto:user@home.com.au">email us</a> if you have forgotten your password. <?php } ?> </body> </html>
  7. Thanks Master The unfortunate thing is, it's continues to say incorrect password for user. Username test2 Password openup http://www.internetfella.com.au/gift_registry/index.php P.S thanks, we should get in touch.
  8. OK can I unsolve?! Haha... Unfortunately, the error checking works, but the correct comparison doesn't. EG> Password matches that entered by the user. Basically, I want the page to be redirected if it's the correct password for the user. Simple (so I thought). Ideas? $pwchk = mysql_result($fldchk,0,"PWord"); if ($pssword == $pwchk) { $_SESSION["usrnme"] = $_POST["usrnme"]; $log_user = $usrnme; // Use the session variable utype to show or hide the Admin links $ordersite = "index1.php"; $direct_site = "http://www.internetfella.com.au"; ?> <script> document.location = '<?php echo $direct_site; ?>'; </script>
  9. Ok gents... thanks for your help again. I changed a few things; if($_SERVER['REQUEST_METHOD'] == 'POST') and $query = "SELECT * FROM tblUsers WHERE usrnme='" . $_POST['usrnme'] ."'"; Essentially, the $_SERVER request started to pass through the code. Came up with Query error. Checked the syntax of the query, and altered as above. Now it's returning goodness. All - Thanks very much. You know this means there could be more queries coming from me?!
  10. Thanks all, appreciate your time. I've managed to now have the form 'work' however, if the incorrect information is entered, the errors are not showing. <?php if ($usrex == 1) { ?> This user is not in the system. <br> Please <a href="mailto:user@home.com">email us</a> for account enquiries. <?php } ?> Any ideas? If you require further information, I can provide Try this web address to see output; http://www.internetfella.com.au/gift_registry/index.php
  11. Hi All, Your assistance would be apprciated. I'm attempting to convert old PHP syntax to the new PHP syntax. Previously this form worked like a charm, though now, it does nothing exciting at all. Could you give me guidance as to how I might address some issues; 1 - I understand that variables from a POST method are now prefixed with $_POST (I've attempted to use this below). Is this usage correct? 2 - I'm not sure how to call/reference the variables created from the mySQL query - Is it $_SERVER? 3 - And now I've created new variables to check password, and user existance, should these be prefixed $_POST also? Thank you in advance for your assistance! ** WHOLE CODE DUMP ** <html> <head> <title>Website Title</title> <? if (($REQUEST_METHOD=='POST')) { mysql_pconnect("localhost","username","password") or die("Unable to connect to SQL server"); mysql_select_db("DBName") or die("Unable to select database"); $query = "SELECT * FROM tblUsers WHERE usrnme = $_POST['$usrnme']"; $fldchk = mysql_query($query) or die('mysql_error'); ?> Past Connection<? if (mysql_num_rows($fldchk) > 0) { $pwchk = mysql_result($fldchk,0,"PWord"); if ($pssword == $pwchk) { session_register($_POST["$usrnme"]); $log_user = $_POST["$usrnme"]; // Use the session variable utype to show or hide the Admin links $ordersite = "index1.php"; } else { $wrongpw = 1; } } else { $usrex = 1; } } ?> </head> <body> <form method="post" action="index.php"> Username <input type="text" name="usrnme" size="10" maxlength="10"> <br> <br> Password <input type="password" name="pssword" size="10" maxlength="10"> <br> <a href="mailto:email@home.com"><small>Forgotten your password?</small></a> <input type="image" src="images/rings.jpg" name=login alt="Login"> </form> <p> <? if ($usrex == 1) { ?> This user is not in the system. <br> Please <a href="mailto:user@home.com">email us</a> for account enquiries. <? } if ($wrongpw == 1) { ?> Incorrect password for <strong><? echo $usrnme; ?></strong>. <br> Please <a href="mailto:user@home.com">email us</a> if you have forgotten your password. <? } ?> </body> </html>
  12. Hey DreamGirl, Not sure if you've managed to solve your problem, so I'll attempt to contribute below. I'm also getting back into PHP after a few years of leave. You'll probably need to amend slightly when implementing. However; <table> <tr> <?php $col=0; while ( $row=mysql_fetch_assoc ($recordset) ) { $image = pic_for_models( $row["id"]); print '<td><a href="model_detail.php?id='. $row['id'].'"> <img src="'.$image.'" width="150" border="0"> <br>'; print '<strong><a href="model_detail.php?id='.$row["id"].'">'.$row ["name"].'[/url] </strong>'.$row ["phone"] ." <br><a href=\"mailto:\"". $row["email"] ."\" >". $row["email"]."[/url]\n"; print "</td>\n"; if ($col=4) then { $col=0 ?> </tr> <tr> <? } } ?> </tr> </table> Have a go at that..... It's rough, and untested.
  13. Firstly, have a counter to count the numebr of columns you're displaying. I'd suggested setting the max at 3 columsn, but it's up to you and the screen resolution you're aiming for. Psuedo; Start New Table While Not (End of Models Returned in SQL) - Add 1 to Column Counter - Add New Row - Add New Cell - Display Photo - Display States - Close Cell - If Column Counter = 3 Then - Add Close Row Return To While Loop Essentially, writing code to this will ensure all stats are displayed across and down. If that's the desired result you're after. Hope this helps...
  14. Quick way to solve case issues is simply compare variables utilising a command to $upper[id].... Or, change the upload script to upper case or lower case the filenames. You'll not have to worry about it in the future with any code. Saves you a few lines here and there.
  15. Thanks Barand.. is there any reference material you could guide me to to understand the security issues, and thus if it's worth requesting the ISP switch Register_Globals back on? Or of course, you opinion on switching Register_Globals back on?
  16. Hi All, I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following; I used to use a function as such; if ($REQUEST_METHOD=="POST") { Now I've seen alot of the syntax is if ($_SERVER($REQUEST_METHOD=="POST")) { And referencing variables from the form is as such; $_POST['variable'] Where previously I could reference them in the simple form; $variable Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work? Your assistance would be greatly appreciated! I'm going mad I tell you! Regards, Jazzy P.S Same ISP, Different Version of PHP
  17. I put something together overnight if you are still requiring a script.
  18. I'd thought along the lines of actually utilising your variable values KeyOne and KeyTwo. It's basic, but may get your thought process going. Strip the left of the values until you reach the "." Convert the word to the numeric value. Combine to re-create the math problem Workout and validate EmperorJazzy
  19. Fantastic information as Wiki always is. But surely we have some kind of code that someone has used to played with to achieve this? Hopefully someone has had a tinker out there in php world.. Cheers, EmperorJazzy
  20. Hi All, I'm working on a site where I'd like to utilise the function of pulling visitors contact emails from their MSN Messenger/ICQ/AOL/Yahoo if they enter their username and password. I've seen it work on a couple of websites and works quite well. Can anyone guide me in the right direction for existing scripting or even their own code that could assist. Thanks in advance, EmperorJazzy
×
×
  • 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.