CTphpnwb's Profile User Rating: *****

Reputation: 3001 Guru
Group:
Mentors
Active Posts:
10,400 (4.63 per day)
Joined:
08-August 08
Profile Views:
59,797
Last Active:
User is online 35 minutes ago
Currently:
Viewing Topic: Does PHP hate me

Previous Fields

Country:
US
OS Preference:
Mac
Favorite Browser:
Safari
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Toyota
Dream Kudos:
350
Expert In:
PHP

Latest Visitors

Icon   CTphpnwb has not set their status

Posts I've Made

  1. In Topic: trouble with auto sender

    Posted 30 Sep 2014

    $_POST[name] != $_POST['name']
    Do you have a mail server set up?
    What error(s)/warning(s) are you getting?
  2. In Topic: Displaying html form search results using PHP

    Posted 30 Sep 2014

    Frist thing first: mysql_ functions are deprecated for good reason. They were replaced over ten years ago. Read up on and study prepared statements. Here's a great tutorial on PDO.
  3. In Topic: Does PHP hate me

    Posted 30 Sep 2014

    If $_GET['username'] is set and that username is in the clients table then $code will not be zero.

    By the way, you should properly indent your code:
    <?php
    include"header.php";
    $code=0;
    $sql = "SELECT * FROM clients";
    foreach ($pdo->query($sql) as $row)
    {
    	if($_GET['username']==$row['username'])
    	{
    		$code = 1;
    		if($pwd1=!$pwd2)
    		{
    			$code = 2;
    		}
    	}
    }
    
    if($code==0)
    {
    	$ps = $pdo->prepare("INSERT INTO clients(username, password, first, last, Company, Address, City, State, zip, Country, phone, e-mail) VALUES='?','?','?','?','?','?','?','?','?','?','?','?'");
    	$ps->bindValue(1,$_GET['username']);
    	$ps->bindValue(2,$_GET['pwd1']);
    	$ps->bindValue(3,$_GET['first']);
    	$ps->bindValue(4,$_GET['last']);
    	$ps->bindValue(5,$_GET['Company']);
    	$ps->bindValue(6,$_GET['Address']);
    	$ps->bindValue(7,$_GET['City']);
    	$ps->bindValue(8,$_GET['Sate']);
    	$ps->bindValue(9,$_GET['zip']);
    	$ps->bindValue(10,$_GET['Country']);
    	$ps->bindValue(11,$_GET['phone']);
    	$ps->bindValue(12,$_GET['e-mail']);
    	$ps->execute();
    }
    else
    {
    	print "error".$code;
    }
    include"footer.php";
    ?>
    
    
  4. In Topic: update tracking number

    Posted 30 Sep 2014

    View PostTaLeNT, on 30 September 2014 - 02:35 PM, said:

    I just want to get this working how it is right now. This is my personal project. Ill make it more efficient later but I just need help in figuring out what the current issue is.

    You've been told before to use prepared statements. You seem bent on doing things the wrong way, then trying to get us to fix1 it for you. Because of this, from this point forward I'm only going to help you when I see that your code already uses prepared statements. If you're not willing to learn, I'm not going to waste my time.


    1By fix it, I mean simply make it function. This of course is a terrible idea since the code would not be maintainable and at some point some other coder is likely to curse us for having helped you create a big pile of spaghetti for them to sort through.
  5. In Topic: update tracking number

    Posted 30 Sep 2014

    Read up on mysqli prepared statements:
    http://php.net/manua...-statements.php

    But first, answer my question in post #4.

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Looking for php programming work.
Years Programming:
34
Programming Languages:
Experience is important, yet at the same time it's over-rated.

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://

Comments

Page 1 of 1
  1. Photo

    CTphpnwb Icon

    31 Mar 2010 - 18:50
    Please post programming questions in the appropriate forums.
Page 1 of 1