Jump to content

PoH

Members
  • Posts

    18
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

PoH's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just finished my last big projects. I am once again open for new offers. I am available through Skype at - beachedonduty
  2. Hey guys. I'm still available for hire and have some time just opened up for the weekend and next week if you require any work done!
  3. If you insist on checking the IP here's the general outline of what to do (not the code! that's not what this section is for). Use the mysqli extension for this. You can learn about it here. Connect to database Check if IP is existing in database. Get clients IP from using $_SERVER['REMOTE_ADDR'] If it doesn't exist, insert ip into database and download. else do whatever.
  4. So it works when you directly put the integer in but not when you're using the variable? Try: sql="SELECT * FROM thetable WHERE id = '$id'" $_GET is always passed as a string so we need to make sure that we are infact still holding the value of $id and it is indeed an integer. EDIT: Make sure $id = (int) $_GET['id']; and then add this code into your file to check if it is or isn't an int. if( is_int($id)) { echo 'is int'; }else{ echo 'not int'; } if that still doesn't resolve any issues can you try setting $id = 1 and running the script? I really can't see whatelse could be the problem. Just read this....it's working now? As with sanitizing the input, making id an integer should be enough in this case however more would be required if you were passing through a string. $string = preg_replace('/[^-a-zA-Z0-9_]/', '', $_GET['string']); This will take anything and make sure that it only contains letters, numbers, underscores or dashes.
  5. First of all, you're not sanitizing $_GET['id'] which is bad practice. Because you haven't shown us all the code this is what I'm assuming: Page 2 works but when you change your query to "SELECT * FROM thetable WHERE id = $id" it fails? Could be because $id has not been passed as an integer? $id = (int)$_GET['id'] If still no luck try replacing $id straight with an id that's in the database like: "SELECT * FROM thetable WHERE id = 1"
  6. Hey, I'm a Web Developer from New Zealand and I've been working with PHP for over 4 years now. I recently took a break from freelancing for the past couple of months to clear up any unfinished projects. All projects are now cleared so I'm available for hire now! I'm experienced in PHP and MySQL and can do HTML and CSS work (not design). I've also got a lot of experience in PHP Frameworks such as Laraval and CodeIgniter. My rates are very reasonable however it's of course neogitable depending on the jobs. I'm not interested in any projects where I only receive a percentage of the revenue. You can contact me through email at hello@nickoldfield.co.nz Thank you, Nick Oldfield.
  7. It is at the very top. First line
  8. Hi, I had my login working and now it has stopped working. Idk why but heres the files: <?php ob_start(); include 'inc/open.php'; // Define $ip and $password $ip=$_POST['ip']; $password=$_POST['password']; // To protect MySQL injection (more detail about MySQL injection) $ip = stripslashes($ip); $password = stripslashes($password); $ip = mysql_real_escape_string($ip); $password = mysql_real_escape_string($password); $sql="SELECT * FROM status WHERE ip='$ip' and password='$password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $ip and $password, table row must be 1 row if($count==1){ // Register $ip, $password and redirect to file "login_success.php" session_register("ip"); session_register("password"); header("location:lindex.php"); } else { echo "Wrong ip or Password"; } ob_end_flush(); ?> And then I want my index page to recognize this and do the following: <?php session_start(); include('inc/open.php'); if(session_is_registered('ip')){ echo "<h5><a href='index.php'>Home</a> | <a href='addnew.php'>Add New Sever</a> | <a href='offline.php'>View Offline Servers</a> | <a href='editserver.php'>Server CP</a></h5>"; }else{ echo "<h5><a href='index.php'>Home</a> | <a href='addnew.php'>Add New Sever</a> | <a href='offline.php'>View Offline Servers</a> | <a href='editlogin.php'>Login</a></h5>"; } ?> Thank you. Problem: the login is working and redirecting to index.php however index.php is not recognizing that user is logged on.
  9. Wow, that is confusing... Can someone please edit my code and put that in for me? It would mean a lot and who ever gets this working will get a sum of 5 - 10USD paid into their paypal.
  10. Here is my index.php: I want a page so once someone has posted a server they can later return to the status page and edit the details of it, eg: Name, Description and Host.
  11. Hello PhPFreakes, Well today I was coding my Server Status list (http://rspsdefero.com/status) and I wanted to add a "edit" page, but I couldn't find out how after heaps of attempts. May someone please reply, or PM or email me if they think or know they can add it and I will send them the script. Thanks, Rspsdefero.com Staff.
  12. I don't get a failure but no email gets sent.
×
×
  • 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.