Jump to content

Displaying variables in a form that has spaces in it???


my_r31_baby

Recommended Posts

I originally thought it was the database it was having trouble getting it from so that why i am trying to go from _ to " "...


Here is my script:

<?php
include("../db.php");

session_start();
$u_pk = $_SESSION['u_pk'];


$sql = "SELECT * FROM pb_users WHERE pb_users_userid = '$u_pk' " ;
// echo $sql;
$result = mysql_query( $sql ) or die ( 'Unable to execute query.' );
$num = mysql_num_rows( $result );

while ($row = mysql_fetch_assoc($result)) { 
$fname = $row['pb_users_firstname'];
$lname = $row['pb_users_lastname'];
$homeaddress = $row['pb_users_homeaddress'];
$townsub = $row['pb_users_townsub'];
$state = $row['pb_users_state'];
$postcode = $row['pb_users_postcode'];
$emailaddress = $row['pb_users_emailaddress'];
$homephone = $row['pb_users_homephone'];
$mobilephone = $row['pb_users_mobilephone'];

$homeaddress2 = eregi_replace("_", " ", $homeaddress);
};
?>


<tr>
        <td>First Name: <font color="#FF0000">*</font></td>
        <td><input type="text" name="first" value= <?php echo $fname ; ?> size="40%"></td>
      </tr>
  <tr>
        <td>Last Name: <font color="#FF0000">*</font></td>
        <td><input type="text" name="last" value= <?php echo $lname ; ?> size="40%"></td>
      </tr>
    <tr>
        <td>Address: <font color="#FF0000">*</font></td>
        <td><input type="text" name="address" value= <?php echo "$homeaddress2" ; ?> size="40%"></td>
      </tr>  
  <tr>
        <td>Town/Suburb<font color="#FF0000">*</font></td>
        <td><input type="text" name="townsuburb" value= <?php echo $townsub ; ?> size="40%"></td>
      </tr>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.