Greetings,
I'm working on a website and I need one link to lead to another website within the existing browser with my banner and side link bar. Here is an example of the code.
<?php
// Start an if.......else block that checks for a a value for id
if (!$a_id) {
session_start();
}
// Start an if..else check value of $valid then action based on result
if ($valid != "yes") {
// send user back to login form and exit script
session_register('valid');
}
// create variable to hold name of db that the table resides
$db_name = "db";
// create variable to hold name of table you are populating
$table_name = "table";
// add connection information
$connection = @mysql_connect("localhost", "db", "password")
or die (mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());
// perform some validation on value of $id make sure number exists in system
$chk_id = "SELECT a_id FROM $table_name WHERE a_id = \"$a_id\"";
//Create variable to hold result of mysql_query() function. Include @ to surpress warnings
//as well as the die () function to cause the script to end and a messager displays if query fails
$chk_id_res = @mysql_query($chk_id,$connection) or die ("Couldnt execute query.");
//create variable to count the number of rows within the result there should b 1
$chk_id_num = mysql_num_rows($chk_id_res);
// start and ifelse to deal with results, check row count correct answer is 1
if ($chk_id_num == "0") {
// if row count is zero the id is invalid redirect and exit script
header("Location: exit;
// Continue ifelse acting on valid result
} else {
// Create the sql statement select all fields of db except id for the record that has
// same ID value
$sql ="SELECT article_name, image, text, bigimage, alttext FROM $table_name WHERE a_id = \"$a_id\"";
}
// Create a variable to hold result of sql query function. Include at sign
// to supress warnings, as well as the die() function error message if query fails
$result = @mysql_query($sql,$connection) or die ("aint gonna be able to do it");
// Start while loop to create array for $row variable for each record in result set
while ($row = mysql_fetch_array($result)) {
// Get individual elements of the record and give them good names.
$article_name = $row[article_name];
$image = $row[image];
$text = $row[text];
$bigimage = $row[bigimage];
$alttext = $row[alttext];
}
?>
and I'm also providing a link to an example of what I want. Only difference instead of the anna nicole article can I embed another website such as google? while I still have my banner and side bar displayed on the page?
I'm working on a website and I need one link to lead to another website within the existing browser with my banner and side link bar. Here is an example of the code.
<?php
// Start an if.......else block that checks for a a value for id
if (!$a_id) {
session_start();
}
// Start an if..else check value of $valid then action based on result
if ($valid != "yes") {
// send user back to login form and exit script
session_register('valid');
}
// create variable to hold name of db that the table resides
$db_name = "db";
// create variable to hold name of table you are populating
$table_name = "table";
// add connection information
$connection = @mysql_connect("localhost", "db", "password")
or die (mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());
// perform some validation on value of $id make sure number exists in system
$chk_id = "SELECT a_id FROM $table_name WHERE a_id = \"$a_id\"";
//Create variable to hold result of mysql_query() function. Include @ to surpress warnings
//as well as the die () function to cause the script to end and a messager displays if query fails
$chk_id_res = @mysql_query($chk_id,$connection) or die ("Couldnt execute query.");
//create variable to count the number of rows within the result there should b 1
$chk_id_num = mysql_num_rows($chk_id_res);
// start and ifelse to deal with results, check row count correct answer is 1
if ($chk_id_num == "0") {
// if row count is zero the id is invalid redirect and exit script
header("Location: exit;
// Continue ifelse acting on valid result
} else {
// Create the sql statement select all fields of db except id for the record that has
// same ID value
$sql ="SELECT article_name, image, text, bigimage, alttext FROM $table_name WHERE a_id = \"$a_id\"";
}
// Create a variable to hold result of sql query function. Include at sign
// to supress warnings, as well as the die() function error message if query fails
$result = @mysql_query($sql,$connection) or die ("aint gonna be able to do it");
// Start while loop to create array for $row variable for each record in result set
while ($row = mysql_fetch_array($result)) {
// Get individual elements of the record and give them good names.
$article_name = $row[article_name];
$image = $row[image];
$text = $row[text];
$bigimage = $row[bigimage];
$alttext = $row[alttext];
}
?>
and I'm also providing a link to an example of what I want. Only difference instead of the anna nicole article can I embed another website such as google? while I still have my banner and side bar displayed on the page?