Jump to content

[SOLVED] image upload and update script


happypete

Recommended Posts

pache version  1.3.41 (Unix)

PHP version  5.2.6

MySQL version  5.0.81-community

Architecture  x86_64

Operating system  Linux

 

Simiular to the problem i had here: http://www.phpfreaks.com/forums/index.php/topic,271119.0.html

 

I have integrated an image resize script with a multiple row display and update script.

 

It uploads the image to a directory and saves the url to the database. It also displays the thumbnail on the page with the description and order, but I cant get it to update the description.

 

capture1.jpg

 

capture3.jpg

 

<?php

$submit = $_POST['submit'];
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if($submit){
for($i=0;$i<$count;$i++){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}
}

if($result1){
header("location:index1.php");
}
mysql_close();


// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();

$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

error_reporting(0);
$picdescription = addslashes($_POST['picdescription']); 
$change="";
$abc="";
define ("MAX_SIZE","400");
function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
}
$errors=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
	if ($image) 
	{
		$filename = stripslashes($_FILES['file']['name']);
  		$extension = getExtension($filename);
		$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
		{
			$change='<div class="msgdiv">Unknown Image extension </div> ';
			$errors=1;
		}
		else
		{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else 
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);

$newwidth=600;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=200;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$filename = "uploads/". $_FILES['file']['name'];
$filename1 = "uploads/tn/". $_FILES['file']['name'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
//If no errors registred, print the success message
if(isset($_POST['Submit']) && !$errors) 
{
$q = "INSERT into photo(description, src, tn_src) VALUES('$picdescription', '$filename', '$filename1')";
        $result = $mysqli->query($q) or die(mysqli_error($mysqli));
        
        if($result) {
            $change=' <div class="msgdiv">Image Uploaded Successfully!</div>';
        }

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />


</head>
<body>
<div id="container">
<div id="header">
	<h1>Admin page</h1>
</div>
<div id="content">
      <div id="page">

	<?php echo $change; ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
    <tbody>
    <tr>
    <td width="500" height="238" valign="top" id="main_right">
    <div id="posts">
    <form method="post" action="" enctype="multipart/form-data" name="form1">

    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><Td style="height:25px"> </Td></tr>
    <tr>
    <td width="150"><div align="right" class="titles">Picture 
    : </div></td>
    <td width="350" align="left">
    <div align="left">
    <input size="25" name="file" type="file" style="font-family:Verdana; font-size:10pt" class="box"/>
    </div></td>
    </tr>
    <tr><Td></Td>
    <Td valign="top" height="35px" class="help">Image maximum size <b>400 </b>kb</span></Td>
    </tr>
    <tr>
    <Td></Td>
    <Td valign="top" height="35px"> <label for="picdescription">Description</label><br />
    <input type="text" name="picdescription" value="" /><br /></Td>
    </tr>
    <tr><Td></Td><Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Submit"/></Td></tr>
    <tr>
    <td width="200"> </td>
    <td width="200"><table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="200" align="center"><div align="left"></div></td>
    <td width="100"> </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    
    
<form method="POST" action="">
<?
include('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") 
or die("Bad query: ".mysql_error());
while ( $row = mysql_fetch_array($result) )  
{ 
?>

<input type="text" name="<? print $row['rank'] ;?>" size="2" value="<? print $row['rank'] ;?>">
<input type="text" name="<? print $row['description'] ;?>" size="" value="<? print $row['description'] ;?>">

<?
echo "<img src=\"".$row['tn_src']."\"/>";
echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";													
} // END WHILE
?>

<input type="submit" value="Update" name="submit">
</form>

</div>

 

 

Link to comment
Share on other sites

your form says 'picdescription' you php code says 'description'

update one of them (ie)

change

<input type="text" name="picdescription" value="" /><br /></Td>

to

<input type="text" name="description" value="" /><br /></Td>

 

also


<input type="text" name="<? print $row['rank'] ;?>" size="2" value="<? print $row['rank'] ;?>">
<input type="text" name="<? print $row['description'] ;?>" size="" value="<? print $row['description'] ;?>">

should be

<input type="text" name="rank" size="2" value="<?php print $row['rank'] ;?>">
<input type="text" name="description" size="" value="<?php print $row['description'] ;?>">

Link to comment
Share on other sites

updated script:

 

<?php

$submit = $_POST['submit'];
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if($submit){
for($i=0;$i<$count;$i++){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}
}

if($result1){
header("location:index1.php");
}
mysql_close();


// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();

$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

error_reporting(0);
$picdescription = addslashes($_POST['picdescription']); 
$change="";
$abc="";
define ("MAX_SIZE","400");
function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
}
$errors=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
	if ($image) 
	{
		$filename = stripslashes($_FILES['file']['name']);
  		$extension = getExtension($filename);
		$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
		{
			$change='<div class="msgdiv">Unknown Image extension </div> ';
			$errors=1;
		}
		else
		{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else 
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);

$newwidth=600;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=200;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$filename = "uploads/". $_FILES['file']['name'];
$filename1 = "uploads/tn/". $_FILES['file']['name'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
//If no errors registred, print the success message
if(isset($_POST['Submit']) && !$errors) 
{
$q = "INSERT into photo(description, src, tn_src) VALUES('$picdescription', '$filename', '$filename1')";
        $result = $mysqli->query($q) or die(mysqli_error($mysqli));
        
        if($result) {
            $change=' <div class="msgdiv">Image Uploaded Successfully!</div>';
        }

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />


</head>
<body>
<div id="container">
<div id="header">
	<h1>Admin page</h1>
</div>
<div id="content">
      <div id="page">

	<?php echo $change; ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
    <tbody>
    <tr>
    <td width="500" height="238" valign="top" id="main_right">
    <div id="posts">
    <form method="post" action="" enctype="multipart/form-data" name="form1">

    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><Td style="height:25px"> </Td></tr>
    <tr>
    <td width="150"><div align="right" class="titles">Picture 
    : </div></td>
    <td width="350" align="left">
    <div align="left">
    <input size="25" name="file" type="file" style="font-family:Verdana; font-size:10pt" class="box"/>
    </div></td>
    </tr>
    <tr><Td></Td>
    <Td valign="top" height="35px" class="help">Image maximum size <b>400 </b>kb</span></Td>
    </tr>
    <tr>
    <Td></Td>
    <Td valign="top" height="35px"> <label for="picdescription">Description</label><br />
    <input type="text" name="picdescription" value="" /><br /></Td>
    </tr>
    <tr><Td></Td><Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Submit"/></Td></tr>
    <tr>
    <td width="200"> </td>
    <td width="200"><table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="200" align="center"><div align="left"></div></td>
    <td width="100"> </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    
    
<form method="POST" action="">
<?php
include('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") 
or die("Bad query: ".mysql_error());
while ( $row = mysql_fetch_array($result) )  
{ 
?>

<input type="text" name="rank" size="2" value="<?php print $row['rank'] ;?>">
<input type="text" name="description" size="" value="<?php print $row['description'] ;?>">

<?php
echo "<img src=\"".$row['tn_src']."\"/>";
echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";													
} // END WHILE
?>

<input type="submit" value="Update" name="submit">
</form>

</div>

Link to comment
Share on other sites

You missed this part!

 

your form says 'picdescription' you php code says 'description'

update one of them (ie)

change

<input type="text" name="picdescription" value="" /><br /></Td>

to

<input type="text" name="description" value="" /><br /></Td>

 

do a find in your code for "picdescription" and replace them both with 'description'

Link to comment
Share on other sites

piddescription replaced

 

here is the script now.. still not working  :(

 

<?php

$submit = $_POST['submit'];
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if($submit){
for($i=0;$i<$count;$i++){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}
}

if($result1){
header("location:index1.php");
}
mysql_close();


// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();

$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

error_reporting(0);
$description = addslashes($_POST['description']); 
$change="";
$abc="";
define ("MAX_SIZE","400");
function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
}
$errors=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
	if ($image) 
	{
		$filename = stripslashes($_FILES['file']['name']);
  		$extension = getExtension($filename);
		$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
		{
			$change='<div class="msgdiv">Unknown Image extension </div> ';
			$errors=1;
		}
		else
		{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else 
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);

$newwidth=600;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=200;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$filename = "uploads/". $_FILES['file']['name'];
$filename1 = "uploads/tn/". $_FILES['file']['name'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
//If no errors registred, print the success message
if(isset($_POST['Submit']) && !$errors) 
{
$q = "INSERT into photo(description, src, tn_src) VALUES('$description', '$filename', '$filename1')";
        $result = $mysqli->query($q) or die(mysqli_error($mysqli));
        
        if($result) {
            $change=' <div class="msgdiv">Image Uploaded Successfully!</div>';
        }

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />


</head>
<body>
<div id="container">
<div id="header">
	<h1>Admin page</h1>
</div>
<div id="content">
      <div id="page">

	<?php echo $change; ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
    <tbody>
    <tr>
    <td width="500" height="238" valign="top" id="main_right">
    <div id="posts">
    <form method="post" action="" enctype="multipart/form-data" name="form1">

    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><Td style="height:25px"> </Td></tr>
    <tr>
    <td width="150"><div align="right" class="titles">Picture 
    : </div></td>
    <td width="350" align="left">
    <div align="left">
    <input size="25" name="file" type="file" style="font-family:Verdana; font-size:10pt" class="box"/>
    </div></td>
    </tr>
    <tr><Td></Td>
    <Td valign="top" height="35px" class="help">Image maximum size <b>400 </b>kb</span></Td>
    </tr>
    <tr>
    <Td></Td>
    <Td valign="top" height="35px"> <label for="description">Description</label><br />
    <input type="text" name="description" value="" /><br /></Td>
    </tr>
    <tr><Td></Td><Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Submit"/></Td></tr>
    <tr>
    <td width="200"> </td>
    <td width="200"><table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="200" align="center"><div align="left"></div></td>
    <td width="100"> </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    
    
<form method="POST" action="">
<?php
include('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") 
or die("Bad query: ".mysql_error());
while ( $row = mysql_fetch_array($result) )  
{ 
?>

<input type="text" name="rank" size="2" value="<?php print $row['rank'] ;?>">
<input type="text" name="description" size="" value="<?php print $row['description'] ;?>">

<?php
echo "<img src=\"".$row['tn_src']."\"/>";
echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";													
} // END WHILE
?>

<input type="submit" value="submit" name="submit">
</form>

</div>

Link to comment
Share on other sites

change

// Check if button name "Submit" is active, do this
if($submit){
for($i=0;$i<$count;$i++){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}
}

to

// Check if button name "Submit" is active, do this
if($submit){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}

 

%count isn't set and i see no reason for having that code

Link to comment
Share on other sites

thanks MadTechie, changed that but it's still NOT working :( any other ideas ?

 

<?php

$submit = $_POST['submit'];
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if($submit){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}

if($result1){
header("location:index1.php");
}
mysql_close();


// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();

$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

error_reporting(0);
$description = addslashes($_POST['description']); 
$change="";
$abc="";
define ("MAX_SIZE","400");
function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
}
$errors=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
	if ($image) 
	{
		$filename = stripslashes($_FILES['file']['name']);
  		$extension = getExtension($filename);
		$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
		{
			$change='<div class="msgdiv">Unknown Image extension </div> ';
			$errors=1;
		}
		else
		{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else 
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);

$newwidth=600;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=200;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$filename = "uploads/". $_FILES['file']['name'];
$filename1 = "uploads/tn/". $_FILES['file']['name'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
//If no errors registred, print the success message
if(isset($_POST['Submit']) && !$errors) 
{
$q = "INSERT into photo(description, src, tn_src) VALUES('$description', '$filename', '$filename1')";
        $result = $mysqli->query($q) or die(mysqli_error($mysqli));
        
        if($result) {
            $change=' <div class="msgdiv">Image Uploaded Successfully!</div>';
        }

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />


</head>
<body>
<div id="container">
<div id="header">
	<h1>Admin page</h1>
</div>
<div id="content">
      <div id="page">

	<?php echo $change; ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
    <tbody>
    <tr>
    <td width="500" height="238" valign="top" id="main_right">
    <div id="posts">
    <form method="post" action="" enctype="multipart/form-data" name="form1">

    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><Td style="height:25px"> </Td></tr>
    <tr>
    <td width="150"><div align="right" class="titles">Picture 
    : </div></td>
    <td width="350" align="left">
    <div align="left">
    <input size="25" name="file" type="file" style="font-family:Verdana; font-size:10pt" class="box"/>
    </div></td>
    </tr>
    <tr><Td></Td>
    <Td valign="top" height="35px" class="help">Image maximum size <b>400 </b>kb</span></Td>
    </tr>
    <tr>
    <Td></Td>
    <Td valign="top" height="35px"> <label for="description">Description</label><br />
    <input type="text" name="description" value="" /><br /></Td>
    </tr>
    <tr><Td></Td><Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Submit"/></Td></tr>
    <tr>
    <td width="200"> </td>
    <td width="200"><table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="200" align="center"><div align="left"></div></td>
    <td width="100"> </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    
    
<form method="POST" action="">
<?php
include('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") 
or die("Bad query: ".mysql_error());
while ( $row = mysql_fetch_array($result) )  
{ 
?>

<input type="text" name="rank" size="2" value="<?php print $row['rank'] ;?>">
<input type="text" name="description" size="" value="<?php print $row['description'] ;?>">

<?php
echo "<img src=\"".$row['tn_src']."\"/>";
echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";													
} // END WHILE
?>

<input type="submit" value="submit" name="submit">
</form>

</div>

Link to comment
Share on other sites

I'd personally say that...

 

$submit = $_POST['submit']; 

 

Was correct and you should change it back, because thats what matches the form. MadTechie was probably thinking of this bit...

 

if(isset($_POST['Submit']) && !$errors) 

 

which probably wants changing to...

 

if(isset($submit) && !$errors) 

Link to comment
Share on other sites

Scratch what I said, didn't realise there were two form one with button named Submit and another with button named submit, that is REALLY confusing.

 

EDIT: On second look at the code it would make far more sense to rename the first submit button to "upload" and the other to "update". Then change any reference in code to Submit or submit to upload or update dependent on which job they are related to.

Link to comment
Share on other sites

ok made the buttons different to make it clearer..but it still doesnt update...

 

full code up to now...

 

<?php

$Update = $_POST['Update'];
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if($submit){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}

if($result1){
header("location:index1.php");
}
mysql_close();


// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();

$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

error_reporting(0);
$description = addslashes($_POST['description']); 
$change="";
$abc="";
define ("MAX_SIZE","400");
function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
}
$errors=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
	if ($image) 
	{
		$filename = stripslashes($_FILES['file']['name']);
  		$extension = getExtension($filename);
		$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
		{
			$change='<div class="msgdiv">Unknown Image extension </div> ';
			$errors=1;
		}
		else
		{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else 
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);

$newwidth=600;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=200;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$filename = "uploads/". $_FILES['file']['name'];
$filename1 = "uploads/tn/". $_FILES['file']['name'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
//If no errors registred, print the success message
if(isset($_POST['Upload']) && !$errors) 
{
$q = "INSERT into photo(description, src, tn_src) VALUES('$description', '$filename', '$filename1')";
        $result = $mysqli->query($q) or die(mysqli_error($mysqli));
        
        if($result) {
            $change=' <div class="msgdiv">Image Uploaded Successfully!</div>';
        }

}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />


</head>
<body>
<div id="container">
<div id="header">
	<h1>Admin page</h1>
</div>
<div id="content">
      <div id="page">

	<?php echo $change; ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
    <tbody>
    <tr>
    <td width="500" height="238" valign="top" id="main_right">
    <div id="posts">
    <form method="post" action="" enctype="multipart/form-data" name="form1">

    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><Td style="height:25px"> </Td></tr>
    <tr>
    <td width="150"><div align="right" class="titles">Picture 
    : </div></td>
    <td width="350" align="left">
    <div align="left">
    <input size="25" name="file" type="file" style="font-family:Verdana; font-size:10pt" class="box"/>
    </div></td>
    </tr>
    <tr><Td></Td>
    <Td valign="top" height="35px" class="help">Image maximum size <b>400 </b>kb</span></Td>
    </tr>
    <tr>
    <Td></Td>
    <Td valign="top" height="35px"> <label for="description">Description</label><br />
    <input type="text" name="description" value="" /><br /></Td>
    </tr>
    <tr><Td></Td><Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Upload"/></Td></tr>
    <tr>
    <td width="200"> </td>
    <td width="200"><table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="200" align="center"><div align="left"></div></td>
    <td width="100"> </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </tr>
    </tbody>
    </table>
    
    
<form method="POST" action="">
<?php
include('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") 
or die("Bad query: ".mysql_error());
while ( $row = mysql_fetch_array($result) )  
{ 
?>

<input type="text" name="rank" size="2" value="<?php print $row['rank'] ;?>">
<input type="text" name="description" size="" value="<?php print $row['description'] ;?>">

<?php
echo "<img src=\"".$row['tn_src']."\"/>";
echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";													
} // END WHILE
?>

<input type="submit" value="Update" name="Update">
</form>

</div>1.0

Link to comment
Share on other sites

Right at the top there you have this...

 

// Check if button name "Submit" is active, do this
if($submit){
$sql1= mysql_query("UPDATE photo SET rank='{$_POST['rank']}', description='{$_POST['description']}' WHERE id=$id");
$result1=mysql_query($sql1);
}

 

Hopefully you can see your mistake in as much as it says $submit, which should obviously be $Update

Link to comment
Share on other sites

this is what you should be on so far!

<?php
$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];
// Check if button name "Submit" is active, do this
if (isset($_POST['Update'])) {
    $sql1 = "UPDATE photo SET rank='$rank', description='$description' WHERE id=$id";
    $result1 = mysql_query($sql1);
    if ($result1) {
        header("location:index1.php");
    }
}
// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();
$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";
$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());
error_reporting(0);
$change = "";
$abc = "";
define("MAX_SIZE", "400");
$errors = 0;
if (isset($_POST['Upload'])) {
    $image = $_FILES["file"]["name"];
    $uploadedfile = $_FILES['file']['tmp_name'];
    if ($image) {
        $filename = stripslashes($_FILES['file']['name']);
        $extension = getExtension($filename);
        $extension = strtolower($extension);
        if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) {
            $change = '<div class="msgdiv">Unknown Image extension </div> ';
            $errors = 1;
        } else {
            $size = filesize($_FILES['file']['tmp_name']);
            if ($size > MAX_SIZE * 1024) {
                $change = '<div class="msgdiv">You have exceeded the size limit!</div> ';
                $errors = 1;
            }
            if ($extension == "jpg" || $extension == "jpeg") {
                $uploadedfile = $_FILES['file']['tmp_name'];
                $src = imagecreatefromjpeg($uploadedfile);
            } else if ($extension == "png") {
                $uploadedfile = $_FILES['file']['tmp_name'];
                $src = imagecreatefrompng($uploadedfile);
            } else {
                $src = imagecreatefromgif($uploadedfile);
            }
            echo $scr;
            list ($width, $height) = getimagesize($uploadedfile);
            $newwidth = 600;
            $newheight = ($height / $width) * $newwidth;
            $tmp = imagecreatetruecolor($newwidth, $newheight);
            $newwidth1 = 200;
            $newheight1 = ($height / $width) * $newwidth1;
            $tmp1 = imagecreatetruecolor($newwidth1, $newheight1);
            imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
            imagecopyresampled($tmp1, $src, 0, 0, 0, 0, $newwidth1, $newheight1, $width, $height);
            $filename = "uploads/" . $_FILES['file']['name'];
            $filename1 = "uploads/tn/" . $_FILES['file']['name'];
            imagejpeg($tmp, $filename, 100);
            imagejpeg($tmp1, $filename1, 100);
            imagedestroy($src);
            imagedestroy($tmp);
            imagedestroy($tmp1);
        }
    }
}
//If no errors registred, print the success message
if ($errors>0) {
    $q = "INSERT into photo(description, src, tn_src) VALUES('$description', '$filename', '$filename1')";
    $result = $mysqli->query($q) or die(mysqli_error($mysqli));
    if ($result) {
        $change = '<div class="msgdiv">Image Uploaded Successfully!</div>';
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
<h1>Admin page</h1>
</div>
<div id="content">
<div id="page">

    <?php
    echo $change;
    ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
<tbody>
	<tr>
		<td width="500" height="238" valign="top" id="main_right">
		<div id="posts">
		<form method="post" action="" enctype="multipart/form-data"	name="form1">

		<table width="500" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<Td style="height: 25px"> </Td>
			</tr>
			<tr>
				<td width="150">
				<div align="right" class="titles">Picture :</div>
				</td>
				<td width="350" align="left">
				<div align="left"><input size="25" name="file" type="file" style="font-family: Verdana; font-size: 10pt" class="box" /></div>
				</td>
			</tr>
			<tr>
				<Td></Td>
				<Td valign="top" height="35px" class="help">Image maximum size <b>400
				</b>kb</span></Td>
			</tr>
			<tr>
				<Td></Td>
				<Td valign="top" height="35px"><label for="description">Description</label><br />
				<input type="text" name="description" value="" /><br />
				</Td>
			</tr>
			<tr>
				<Td></Td>
				<Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Upload" /></Td>
			</tr>
			<tr>
				<td width="200"> </td>
				<td width="200">
				<table width="200" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="200" align="center">
						<div align="left"></div>
						</td>
						<td width="100"> </td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</form>
		</div>
		</td>
	</tr>
</tbody>
</table>


<form method="POST" action="">
<?php
include ('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") or die("Bad query: " . mysql_error());
while ($row = mysql_fetch_array($result)) {
    ?>

<input type="text" name="rank" size="2" value="<?php print $row['rank']; ?>">
<input type="text" name="description" size="" value="<?php print $row['description']; ?>">
<?php
    echo "<img src=\"" . $row['tn_src'] . "\"/>";
    echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";
} // END WHILE
?>
<input type="submit" value="Update" name="Update">
</form>

</div>1.0

<?php
function getExtension ($str)
{
    $i = strrpos($str, ".");
    if (! $i) {
        return "";
    }
     $l = strlen($str) - $i;
     $ext = substr($str,$i+1,$l);
     return $ext;
}
?>

Link to comment
Share on other sites

You have no database connection present at the point where the UPDATE query is being executed.

 

The mysqli connection is being made later in the code and the mysql connection is right before a SELECT query near the bottom of the code.

 

Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON so that php would help you by displaying all the errors it detects?

 

Edit: And remove the error_reporting(0); line that is in the code now as that just hides errors that would help you find why your code is not working.

 

Attempting to learn php, develop php code, and debug php code without using full php error_reporting/display_errors and without using mysql/mysqli error reporting on query statements is like a blind guy trying to drive down the highway. You might eventually get where you are going (produce code that works) but it will take you a very long time and when you get there you will be in a world of hurt.

Link to comment
Share on other sites

I don't see how fixing problems with your code/debug settings are a step backwards, even if they break functionality. Has your code changed from what you last posted? Do you now have error_reporting set on your server to E_ALL?

Link to comment
Share on other sites

I removed some pointless code (loading MySqlI) and moved some parts around, turned on error reporting, try that if it fails you should get a useful error..

 

<?php
error_reporting(E_ALL);
// It double checks to see if I'm logged in
require_once 'sources/login/classes/Membership.php';
$membership = New Membership();
$membership->confirm_Member();
$db_name = "trek_trek";
$db_server = "localhost";
$db_user = "trek_user";
$db_pass = "intergreen";
$change = "";
$abc = "";
define("MAX_SIZE", "400");
$errors = 0;

$rank = $_POST['rank'];
$description = $_POST['description'];
$id = $_POST['id'];

// Check if button name "Submit" is active, do this
if (isset($_POST['Update'])) {
    $sql1 = "UPDATE photo SET rank='$rank', description='$description' WHERE id=$id";
    $result1 = mysql_query($sql1) or die(mysql_error());
    if ($result1) {
        header("location:index1.php");
    }
}
if (isset($_POST['Upload'])) {
    $image = $_FILES["file"]["name"];
    $uploadedfile = $_FILES['file']['tmp_name'];
    if ($image) {
        $filename = stripslashes($_FILES['file']['name']);
        $extension = getExtension($filename);
        $extension = strtolower($extension);
        if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) {
            $change = '<div class="msgdiv">Unknown Image extension </div> ';
            $errors = 1;
        } else {
            $size = filesize($_FILES['file']['tmp_name']);
            if ($size > MAX_SIZE * 1024) {
                $change = '<div class="msgdiv">You have exceeded the size limit!</div> ';
                $errors = 1;
            }
            if ($extension == "jpg" || $extension == "jpeg") {
                $uploadedfile = $_FILES['file']['tmp_name'];
                $src = imagecreatefromjpeg($uploadedfile);
            } else if ($extension == "png") {
                $uploadedfile = $_FILES['file']['tmp_name'];
                $src = imagecreatefrompng($uploadedfile);
            } else {
                $src = imagecreatefromgif($uploadedfile);
            }
            list ($width, $height) = getimagesize($uploadedfile);
            $newwidth = 600;
            $newheight = ($height / $width) * $newwidth;
            $tmp = imagecreatetruecolor($newwidth, $newheight);
            $newwidth1 = 200;
            $newheight1 = ($height / $width) * $newwidth1;
            $tmp1 = imagecreatetruecolor($newwidth1, $newheight1);
            imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
            imagecopyresampled($tmp1, $src, 0, 0, 0, 0, $newwidth1, $newheight1, $width, $height);
            $filename = "uploads/" . $_FILES['file']['name'];
            $filename1 = "uploads/tn/" . $_FILES['file']['name'];
            imagejpeg($tmp, $filename, 100);
            imagejpeg($tmp1, $filename1, 100);
            imagedestroy($src);
            imagedestroy($tmp);
            imagedestroy($tmp1);
        }
    }
}
//If no errors registred, print the success message
if ($errors == 0) {
    	$q = "INSERT into photo(description, src, tn_src) VALUES('$description', '$filename', '$filename1')";
    	//$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());
	//$result = $mysqli->query($q) or die(mysqli_error($mysqli));
	$result = mysql_query($q) or die(mysql_error());
    if ($result) {
        $change = '<div class="msgdiv">Image Uploaded Successfully!</div>';
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Page</title>
<link rel="stylesheet" href="sources/styles.css" type="text/css" />
<link rel="stylesheet" href="admin.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
<h1>Admin page</h1>
</div>
<div id="content">
<div id="page">

    <?php
    echo $change;
    ?>
<table width="502" cellpadding="0" cellspacing="0" id="main">
   <tbody>
      <tr>
         <td width="500" height="238" valign="top" id="main_right">
         <div id="posts">
         <form method="post" action="" enctype="multipart/form-data"   name="form1">

         <table width="500" border="0" align="center" cellpadding="0"
            cellspacing="0">
            <tr>
               <Td style="height: 25px"> </Td>
            </tr>
            <tr>
               <td width="150">
               <div align="right" class="titles">Picture :</div>
               </td>
               <td width="350" align="left">
               <div align="left"><input size="25" name="file" type="file" style="font-family: Verdana; font-size: 10pt" class="box" /></div>
               </td>
            </tr>
            <tr>
               <Td></Td>
               <Td valign="top" height="35px" class="help">Image maximum size <b>400
               </b>kb</span></Td>
            </tr>
            <tr>
               <Td></Td>
               <Td valign="top" height="35px"><label for="description">Description</label><br />
               <input type="text" name="description" value="" /><br />
               </Td>
            </tr>
            <tr>
               <Td></Td>
               <Td valign="top" height="35px"><input type="submit" id="mybut" value="Upload" name="Upload" /></Td>
            </tr>
            <tr>
               <td width="200"> </td>
               <td width="200">
               <table width="200" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                     <td width="200" align="center">
                     <div align="left"></div>
                     </td>
                     <td width="100"> </td>
                  </tr>
               </table>
               </td>
            </tr>
         </table>
         </form>
         </div>
         </td>
      </tr>
   </tbody>
</table>


<form method="POST" action="">
<?php
include ('testconfig.php');
$result = mysql_query("SELECT * FROM photo ORDER BY rank ASC") or die("Bad query: " . mysql_error());
while ($row = mysql_fetch_array($result))
{
    ?>
<input type="text" name="id" size="2" value="<?php print $row['id']; ?>">
<input type="text" name="rank" size="2" value="<?php print $row['rank']; ?>">
<input type="text" name="description" size="" value="<?php print $row['description']; ?>">
<?php
    echo "<img src=\"" . $row['tn_src'] . "\"/>";
    echo " <a href=delete1.php?id={$row['id']}>Delete</a><br>";
} // END WHILE
?>
<input type="submit" value="Update" name="Update">
</form>

</div>1.0

<?php
function getExtension ($str)
{
    $i = strrpos($str, ".");
    if (! $i) {
        return "";
    }
     $l = strlen($str) - $i;
     $ext = substr($str,$i+1,$l);
     return $ext;
}
?>

Link to comment
Share on other sites

thanks for the updating the script. Now each time I try and update or refresh the page it adds a new input box (see attached screenshot), but doesn't update, although it is now getting redirected to index1.php as per:

 

    if ($result1) {
        header("location:index1.php");

 

updated.jpg

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.