PHP - Sliding Images
Hereby, i need assistance from your side. That here the images are not getting sliding.Moreover the uploaded images are getting stored in database and unable to fetch from the "images folder"
We have created 2 folders image folder for cover page image and second one is images folder for inside images i.e slider images. Moreover,cover page is fetching from image folder and getting displayed but slider images are not fetching from the images folder. meanwhile uploaded images are getting stored in database as well..
Can you guys please me. Similar TutorialsHello, i want when click next button to show the 4 content ... ive try everything Code: [Select] <div id="MoreBoxBorder"><div id="MoreBoxBorderLine"></div></div> <div id="ArrowMoreBox"><a class="next browse right"><div id="ArrowMoreImage"></div></a></div> <?php $query = "SELECT *, date_FORMAT(Date, '%H:%i') as Date_Time FROM tblnews WHERE LatestNews = 1 AND Category != 10 ORDER BY `Date` DESC LIMIT 4"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { ?> <div id="MoreBox" id="comments"> <div class="box"> <a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><img src="<?php echo html_entity_decode($row['Thumb']);?>" border="0" width="110" height="64" /></a> <strong><a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><strong><?php echo html_entity_decode(substr($row['Title'],0,437));?></strong></a></strong> <p><?php echo html_entity_decode($row['SubTitle']);?></strong> <div id="MoreIcoBox"> <a href="<?php echo BASE_URL;?>index.php?pid=article&artidread=<?php echo $row['Id'];?>"><img id="MoreIco" src="<?php echo BASE_URL;?>images/news/more.png" border="0" /></a> </div> </div> </div> <?php } ?> Like the image.. when i click next image will display another 4 (& auto scroll every 10seconds) Any help please Thank you I have this script from http://lampload.com/...,view.download/ (I am not using a database) I can upload images fine, I can view files, but I want to delete them. When I press the delete button, nothing happens
http://www.jayg.co.u...oad_gallery.php
<form>
<?php $dir = dirname(__FILENAME__)."/images/gallery" ; $files1 = scandir($dir); foreach($files1 as $file){ if(strlen($file) >=3){ $foil = strstr($file, 'jpg'); // As of PHP 5.3.0 $foil = $file; $pos = strpos($file, 'css'); if ($foil==true){ echo '<input type="checkbox" name="filenames[]" value="'.$foil.'" />'; echo "<img width='130' height='38' src='images/gallery/$file' /><br/>"; // for live host //echo "<img width='130' height='38' src='/ABOOK/SORTING/gallery-dynamic/images/gallery/ $file' /><br/>"; } } }?> <input type="submit" name="mysubmit2" value="Delete"> </form>
any ideas please?
thanks
Hi guys I just want to know something. With php you can handle excel files by saving them as .csv files. Then the php script reads it line by line, and commas separating the fields. But is it possible that I can insert an image (small jpg or png) file in one of these fields...and then handle the image in the php script? Just for intrest I inserted an image in excel worksheet and it did not insert it into a cell, it float. Is there maybe another to insert it in the cell and then control it with php?? Thanx in advance Hey every i'm just trying to change my 'Read More' text after a blog post on my site into am image. Got some code that lets me change the actual text to something else, just can't find how to change the text into an image. Code: [Select] add_filter( 'the_content_more_link', 'child_content_more_link', 10, 2 ); function child_content_more_link( $more_link, $more_link_text ) { return str_replace( $more_link_text, 'my new read more text', $more_link ); } Thanks, Matty44m Ok, I have a GD image that is then rewrote as a png. My question is, is it possible to find out what site is requesting the image and then use it on the php image. Example, if I didn't want a domain to use my images, could I somehow me able to restirict that site? I am absolutley stumped with this: im trying to have PHP get the size of an image that has been uploaded to mySQL, and return it to a certain size, lets say 200X200px. The problems im having to finding an existing script to help me understand - and then fit it into a table? All the help from google searches seem to suggest using software, but i would like to learn how to do this properly. First off the upload script: Code: [Select] <?php error_reporting(E_ALL); ini_set("display_errors", 1); echo '<pre>' . print_r($_FILES, true) . '</pre>'; //This is the directory where images will be saved $target = "/home/users/web/b109/ipg.removalspacecom/images/COMPANIES"; $target = $target . basename( $_FILES['upload']['name']); //This gets all the other information from the form $company_name=$_POST['company_name']; $basicpackage_description=$_POST['basicpackage_description']; $location=$_POST['location']; $postcode=$_POST['postcode']; $upload=($_FILES['upload']['name']); // Connects to your Database mysql_connect("server", "user", "password") or die(mysql_error()) ; mysql_select_db("removalspacelogin") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO `Companies` (company_name, basicpackage_description, location, postcode, upload) VALUES ('$company_name', '$basicpackage_description', '$location', '$postcode', '$upload')") ; echo mysql_error(); //Writes the photo to the server if(move_uploaded_file($_FILES['upload']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['upload']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } ?> this works great, it uploads the users pictures. This displays them out: Code: [Select] <?php $database="removalspacelogin"; mysql_connect ("server", "user", "password"); @mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query( "SELECT company_name, location, postcode, basicpackage_description, premiumuser_description, upload FROM Companies" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "\n\n\nThere are $num_rows records.<P>"; echo "<table><tr><th>Comppany Name</th><th>Location</th><th>Postcode</th><th>Basic Members</th><th>Upgraded Users</th><th>Company Logo</th></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>";// store the records into $row array and loop through while ( $row = mysql_fetch_array( $result, MYSQL_ASSOC ) ) { // Print out the contents of the entry echo "<tr><td>{$row['company_name']}</td>"; echo "<td>{$row['location']}</td>"; echo "<td>{$row['postcode']}</td>"; echo "<td>{$row['basicpackage_description']}</td>"; echo "<td>{$row['premiumuser_description']}</td>"; echo "<td><img src=\"http://www.removalspace.com/images/COMPANIES{$row['upload']}\" alt=\"logo\" /></td></tr>";} echo "</table>"; ?> Right now all the information in my table is fine except the image coloumn, the images are all the same size as they went in, i'd like them to all be one size so there in a uniformed fashion. But need all the rest of the mySQL table displayed, so how does it fit into my script to display the table? Many thanks!??? Hi guys, i have a form that uploads a school photo. All i want to do is resize the image to its widest dimension of a width of 480 px and then obviously constrain the height. can anyone help me, ive tried to do this myself but when it comes to image properties i really struggle etc. heres my upload code. Code: [Select] <?php include("includes/connection.php"); // Where the file is going to be placed $schoolimage = "SchoolImages/"; //This path will be stored in the database as it does not contain the filename $currentdir = getcwd(); $path = $currentdir . '/' . $schoolimage; // Get the schoolid for the image and school linker table $schoolid = $_POST['schoolid']; //Get the school name $query = "SELECT * FROM school WHERE school_id = ".$schoolid; $result = mysql_query($query) or die("Error getting school details"); $row = mysql_fetch_assoc($result); $schoolname = $row['name']; //Use this path to store the path of the file in the database. $filepath = $schoolimage . $schoolname; //Create the folder if it does not already exist if(!file_exists('SchoolImages')) { if(mkdir('SchoolImages')) { echo 'Folder ' . 'SchoolImages' . ' created.'; } else { echo 'Error creating folder ' . 'SchoolImages'; } } //Store the folder for the course title. if(!file_exists( $filepath )) { if(mkdir( $filepath )) { echo 'Folder ' . $schoolname . ' created.'; } else { echo 'Error creating folder ' . $schoolname; } } // Where the file is going to be placed $target_path = $filepath; // Add the original filename to our target path. Result is "uploads/filename.extension" echo $target_path = $target_path . '/' . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; $filename = $_FILES['uploadedfile']['name']; //Store the filename, path other criteria in the database echo $query = "INSERT INTO image(image_id, name, path) VALUES(0, '$filename', '$filepath')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $imageid = mysql_insert_id(); //Store the filename, path other criteria in the database echo $query = "INSERT INTO image_school( image_id, school_id ) VALUES('$imageid', '$schoolid')"; //Perform the query $add = mysql_query($query, $conn) or die("Unable to add the image details to the database"); $message = 'Upload Successful'; } else { $message = 'There was an error uploading the file, please try again!'; } //Close the connection to the database mysql_close($conn); header("Location: add_school_photo_form.php? message={$message}&schoolid={$schoolid}"); //header("Location: add_school_photo_form.php? message=$message, schoolid=$schoolid"); exit(); ?> Id be eternially gratefull. Kind Regards Dean Ok I have finally got rid of my syntax errors with this upload script. Now im getting the error uploading your image. My folders are called project_files and project_thumbs. This is my script <?php $results = ""; error_reporting(E_ALL); ini_set("display_errors", 1); //Auto Thumbnail Function function create_thumbnail($source,$destination, $thumb_width) { $size = getimagesize($source); $width = $size[0]; $height = $size[1]; $x = 0; $y = 0; if($width> $height) { $x = ceil(($width - $height) / 2 ); $width = $height; } elseif($height> $width) { $y = ceil(($height - $width) / 2); $height = $width; } $new_image = imagecreatetruecolor($thumb_width,$thumb_width) or die('Cannot initialize new GD image stream'); $extension = get_image_extension($source); if($extension=='jpg' || $extension=='jpeg') $image = imagecreatefromjpeg($source); if($extension=='gif') $image = imagecreatefromgif($source); if($extension=='png') $image = imagecreatefrompng($source); imagecopyresampled($new_image,$image,0,0,$x,$y,$thumb_width, $thumb_width,$width,$height); if($extension=='jpg' || $extension=='jpeg') imagejpeg($new_image,$destination); if($extension=='gif') imagegif($new_image,$destination); if($extension=='png') imagepng($new_image,$destination); } //Get Extension Function function get_image_extension($name) { $name = strtolower($name); $i = strrpos($name,"."); if (!$i) { return ""; } $l = strlen($name) - $i; $extension = substr($name,$i+1,$l); return $extension; } //Random Name Function function random_name($length) { $characters = "abcdefghijklmnopqrstuvwxyz01234567890"; $name = ""; for ($i = 0; $i < $length; $i++) { $name .= $characters[mt_rand(0, strlen($characters) - 1)]; } return "image-".$name; } $images_location = "/project_files/"; $thumbs_location = "/project_thumbs/"; $thumb_width = "100"; $maximum_size = "5000000"; //Check And Save Image if($_POST) { if($_FILES['image']['name'] == ""){ $results = "Please select the image you would like to upload by clicking browse"; } else{ $size=filesize($_FILES['image']['tmp_name']); $filename = stripslashes($_FILES['image']['name']); $extension = get_image_extension($filename); if($size > $maximum_size) { $results = "Your file size exceeds the maximum file size!"; } else if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { $results = "Only the following extensions are allowed. 'jpg', 'jpeg', 'png', 'gif'."; } else { $image_random_name=random_name(15).".".$extension; $copy = @copy($_FILES['image']['tmp_name'], $images_location.$image_random_name); if (!$copy) { $results = "Error while uploadin your image! Please try again!"; } else{ create_thumbnail($images_location.$image_random_name,$thumbs_location.$image_random_name, $thumb_width); $results = "Your image has been uploaded!"; } } } } ?> and the form Code: [Select] <html> <head> <title>test</title> </head> <body> <?php echo $results; ?> <form action="#" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="5000000" /> <input type="file" name="image" /> <input type="submit" value="Upload Image" /> </form> </body> </html> Hi guys I have got this code here, giving quite a few errors and was wondering if anyone could help me sort it out, the script (should) run straight away just have to edit the database connect, I've tried manually creating the table and taking out the create table but when I try and upload an image I get these errors: Warning: move_uploaded_file(latest.img) [function.move-uploaded-file]: failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/php/image.php on line 23 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/Applications/XAMPP/xamppfiles/temp/php2lgspw' to 'latest.img' in /Applications/XAMPP/xamppfiles/htdocs/php/image.php on line 23 Warning: fopen(latest.img) [function.fopen]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/php/image.php on line 24 Warning: filesize() [function.filesize]: stat failed for latest.img in /Applications/XAMPP/xamppfiles/htdocs/php/image.php on line 25 Warning: fread() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/php/image.php on line 25 here is the code: Code: [Select] <?php // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("test"); // First run ONLY - need to create table by uncommenting this // Or with silent @ we can let it fail every subsequent time ;-) $q = < < <CREATE create table pix ( pid int primary key not null auto_increment, title text, imgdata longblob) CREATE; @mysql_query($q); // Insert any new image into database if ($_REQUEST[completed] == 1) { // Need to add - check for large upload. Otherwise the code // will just duplicate old file ;-) // ALSO - note that latest.img must be public write and in a // live appliaction should be in another (safe!) directory. move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img"); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); if (strlen($image) < 149000) { mysql_query ("insert into pix (title, imgdata) values (\"". $_REQUEST[whatsit]. "\", \"". $image. "\")"); } else { $errmsg = "Too large!"; } } // Find out about latest image $gotten = @mysql_query("select * from pix order by pid desc limit 1"); if ($row = @mysql_fetch_assoc($gotten)) { $title = htmlspecialchars($row[title]); $bytes = $row[imgdata]; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("../wellimg/ctco.jpg","rb"); $bytes = fread($instr,filesize("../wellimg/ctco.jpg")); } // If this is the image request, send out the image if ($_REQUEST[gim] == 1) { header("Content-type: image/jpeg"); print $bytes; exit (); } ?> <html><head> <title>Upload an image to a database</title> <body bgcolor=white><h2>Here's the latest picture</h2> <font color=red><?= $errmsg ?></font> <center><img src=?gim=1 width=144><br> <b><?= $title ?></center> <hr> <h2>Please upload a new picture and title</h2> <form enctype=multipart/form-data method=post> <input type=hidden name=MAX_FILE_SIZE value=150000> <input type=hidden name=completed value=1> Please choose an image to upload: <input type=file name=imagefile><br> Please enter the title of that pictu <input name=whatsit><br> then: <input type=submit></form><br> <hr> By Graham Ellis - graham@wellho.net </body> </html> Hi, There are 10 images in a folder called "Images". All images are named like 1.jpg, 2.jpg, 3.gif, 4.png, and so on... I am using these images on my website with this link: MyDomain.com/Images/1.jpg Now what i want to do is change the image every minute. from 1... to ...10 all images one by one, every minute... Link should remain same, but it should give different image every time. and if someone copies my link of image, it still gets changed every minute. i hope to get some help, better with some example code... Thanks! Hi all, while I was coding a script for my website something struck me which ive not really got an idea how to code it, but anyway, in my Database ive got a table which holds image URL's but how could I echo them out in PHP which will show the image? Not just the writing. Thanks for your help. I have a site where I need to have lets call it image1 displayed, then I want to change this image based on a php if statement, for instance: if $var == $var2 change the image ....blah blah so I was also going to have the names of my images stored in my database, i.e. image1.jpg and image2.jpg in my database. the image is in its own div tag set as the background image of the div tag if that makes any diference. Thanks So I am trying to display an image from a database (I know it's not the best idea but it's what I was told to do). Anyway I'm having problems displaying it. Here is the code for displaying the image. $cat = $_GET['cat']; include 'includes/openDbConn.php'; $sql = 'SELECT * FROM CushionsCategories WHERE CushionCategory = "'.$cat.'"'; echo $sql; $result = mysql_query($sql); echo '<table>'; while($val = mysql_fetch_assoc($result)){ $cush = 'SELECT * FROM Cushion WHERE SKU = "'.$val['CushionSKU'].'"'; echo $cush; $cushres = mysql_query($cush); $cushval = mysql_fetch_assoc; $img = 'SELECT * FROM Images WHERE SKU = "'.$val['CushionSKU'].'"'; echo $img; $imgres = mysql_query($img); $imgval = mysql_fetch_assoc($imgres); if( $i % 3 == 0 ) { echo '</tr><tr>'; } echo '<td><img src="image.php?sku='.$val['CushionSKU'].'" name="'.$imgval['FileName'].'" description="'.$imgval['Description'].'" /></td>'; } echo '</tr></table>'; and the page that gets the image: $sql = 'SELECT Image FROM Images WHERE SKU = "'.$sku.'"'; //echo $sql; $result = mysql_query($sql) or die("Invalid query: " . mysql_error()); // set the header for the image header("Content-type: image/jpeg"); echo mysql_result($result, 0); Thanks for any help in advance. please help me to solve this problem : when my client want to remove a record all the related images must be deleted with it ,is that possible?? Hi, I have a pretty simple application that allows my users to upload images and i'm able to succesfull upload images to a new dir to be outputted. But as to save on download time and server space is there a simple piece of code I can add to the below code that will resize every image on uploded to 460(w) x 300 (h) from my users Code: [Select] <?php if ((($_FILES["article_image"]["type"] == "image/gif") || ($_FILES["article_image"]["type"] == "image/jpeg") || ($_FILES["article_image"]["type"] == "image/pjpeg")) && ($_FILES["article_image"]["size"] < 5000000)) { move_uploaded_file($_FILES["article_image"]["tmp_name"], "images/" . $_FILES["article_image"]["name"]); } ?> Thanks in advance for any help and suggestions Hi I am trying to add an image to a pdf file created using tcpdf. Part of the code I have to date is: $pdf->AddPage(); // create some HTML content $htmlcontent = "<html> <strong>THIS IS AN EXAMPLE TITLE<br></strong> <p> This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens </p> <ol> <li>This is some example text for testing. <br> </li> <li>This is some example text for testing.</li> </ol> "; // output the HTML content $pdf->writeHTML($htmlcontent, true, 0, true, 0, ''); I have a logo which is in a folder and can be found at ../img/logo.png What I would like to do is have the image in the centre of the page before all of the text but whatever I've tried has failed. Any suggestions/answers would be much appreciated. Also I've failed at centering the title - any ideas on that. Many thanks. i have this script called view.php Code: [Select] <?php include 'db.inc'; $file = clean($file, 4); if (empty($file)) exit; if (!($connection = @ mysql_pconnect($hostName, $username, $password))) showerror(); if (!mysql_select_db("Php_test", $connection)) showerror(); $query = "SELECT mime, data FROM file WHERE id = $file"; if (!($result = @ mysql_query ($query,$connection))) showerror(); $data = @ mysql_fetch_array($result); if (!empty($data["data"])) { // Output the MIME header header("Content-Type: {$data["mime"]}"); // Output the image echo $data["data"]; } ?>after i have db.inc Code: [Select] <?php // These are the DBMS credentials $hostName = "localhost"; $username = "root"; $password = "oxioxi"; // Show an error and stop the script function showerror() { if (mysql_error()) die("Error " . mysql_errno() . " : " . mysql_error()); else die("Could not connect to the DBMS"); } // Secure the user data by escaping characters // and shortening the input string function clean($input, $maxlength) { $input = substr($input, 0, $maxlength); $input = EscapeShellCmd($input); return ($input); } ?>and i have my page witch part of it is this Code: [Select] <?php include 'db.inc'; $query = "SELECT id, name, mime FROM file"; if (!($connection = @ mysql_pconnect($hostName, $username, $password))) showerror(); if (!mysql_select_db("php_test", $connection)) showerror(); if (!($result = @ mysql_query ($query, $connection))) showerror(); ?> <h1>Image database</h1> <?php if ($row = @ mysql_fetch_array($result)) { ?> <table> <col span="1" align="right"> <tr> <th>Short description</th> <th>File type</th> <th>Image</th> </tr> <?php do { ?> <tr> <td><?php echo "{$row["name"]}";?></td> <td><?php echo "{$row["mime"]}";?></td> <td><?php echo "<img src=\"view.php?file={$row["id"]}\">";?></td> </tr> <?php } while ($row = @ mysql_fetch_array($result)); ?> </table> <?php } // if mysql_fetch_array() else echo "<h3>There are no images to display</h3>\n"; ?>i have do it right but for some reason it doesnt displays the pictures the type and the name are displayed normally but not the picture!! instead of them there are small icons of not existing pictures.. please i want help i really need to do it I'm creating a funeral home site and on the side of the page I would like to display the last 5 funeral obituaries that are in mySQL database (name and certain sized image (images are in "image" field) w/ a link to an "obituaries detail page for the individual deceased person"). I am able to do this successfully listing only the names....how can I list the image associated with the name? This is what I have so far: Code: [Select] <?php include("connect.php"); ?> Code: [Select] <?php $query = "SELECT id, deceased_name, deceased_date, DATE_FORMAT(deceased_date, '%M %D, %Y') as datetext"; $query .= " FROM scales_obits ORDER BY deceased_date DESC LIMIT 5"; $listings = mysql_query($query); if (!listings) { echo("<p>Error retrieving listings from lookup table<br>". "Error: " . mysql_error()); exit(); } echo("<table border=\"0\" width=\"100%\" class=\"obit\">"); while ($listing = mysql_fetch_array($listings)) { $deceased_name = $listing["deceased_name"]; $deceased_date = $listing["datetext"]; $id = $listing["id"]; echo("<tr><td width=\"100%\"><a href=\"obitdetail.php?id=".$id."\"><strong>".$deceased_name."</strong></a></td><td> </td>"); } echo("</table>"); ?> I had this page working fine where it retrieves a set of images from the database depending on what thumbnail was click on the previous page. Now I am trying to add an edit and delete button to each of the pictures and it will not display any of it now! This is the code I am using: Code: [Select] <?php $id = $_GET[id]; ?> <?php $max_items = 16; /* max number of news items to show */ require_once('config.php'); $db = mysql_connect (DB_HOST,DB_USER,DB_PASSWORD); if(!$db) { die('Failed to connect to server: ' . mysql_error()); } mysql_select_db (DB_DATABASE,$db); function displayNews($all = 0) { global $db, $max_items; if ($all2 == 0) { /* query for news up to $max_items */ $query13 = "SELECT image,id,description,projectcode,thumbnail " . "FROM project WHERE projectcode='$id' ORDER BY id DESC LIMIT $max_items"; } else { /* query for all news */ $query13 = "SELECT image,id,description,projectcode,thumbnail " . "FROM project WHERE projectcode='$id' ORDER BY id DESC"; } $result13 = mysql_query($query13) or print("<p>Error fetching entries from the database, error: " . "Statement: " . $query13 . "</p>" . mysql_error()); while ($row13 = mysql_fetch_array($result13)) { $title = htmlentities ($row13['description']); $news = nl2br (strip_tags ($row13['projectcode'], '<a><b><i><u>')); $image = $row13['image']; $thumbnail = $row13['thumbnail']; $id = $row13['id']; /* display the data */ echo "<div class='portfolioproject'>";?> <div class='boxgrid captionfull'> <a id="<?php echo $id ?>" class="example_group" href="images/gallery/<?php echo $image ?>" title="<?php echo $title ?>" rel="gallery"><img alt="" src="images/gallery/<?php echo $thumbnail ?>" width="122px" height="122px"</a> </a>} <?php //Check whether the session variable SESS_MEMBER_ID is present or not if(isset($_SESSION['SESS_MEMBER_ID']) || (!trim($_SESSION['SESS_MEMBER_ID']) == '')) { echo "<form class='editbtn' action='editportfolio.php' method='POST'>"; echo "<input type='hidden' name='idf' value='$id' />"; echo "<input src='images/editbtn.png' type='image' value='Edit' />"; echo "</form>"; echo "<form class='editbtn' action='deleteportfolio.php' method='POST'>"; echo "<input type='hidden' name='ide' value='$id' />"; echo "<input src='images/delbtn.png' type='image' value='Delete' />"; echo "</form>"; } else { echo ""; } echo "</div>"; } /* if not displaying all news, give a link to do so */ if ($all == 0) { echo "<div class='show_all'><a class='show' href=\"{$_SERVER['PHP_SELF']}" . "?action=all\">Show all</a></div>\n"; } } /* this is where the script decides what do do */ echo "\n"; switch($_GET['action']) { case 'all': displayNews(1); break; default: displayNews(); } echo "\n"; ?> <?php //Check whether the session variable SESS_MEMBER_ID is present or not if(isset($_SESSION['SESS_MEMBER_ID']) || (!trim($_SESSION['SESS_MEMBER_ID']) == '')) { echo "<span class='show_all'>"; echo "<a class='show' href='admincp.php'> Admin</a>"; echo "</span>"; echo "<span class='show_all'>"; echo "<a class='show' href='logout.php'> Logout</a>"; echo "</span>"; } else { echo ""; } ?> No error messages are displayed, only the 'show all' button, and the 'admin' and 'logout' buttons if signed in! Any help on this would be much appreciated! Thank you Martin |