Jump to content

Lee1007

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by Lee1007

  1. I have created a database that echos out the result on a webpage, what i want to do is create one of the echo results into a link - the code is as follows: "Web Address: $web_address <br>" . Is there an easy way to make the result a link as the input will always be a web address? Thanks in advance!
  2. Yea it is stored in a database. The script I want to style is: <?php include 'config.php'; include 'opendb.php'; $query = "SELECT shop_name, street_name, town, postcode, contact_number, web_address, user_email FROM user_info"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { $shop_name = $row[0]; $street_name = $row[1]; $town = $row[2]; $postcode = $row[3]; $contact_number = $row[4]; $web_address = $row[5]; $user_email = $row[6]; echo "<h5>Name:</h5>$shop_name <br>" . "<h5>Address</h5>$street_name <br>" . "$town <br>" . "$postcode <br>" . "<h5>Contact Details</h5>Phone Number:$contact_number <br>" . "Web Address: $web_address <br>" . "Email : $user_email <br><br>"; } include 'closedb.php'; ?> </div> The SQL is: <?php if (isset($_REQUEST['Submit'])) { # THIS CODE TELL MYSQL TO INSERT THE DATA FROM THE FORM INTO YOUR MYSQL TABLE $sql = "INSERT INTO $db_table(shop_name,street_name,town,postcode,contact_number,web_address,user_email) values ('".mysql_real_escape_string(stripslashes($_REQUEST['shop_name']))."','".mysql_real_escape_string(stripslashes($_REQUEST['street_name']))."','".mysql_real_escape_string(stripslashes($_REQUEST['town']))."','".mysql_real_escape_string(stripslashes($_REQUEST['postcode']))."','".mysql_real_escape_string(stripslashes($_REQUEST['contact_number']))."','".mysql_real_escape_string(stripslashes($_REQUEST['web_address']))."','".mysql_real_escape_string(stripslashes($_REQUEST['user_email']))."')"; if($result = mysql_query($sql ,$db)) { echo '<h1>Thank you</h1>Your information has been entered into our database<br><br>'; } else { echo "ERROR: ".mysql_error(); } } else { ?>
  3. Thank you I am hoping to accomplish what is attached in the image [attachment deleted by admin]
  4. I probably havent explained this too good - I have the results of: echo "<h5>Name:</h5>$shop_name <br>" . "<h5>Address</h5>$street_name <br>" . "$town <br>" . "$postcode <br>" . "<h5>Contact Details</h5>Phone Number:$contact_number <br>" . "Web Address: $web_address <br>" . "Email : $user_email <br><br>"; } but on the web page i want the results to be displayed in horizontal blocks of 3 - and the php will not accept the div within it to create this - is it even possible to change the layout of the results?
  5. Yea there are multiple results that come back in the echo though but only one div is showed in the result? I cant understand how to have each echo result in a separate div when showed on the webpage?
  6. Hi there, I have the following code: <?php include 'config.php'; include 'opendb.php'; $query = "SELECT shop_name, street_name, town, postcode, contact_number, web_address, user_email FROM user_info"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { $shop_name = $row[0]; $street_name = $row[1]; $town = $row[2]; $postcode = $row[3]; $contact_number = $row[4]; $web_address = $row[5]; $user_email = $row[6]; echo "<h5>Name:</h5>$shop_name <br>" . "<h5>Address</h5>$street_name <br>" . "$town <br>" . "$postcode <br>" . "<h5>Contact Details</h5>Phone Number:$contact_number <br>" . "Web Address: $web_address <br>" . "Email : $user_email <br><br>"; } include 'closedb.php'; ?> But i want to make the echo return in a box which is created by the div in the css? How do i do this? Please Help!!!
×
×
  • 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.