i have php code that executes successfully,this is it:
<?php //This is the directory where images will be saved $target = "DBimages/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_POST['pictitle']; $pic=($_FILES['photo']['name']); function getname() { echo $name; } // Connects to my Database mysql_connect("", "root", "") or die(mysql_error()) ; mysql_select_db("ibra") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO `dbpics` VALUES ('$name','$pic')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo'… $target)) { //Tells you if its all ok header("location:succesfulhomefeatur… } else { //Gives and error if its not header("location:failhomefeature.htm… } ?>So i want the variable $name in another php file so that when i update a column in this table it automatically gets the name and updates a page,ie:
<?php //include('homefeatureadd.php'); require 'homefeatureadd.php'; echo $name; // Connects to your Database mysql_connect("", "root", "") or die(mysql_error()) ; mysql_select_db("ibra") or die(mysql_error()) ; //Retrieves data from MySQL $data = mysql_query("SELECT photo from dbpics where pictitle='$name'") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data Echo ""; //Echo "
"; } ?>
NOTE:there are some inconsistencies in the code like functions that dont execute and echo commands cause i was trying to figure it out… PLEASE help,ive got a deadline looming…