brianborn1968's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
76 (0.07 per day)
Joined:
15-November 11
Profile Views:
695
Last Active:
User is offline Mar 07 2014 05:16 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   brianborn1968 has not set their status

Posts I've Made

  1. In Topic: Personalize webpage with ID passed via URL

    Posted 6 Mar 2014

    View Postmodi123_1, on 06 March 2014 - 01:08 PM, said:

    I am unclear how this threads's topics and solicitation for a money campaign operate together.

    As it is - I removed the solicitation link.


    Sorry modi123_1, it was not my intention to solicit for money. My intention was that if others knew the reason of this thread, the feedback would be more helpful than leading to many more questions that confuse me even more. I will just delete the content of that post.
  2. In Topic: Personalize webpage with ID passed via URL

    Posted 6 Mar 2014

    Removed, not relevant.
  3. In Topic: Personalize webpage with ID passed via URL

    Posted 6 Mar 2014

    View PostCTphpnwb, on 06 March 2014 - 12:53 PM, said:

    Your first post seems to indicate you've done a url rewrite. How have you done that? It doesn't look to me like it's rewriting /joe to /page.php?id=joe.


    No rewrite as the URL is actually...
    http://localhost/lan...home.php?id=joe

    but would like the end result to be...
    http://localhost/joe
    or even...
    http://localhost/member/joe
  4. In Topic: Personalize webpage with ID passed via URL

    Posted 6 Mar 2014

    Sorry no2pencil, your code did work. Using the undo changed line 5.
    $ps = $pdo->prepare("SELECT * FROM members WHERE id = " . $_GET['id']);

    This was just experimenting earlier.
  5. In Topic: Personalize webpage with ID passed via URL

    Posted 6 Mar 2014

    View Postno2pencil, on 06 March 2014 - 12:41 PM, said:

    If you are not validating the value passed in get, why not just pass it directly?

    if(isset($_GET["id"])) {
      $ps->execute(array($_GET["id"]));
    }
    
    

    This results in the following errors.
    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'joe' in 'where clause'' in C:\wamp\www\lancto\home.php on line 18
    PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'joe' in 'where clause' in C:\wamp\www\lancto\home.php on line 18

    This does NOT work. See lines 6-8.
    <?php
    	$pdo = new PDO('mysql:host=localhost;dbname=lancto', 'root', '');
    
    	// retrieve member's data
    	$ps = $pdo->prepare("SELECT * FROM members WHERE id = " . $_GET['id']);
    	if(isset($_GET["id"])) {
    	$ps->execute(array($_GET["id"]));
    	}
    
    	$result = $ps->fetch(PDO::FETCH_ASSOC);
    
    	extract($result);
    
    	$db = null;
    ?>
    
    <!doctype html>
    <html><head>
    <meta charset="utf-8">
    </head><body>
    
    <p>Hello, my name is <?php echo $First_Name; ?> and this is a test.</p>
    
    <p>Regards,</p>
    
    <p><?php echo $First_Name; ?><br>
    <?php echo $Phone; ?><br>
    <?php echo $Email; ?></p>
    
    
    </body>
    </html>
    
    


    This does work. See lines 6-7.
    <?php
    	$pdo = new PDO('mysql:host=localhost;dbname=lancto', 'root', '');
    
    	// retrieve member's data
    	$ps = $pdo->prepare("SELECT * FROM members WHERE id = ?");
    	$id = "joe";
    	$ps->execute(array($id));
    	
    	$result = $ps->fetch(PDO::FETCH_ASSOC);
    
    	extract($result);
    
    	$db = null;
    ?>
    
    <!doctype html>
    <html><head>
    <meta charset="utf-8">
    </head><body>
    
    <p>Hello, my name is <?php echo $First_Name; ?> and this is a test.</p>
    
    <p>Regards,</p>
    
    <p><?php echo $First_Name; ?><br>
    <?php echo $Phone; ?><br>
    <?php echo $Email; ?></p>
    
    
    </body>
    </html>
    
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Charleston, SC
Interests:
PHP and Database Development.
Full Name:
Brian Boyd
Years Programming:
2

Contact Information

E-mail:
Private
Website URL:
Website URL  http://CubicalWeb.com

Friends

Comments

Page 1 of 1
  1. Photo

    synlight Icon

    10 Jul 2012 - 06:22
    Hola! This is my "I'm desperate for answers please help me!" place LOL. Good to see you here!
Page 1 of 1