rofl90 Posted January 26, 2008 Share Posted January 26, 2008 <?php $ipa = getenv("REMOTE_ADDR") echo "$ipa"; ?> hmm i dont understand :S im new to php mostly so ah well. Quote Link to comment https://forums.phpfreaks.com/topic/87876-parse-error-parse-error-unexpected-t_echo-in-edomainsmmyhabscoukuserht/ Share on other sites More sharing options...
rofl90 Posted January 26, 2008 Author Share Posted January 26, 2008 heres whole code ftr <?php session_start(); $host = "mysql10.streamline.net"; $user = "x"; $pass = "x"; $db = "prowebdes1"; $ms = mysql_connect($host, $user, $pass); if(!$ms) { echo "Error connecting to database.\n"; } mysql_select_db($db); if($_GET['login'] == "login") { $user1_post = addslashes($_POST["username_post"]); $pass1_post = addslashes($_POST["password_post"]); $pass1_post = md5($pass1_post); if($user1_post == "" or $pass1_post == "") { echo "<b>You Did Not Enter A Password</b>"; exit; } list($user) = mysql_fetch_array(mysql_query("SELECT `username` FROM `staff` WHERE username='$user1_post'")); list($pass) = mysql_fetch_array(mysql_query("SELECT `password` FROM `staff` WHERE password='$pass1_post'")); if($user1_post == "$user" and $pass1_post == "$pass") { $sql = mysql_query("SELECT * FROM `staff` WHERE username='$user' AND password='$pass'"); if(mysql_num_rows($sql)!= 1) { exit; } $result = mysql_fetch_array($sql); $_SESSION['session_username'] = $result['username']; $_SESSION['session_level'] = $result['level']; $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR']; echo "<meta http-equiv=\"refresh\" content=\"0;url=main.php\">"; exit; } else { echo "<b>Your Username And Password Did Not Match</b>"; } } else { ?> <body bgcolor="#F45000" bgproperties="fixed" style="background-image: url('habboback.gif')"> <p align="center"> </p> <center> <div align="center"> <table width="329" height="3" style="border-collapse: collapse" cellpadding="0" cellspacing="0" id="table2"> <tr> <td width="330" height="11" align="center"> </td> </tr> <tr> <td align="center" width="400" background="hk_middle.gif" height="342"> <form action="<?php echo "$PHP_SELF"; ?>?login=login" method="POST"> <font size="1"><br> <img border="0" src="enterHH%20copy.gif" width="105" height="106"><br> </font><table border="0" id="table3" width="252" height="87"> <tr> <td> <p align="center"><b><font size="1" face="Verdana">Username:</font></b></td> <td><? echo "<select size='1' name='username_post'> <option selected>Choose Your Name</option>"; include('dbConfig.php'); $result = mysql_query("SELECT * FROM `staff`"); while($worked = mysql_fetch_array($result)) { $username = $worked["username"]; echo "<option value=$username>$username</option>"; } mysql_close(); ?> </select></td> <td height="77" rowspan="4"> </td> </tr> <tr> <td> <p align="center"><font size="1" face="Verdana"><b>Password:</b></font></td> <td> <p align="center"><font color="#FFFFFF" size="1" face="Verdana"> <input type="password" name="password_post" size="26"></font></td> </tr> <tr> <td width="62"></td> <td width="172"> <input type='image' name='myclicker' src='hk_button.gif'></td> </tr> <tr> <td valign="top" colspan="2"> <p align="center"></td> </tr> </table> <p align="center"><font face="Verdana" size="1" color="#FFFFFF">Warning Your IP Address is <?php $ipa = getenv("REMOTE_ADDR") echo "$ipa"; ?> Authorised FlyTropica staff only, we will do everything in our power to track down any unauthorised people. Abuse of this tool is strictly against the terms and conditions of service.</font></p> </form></td> </tr> </table> </div> <p align="center"> </p> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87876-parse-error-parse-error-unexpected-t_echo-in-edomainsmmyhabscoukuserht/#findComment-449597 Share on other sites More sharing options...
revraz Posted January 26, 2008 Share Posted January 26, 2008 Missing semi colon $ipa = getenv("REMOTE_ADDR"); <-- Quote Link to comment https://forums.phpfreaks.com/topic/87876-parse-error-parse-error-unexpected-t_echo-in-edomainsmmyhabscoukuserht/#findComment-449603 Share on other sites More sharing options...
rofl90 Posted January 26, 2008 Author Share Posted January 26, 2008 Thanks but now it won't show - But it doesn't give errors! But it won't show for some reason it displays like this Warning Your IP Address is Authorised lol Also how would I log the ip address in a file/table(mysql) of which I can check for unauthorised attempts? Quote Link to comment https://forums.phpfreaks.com/topic/87876-parse-error-parse-error-unexpected-t_echo-in-edomainsmmyhabscoukuserht/#findComment-449608 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.