PHP - File_exists Help Load Users Avatar & Blank Image
Hi ppl
got code problem cant get it show users avatar & blank avatar at same time not that good at php ppl. avatar box page Code: [Select] <style type="text/css"> #name_area{height:20px; padding:3px;}; </style> <script language="javascript"> <!-- function member_change(id){ <?php $allgames = mysql_query("SELECT * FROM games") or die (mysql_error()); $allgames_total = @mysql_num_rows($allgames); if($allgames_total!=0) { $i=0; while($i<$allgames_total) { ?> document.getElementById('<?php echo mysql_result($allgames, $i, 'game_id'); ?>').style.display = "none"; <?php $i++; } } ?> document.getElementById(id).style.display = "block"; } function show_name(name){ document.getElementById('name_area').innerHTML = name; } function hide_name(){ document.getElementById('name_area').innerHTML = ''; } //--> </script> <div style="text-align:left;"> Choose Squad: <select name="D1" onchange="member_change(this.options[this.selectedIndex].value)" class="standardforms"> <?php $allgames = mysql_query("SELECT * FROM games") or die (mysql_error()); $allgames_total = @mysql_num_rows($allgames); if($allgames_total!=0) { $i=0; while($i<$allgames_total) { $game = mysql_result($allgames, $i, 'game_title'); $members_total2 = mysql_num_rows(mysql_query("SELECT * FROM members WHERE game = '$game'")); if($members_total2!=0) { ?> <option value="<?php echo mysql_result($allgames, $i, 'game_id'); ?>"><?php echo mysql_result($allgames, $i, 'game_title'); ?></option> <?php } $i++; } } ?> </select><br /><br /> </div> <?php $allgames = mysql_query("SELECT * FROM games") or die (mysql_error()); $allgames_total = @mysql_num_rows($allgames); if($allgames_total!=0) { $i=0; while($i<$allgames_total) { $game = mysql_result($allgames, $i, 'game_title'); $members = mysql_query("SELECT * FROM members WHERE game = '$game'"); $members_total = @mysql_num_rows($members); if($allgames_total!=0) { ?> <div id="<?php echo mysql_result($allgames, $i, 'game_id'); ?>" style="display: block; text-align:left;"> <?php if($members_total!=0) { $d=0; while($d<$members_total) { ?> <a href="index.php?page=members&id=<?php echo mysql_result($members, $d, 'id'); ?>"><img onmouseover="show_name('<?php echo mysql_result($members, $d, 'username'); ?>')" onmouseout="hide_name()" src="user/<?php echo mysql_result($members, $d, 'avatar_link'); $filename = 'avatar_link'; if (file_exists($filename)) { echo "avatar_link"; } else { echo "avatars/blank.jpg"; } ?>" width="50" height="50" alt="<?php echo mysql_result($members, $d, 'username'); ?>" title="<?php echo mysql_result($members, $d, 'username'); ?>"/></a> <?php $d++; } } } echo "</div>"; $i++; } } ?> <div id="name_area"></div> Similar Tutorials Hi guys, im just trying to work out an app in my head and on paper. im just wondering.. when a user registers they can choose an Avatar 100px by 100px jpg, when they upload one would i then grab the file and store all Avatars in a avatar image folder and rename it to something like.. avatar[user_id].jpg and keep them all in the same folder. or would i crate a folder called users, each user gets their own folder with files like avatar.jpg and it finds the [user_id] folder and pulls the avatar out from that, or is there a more prefered method? cheers I need some help with my commenting system. at the moment the code is like this: <div id="pagepannel"> <div id="ptop_small">Comments</div> <div id="pbottom_small"> <p> <?php // if ($allow_comments == "no") { ?> </p> <p>No Posting comments here!!!</p> <p> </p> <p> </p> <p> <?php } else ?> </p> <p> <?php $sql = "SELECT comment_id, blog_id, posted_by, comment, stamp, email, type FROM jscrgaming_newscomments WHERE blog_id='$blog_id' ORDER BY comment_id DESC"; $result = mysql_query($sql) or die('Error : ' . mysql_error()); while(list($comment_id, $blog_id_co, $username, $comment, $stamp, $email, $type) = mysql_fetch_array($result, MYSQL_NUM)) { if ($type == 'user'){ ?> </p> <table width="95%" border="0" cellpadding="0" cellspacing="0" class="full_border"> <tr> <td width="75" id="avatar"></td> <td><span class="capitalize"><a href="userinfo.php?user=<? echo $username ?>"><strong><? echo $username ?></strong></a></span><strong> posted</strong>: <? echo stripslashes($comment) ?></td> </tr> <tr> <td colspan="2" bgcolor="#CAE4FF" class="date"><? echo $stamp ?> </td> </tr> </table> <p> </p> <p> <? } else{ ?> </p> <table width="95%" border="0" cellpadding="0" cellspacing="0" class="full_border"> <tr> <td><strong> <? echo $username ?>posted</strong>: <? echo stripslashes($comment) ?></td> </tr> <tr> <td bgcolor="#CAE4FF" class="smalltext"><? echo $stamp ?>:: User Was Guest</td> </tr> </table> <p> </p> <p> <? } }?> </p> <p> <?php // if ($allow_comments == "restricted") { /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){?> </p> <form id="form3" name="form3" method="post" action="user/admin/blog/comment_system/user.php"> <p> </p> <table width="95%" border="0" align="center" cellspacing="2" class="full_border"> <tr> <td colspan="2">You are commenting as <?php echo $session->username;?></td> </tr> <tr> <td width="75">Message</td> <td><textarea name="co_comment" cols="30" id="textfield10"></textarea></td> </tr> <tr> <td width="75"><span class="header"> <input name="co_username" type="hidden" id="co_username" value="<?php echo $session->username;?>" /> <input name="co_blog_id" type="hidden" id="co_blog_id" value="<?php echo $blog_id ?>" /> </span></td> <td><label> <input type="submit" class="blog_button" value=" Post " /> </label></td> </tr> <tr> <td> </td> <td class="smalltext">only 200 charaters can be used</td> </tr> </table> </form> <p> </p> <p> <? } else {?> </p> <p> </p> <table width="95%" border="0" align="center" cellspacing="2" class="full_border"> <tr> <td width="75"><span class="capitalize">Name</span></td> <td><label> <input name="textfield5" type="text" disabled="disabled" id="textfield5" size="35" /> </label></td> </tr> <tr> <td width="75">Email</td> <td><input name="textfield5" type="text" disabled="disabled" id="textfield6" size="35" /></td> </tr> <tr> <td width="75">Message</td> <td><textarea name="textfield5" cols="30" disabled="disabled" id="textfield7">You need to be logged in to comment.</textarea></td> </tr> <tr> <td width="75"> </td> <td><label> <input type="button" class="blog_button" value=" Post " /> </label></td> </tr> </table> <p> </p> <p> <?php } } else { if($session->logged_in){?> </p> <form id="form2" name="form2" method="post" action="user/admin/blog/comment_system/user.php"> <p> </p> <table width="95%" border="0" align="center" cellspacing="2" class="full_border"> <tr> <td colspan="2">You are commenting as <?php echo $session->username;?></td> </tr> <tr> <td width="75">Message</td> <td><textarea name="co_comment" cols="30" id="textfield8"></textarea></td> </tr> <tr> <td width="75"><input name="co_username" type="hidden" id="co_username" value="<?php echo $session->username;?>" /> <input name="co_blog_id" type="hidden" id="co_blog_id" value="<?php echo $blog_id ?>" /></td> <td><label> <input type="submit" class="blog_button" value=" Post " /> </label></td> </tr> <tr> <td> </td> <td><span class="smalltext">only 200 charaters can be used</span></td> </tr> </table> </form> <p> </p> <p> <? } else { ?> </p> <form id="form1" name="form1" method="post" action="user/admin/blog/comment_system/guest.php"> <p> </p> <table width="95%" border="0" align="center" cellspacing="2" class="full_border"> <tr> <td width="75"><span class="capitalize">Name</span></td> <td><label> <input name="co_username" type="text" id="co_username" size="35" /> </label></td> </tr> <tr> <td width="75">Email</td> <td><input name="guest_email" type="text" id="guest_email" size="35" /></td> </tr> <tr> <td width="75">Message</td> <td><textarea name="co_comment" cols="30" id="co_comment"></textarea></td> </tr> <tr> <td width="75">Spam</td> <td> </td> </tr> <tr> <td colspan="2" align="center"><? require_once('user/captcha/recaptchalib.php'); $publickey = "6Ld_W7sSAAAAAPNTLWrUJLEClFpSSPu1d1Ry5zNR"; // you got this from the signup page echo recaptcha_get_html($publickey); ?></td> </tr> <tr> <td colspan="2" align="right"><span class="smalltext">only 200 charaters can be used</span> <input name="co_blog_id" type="hidden" id="co_blog_id" value="<?php echo $blog_id ?>" /> <input type="submit" class="blog_button" value=" Post " /></td> </tr> </table> </form> <p> </p> <p> <? } } ?> </p> <p> </p> <div></div> </div> </div> I, know its a bit messy but lets me see it and design it in Dreamweaver Any way, for the comment system for users, I want it to show their avatar as well, which is stored in the users table. How would one do this. I did think of it submitting the avatar along with the post but then it wouldnt update if the user would to change their avatars :\ Any helps??? (last question for this project...!) This code loads and image from a URL stored in a database. Some of the results pages wont have an image stored in them and I don't want it to load the "image not found" icon. Therefore I have uploaded a transparent .gif file and would like that to load if no result was found in the database. I am using IF and ELSE but this doesn't seem to work correctly - Can anyone advise on what I am doing wrong please. Thanks <?php $van_query = "SELECT Image_Van FROM products WHERE Car_Make= '$strMake' AND Car_Model = '$strModel'"; // the result of the query $van_result = mysql_query($van_query) or die("Invalid query: " .mysql_error()); $pic = mysql_fetch_array($van_result); // show the image if ($van_query !== "") echo "<img src='images/product_images/".$pic['Image_Van']."'/>"; else echo "<img src=\"images/transparent.gif/>"; ?> people on my forum (speakwhatsreal.com) submitting blank spaces Code: [Select] like they just copy/paste the blank space in the textarea and how do I check input on that, does strlen work? Hey guys I have this script that edits a users profile, but the problem is that it doesnt want to upload it to the server and keeps saying. Files must be either JPEG, GIF, or PNG and less than 10,000 kb <?php if(empty($_GET['id']) ) { echo 'Category not specified'; } else { mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("chat"); $result = mysql_query("SELECT * FROM users WHERE user_id = '$_GET[id]'"); $query = mysql_fetch_array($result); if (isset($_POST['submit'])) { $target = "mainnewsimg/"; $target = $target . basename( $_FILES['photo']['name']); // Set global variables to easier names $pic=($_FILES['photo']['name']); if (($_FILES["photo"]["type"] == "image/gif") || ($_FILES["photo"]["type"] == "image/jpeg") || ($_FILES["photo"]["type"] == "image/png" ) && ($_FILES["photo"]["size"] < 10000)) { if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { mysql_query("UPDATE users SET level ='". $_POST['rank'] ."', email='". $_POST['email'] ."', fname='". $_POST['fname'] ."', lname='". $_POST['lname'] ."', avatar='$pic' WHERE user_id='". $_GET['id'] ."' "); echo "user updated"; } else { echo "file hasent been moved to uploads"; } } else { echo "Files must be either JPEG, GIF, or PNG and less than 10,000 kb"; } //mysql_query("UPDATE Persons SET level = '36'WHERE user_id = '$_GET[id]'"); } ?> <?php echo $query['username']; ?> <form method="post" action=""> <table> <tbody> <tr><td class="first"></td> <td><?php echo $query['user_id']; ?></td></tr> <tr><td class="first">First Name</td> <td><input type="text" name="fname" value="<?php echo $query['fname']; ?>" ></td></tr> <tr><td class="first">Last Name</td> <td><input type="text" name="lname" value="<?php echo $query['lname']; ?>" ></td></tr> <tr><td class="first">Email</td> <td><input type="text" name="email" value="<?php echo $query['email']; ?>" ></td></tr> <tr><td class="first">Rank</td> <td><select name="rank"> <option value="0" <?php if($query['level']=="0") { echo "selected"; }?>>Unactivated</option> <option value="1" <?php if($query['level']=="1") { echo "selected"; }?>>Banned</option> <option value="2" <?php if($query['level']=="2") { echo "selected"; }?>>Regular User</option> <option value="3" <?php if($query['level']=="3") { echo "selected"; }?>>Donator</option> <option value="4" <?php if($query['level']=="4") { echo "selected"; }?>>Moderator</option> <option value="5" <?php if($query['level']=="5") { echo "selected"; }?>>Administrator</option> <option value="6" <?php if($query['level']=="6") { echo "selected"; }?>>Owner</option> </select> </td></tr> <tr><td class="first">User Avatar</td> <td><input type="file" name="photo"></td></tr> <tr><td class="first">Joined on</td> <td><input type="text" name="join" value="<?php echo date('d-F-Y',($query['join_date'])); ?>" disabled="disabled"></td></tr> <tr><td class="first">Last Access</td> <td><input type="text" name="access" value="" disabled="disabled"></td></tr> <tr><td></td> <td> <input type="submit" name="submit" value="Edit User"> </td></tr> </tbody></table> </form> <?php } ?> Hi guys I am trying to use image magick with php to draw an image but when i run the script it doens't show anything. All I get is an a blank page. Does anyone know if I am doing this right. Here is my code. Code: [Select] <?php echo "<pre>"; system("type convert"); echo "</pre>"; ?> <br /> <br /> <br /> <br /> <br /> <?php exec("/usr/bin/convert -size 200x200 xc:black -stroke black -strokewidth 1 \\ -fill white -draw \"circle 100,100 100,10 \" \\ -fill black -draw \"circle 100,100 100,30 \" \\ -fill blue -draw \"circle 100,100 100,50 \" \\ -fill red -draw \"circle 100,100 100,70 \" \\ -fill yellow -draw \"circle 100,100 100,90 \" \\ -fill none -draw \"circle 100,100 100,20 \" \\ -fill none -draw \"circle 100,100 100,60 \" \\ -fill none -draw \"circle 100,100 100,80 \" \\ -fill none -draw \"circle 100,100 100,95 \" \\ -stroke white -fill none \\ -draw \"circle 100,100 100,40 \" circle.png"); ?> My results are these: convert is /usr/bin/convert I really need some help with this. I haven't been able to find anything online. Hi everyone, I need some help. I have made a comment system, where users have to be logged in to post their comments. I am stuck at displaying an avatar for each user. What I am trying to do is, there is a table for users login details and their avatar than there is a table for comments. I would like to do is take the users avatar from the login table and post it in the comments table, when the user comments, so I can echo different avatars, depending on who commented, if there is a different more simpler way I would like to know it. Thanks in advance. Hi, Im creating a facebook app and I want to be able to grab the users full size profile picture and save it locally. Apparently you can do it with this code : Code: [Select] <script> FB.api('/me/albums', function(response) { for (album in response.data) { if (response.data[album].name == "Profile Pictures") { FB.api(response.data[album].id + "/photos", function(response) { image = response.data[0].images[0].source; }); } } }); </script> Sorry if this is a stupid question but how would I echo out the image path after funning that ? Im only used to working with php. Thanks, Scott. Hello
I am trying to work out how many regular users I have to my site and how long those users tend to be users..
So, I have a table that logs every time a user visits my site and logs in, it stores the date / time as a unix timestamp and it logs their user id.
I started by getting the id's of any user who logs in more than 5 times in a specified period, but now I want to extend that...
SELECT userID as user, count(userID) as logins FROM login_history where timestamp > UNIX_TIMESTAMP('2014-06-01 00:00:00') and timestamp < UNIX_TIMESTAMP('2014-07-01 00:00:00') group by user having logins > 5; Hi i have a chat written in php and as3 at the moment the chat window shows username and message but i want to add a avatar before the username. here is the code i have. $sql = mysql_query("SELECT * FROM chat75 ORDER BY date_time ASC"); while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $user_name = $row["user_name"]; $chat_body = $row["chat_body"]; $num = $row["avatar"]; $date_time = $row["date_time"]; $chat_body = stripslashes($chat_body); $chat_body = eregi_replace("'", "'", $chat_body); $string =array(); $files = glob("../images/avs/*.*"); for ($i=1; $i<count($files); $i++) { $num = $files[$i]; } $body .= '<b><font color="#006699">' . $num . ': ' . $user_name . ': <font color="#000000"> ' . $chat_body . '</font> <br />'; } this is what i get in the chat window ../images/avs/avatar9.png: demo123: testing message i have tried everything to get the avatar to appear in the chat window but keep getting the above,i have tried to put echo in front but then just get a blank chat window. please help thanks I am trying to do a loop which uses file_exists to check if an image exists and if so display it using the following code: <?php $i = 1; while ($i <= 8) { $filename = $img_loc . "/hovers-800px/" . $image . "-" . $i . ".jpg"; if (file_exists($filename)) { ?> <a class="fuglybox" rel="gxr" href="<?php echo $filename; ?>"> <!--Main thumbnail image--> <img src="<?php echo $img_loc; ?>/product-detail-90px/<?php $image . "-" . $i . ".jpg"; ?>" alt="" width="90" height="90" /></a> <?php } $i++; } ?> I have echoed out $filename to check my directory structure and filename is fine and copied the echoed directory out. The structure is however http://Http://www.xxxxxx.com/img/filename.jpg. Could this be whats causing the problem? <code> $jpg_path = '../../../users/user_avatars/' . $_SESSION['the_user'] . '.jpg'; $jpeg_path = '../../../users/user_avatars/' . $_SESSION['the_user'] . '.jpeg'; $gif_path = '../../../users/user_avatars/' . $_SESSION['the_user'] . '.gif'; $png_path = '../../../users/user_avatars/' . $_SESSION['the_user'] . '.png'; $jpg_test = file_exists($jpg_path); $jpeg_test = file_exists($jpeg_path); $gif_test = file_exists($gif_path); $png_test = file_exists($png_path); </code> the path is EXACTLY correct I've checked and rechecked and everything. echoed the path and everything else that is relevant. but later when I call if ($png_test == '1') { blah blah blah } it won't return 1. even though I KNOW that the picture is there and it is at that path. if i echo the path in a src for an image it appears. hmm? I've read as many previous posts as I can find and tried all the suggested solutions but the following simple test code will not work for me (the session variable has been echoed and is correct). Instead of echoing the correct answer, the if(file_exists($target_file)) skips the true result and always displays the false one. I've tested it with files that do and don't exist of course. Here is the code :- $filename = $_SESSION["filename"]; $target_file = $_SERVER['CONTEXT_DOCUMENT_ROOT'] . '/folder/' . $_SESSION["filename"]; if (file_exists($target_file)) { echo 'Selected file is ' . $filename . ' and will be written.'; } else { echo "Selected file " . $filename . " doesn't exist."; } I'd really appreciate any help on this please. Edited July 11, 2020 by oldceltI am getting the error message "Couldn't fetch mysqli on line 48". Here's the script: By the way the uploading of the first file does work, but the upload of the second file so it updates and refreshes with a new avatar file name does not work. Code: [Select] <?php // This file gets included into profile_content.php // AVATAR code define ('AVATAR_UPLOADPATH', 'avatar/'); define ('AVATAR_MAXFILESIZE', '32768'); // _UPLOAD_ and _MOVE_ avatar to target location - START if (isset($_POST['submit'])) { $avatar = $_FILES['avatar_upload']['name']; $avatar_type = $_FILES['avatar_upload']['type']; $avatar_size = $_FILES['avatar_upload']['size']; // file type + file size + file upload + width & height VALIDATION if ((($avatar_type == 'image/gif') || ($avatar_type == 'image/jpeg') || ($avatar_type == 'image/pjeg') || ($avatar_type == 'image/png') && ($avatar_size > 0) && ($avatar_size <= AVATAR_MAXFILESIZE))) { if ($_FILES['avatar_upload']['error'] == 0) { list($width, $height, $type, $attr) = getimagesize($_FILES['avatar_upload']['tmp_name']); if ($width == 64 && $height == 64) { // UPLOAD + MOVE //////////////////////// HERE IS THE LINE ///////////////////////////////////////////// // Update the file name $query3 = "UPDATE user SET avatar = '$avatar' WHERE user_id = '$user_id'"; $row3 = mysqli_query ($dbc, $query3) or die (mysqli_error($dbc)); // Move the uploaded file on the disk to its folder move_uploaded_file ($_FILES['avatar_upload']['tmp_name'], $target . $avatar); // Rename the file into a more usable file name $avatar = rename($avatar, $user_name . '_' . rand(111111, 999999)); // Success echo "Your avatar has been successfully uploaded. Please refresh the page to see the changes."; // error messages // width and height error } else { echo "Your avatar has to have a width and height of 64 pixels, please crop it or use a different avatar."; } // file upload error } else { echo "Error: " . $_FILES['avatar_upload']['error']; } // file type error } else { echo "The avatar must be a GIF, JPEG or PNG image file and no greater than " . AVATAR_MAXFILESIZE / 1024 . " KB in size."; } } // END ?> Any ideas why I am getting the error message. I marked the corresponding line with ///// HERE IS THE LINE //// in the mid area. I want to get suggested keywords from yahoo api service. When xml file is empty (no keyword), it gives error. To resolve this problem I used this code: if (file_exists('http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=YahooDemo&query=Madonna&results=2')) { $xmlmetades = simplexml_load_file('http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=YahooDemo&query=Madonna&results=2'); } Since it is not a normal .xml file, it is always considered no file, and return nothing. Hello all, I am a real newby to this but need some help with a file_exists / while loop issue i have. I am trying to show a table of pictures (with their own ID's) but also if someone hasn't uploaded a picture to the server a default picture will be shown instead. I get the error: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/thefrien/public_html/members1.php on line 103 Here is my code: $i = 1; echo "<table border='1' align='center'><tr>"; $result = mysql_query( "SELECT * FROM membership order by L_ID asc" ); while ( $row = mysql_fetch_assoc( $result ) ) { echo "<td align='center' bgcolor='#DDDEFF'><a href='profile_view.php?L_ID=".$row["L_ID"] ."'>" $pic = 'images/avatar/'. $row["L_ID"] .'s.jpg'; if (file_exists($pic)) { echo '<img src=http://www.thefriendzconnection.co.uk/images/avatar/'.$row["L_ID"] ."s.jpg>"; } else { echo '<img src=http://www.thefriendzconnection.co.uk/images/0s.jpg border='0'>'; } "</a> <br><font size='1' face='Arial, Helvetica, sans-serif'>".$row["name"] ."</font> <br><font size='1' face='Arial, Helvetica, sans-serif'>ID: ".$row["L_ID"] ."</font> <br> </td>"; if ( $i % 6 == 0 ) { echo "</tr><tr>"; } $i++; } mysql_free_result( $result ); echo "</tr></table>"; The line I am having issues with seems to be: $pic = 'images/avatar/'. $row["L_ID"] .'s.jpg'; Any suggestions would be greatfully received Thanks. Hi, I am trying to verify if the given url exists or not, by using file_exists() function. It always returns 'FALSE' , according to my understanding it happening because the file to be checked on the given url is located in safe mode. Could anyone please suggest as to how this could be overcome, by similar function or by using alternative method. Regards Abhishek Madhani I'm just trying to find out if php has the ability to check if any file exists, with only part of the filename given.. I have this path: if (file_exists($dir.'/'.$c_file.'/templ_*')) { I added a little star.. That star represents whatever the rest of that file is named for this example.. It could be anything.. So can php match any files that start with "templ_", and say that it does or does not exist?? Thanks I'm showcasing user avatars and nicknames on the page, the mistake I did was I used session variables for that which are being set after login, now obviously those will be deleted as soon as the session is over. So I thought of inserting the values into scalar variables instead of session variables. The problem I'm encountering is, how to make those variables available at the necessary spots on other pages? Let's say I fetch data off the database after login inside login.php and I put the data into scalar variables, what would be common practice to make those scalar variables accessible in index.php? Is this solution a good solution at all to make the avatar and nickname of the user permanent visible? What would be common practice? I'm working on a WordPress theme and I'm trying to build in a simple if statement which will check if the user has add his own logo into the images folder if he doesn't then the name of the blog will appear as normal text in place of the graphic logo. This is how it looks like: <?php $logo_dir = get_template_directory_uri() . "/images/logo.png"; if (file_exists($logo_dir)) { ?> <li><img src="<?php bloginfo ('template_directory'); ?>/images/logo.png" alt="<?php bloginfo('description'); ?>" /></li> <?php } else { ?> <li id='blog_name'><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?><font>*</font></a></li> <?php } ?> I've echo'd out $logo_dir, the URL is correct, but still for some reason it's seeing it as if there would no file exist. If I turn it around into !file_exists then the graphic logo WILL show up. So it's always seeing it as non-existent. Any ideas why this could be or am I using this function in a wrong fashion? As far as I've understood the PHP manual, this is the correct way of using it. |