473,545 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help check if file exist and repond accordingly

JD
What im trying to do is something like this maybe in my profile.php file
//site thumbnail check////////////
$filename = "sitethumbs/".$user['login'].".jpg";
if (file_exists($f ilename)) {
} else {
$t->assign('siteth umbs', $filename);
}
/////end////////////

then I have a file called viewprofile.htm l which uses the profile.php with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.j pg" border="0"
width="145" alt="Visit {$user.login}'s website">
{/if}

Basicly in the template file it is always showing ($sitethumbs)
Jul 17 '05 #1
2 4786
JD wrote:
What im trying to do is something like this maybe in my profile.php file
//site thumbnail check////////////
$filename = "sitethumbs/".$user['login'].".jpg";
if (file_exists($f ilename)) {
} else {
$t->assign('siteth umbs', $filename);
}
/////end////////////
I think you are doing it unexpectedly... you are asking for the
sitethumbs to be set when the file does not exist? Shouldn't it be the
otherway around?

then I have a file called viewprofile.htm l which uses the profile.php with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.j pg" border="0"
width="145" alt="Visit {$user.login}'s website">
{/if}

Basicly in the template file it is always showing ($sitethumbs)

Jul 17 '05 #2
JD
I want it set if the sitethumbs exist, just don't know the proper way to do
it

"Mike Willbanks" <pe****@gmail.c om> wrote in message
news:LK******** *********@fe03. lga...
JD wrote:
What im trying to do is something like this maybe in my profile.php file
//site thumbnail check////////////
$filename = "sitethumbs/".$user['login'].".jpg";
if (file_exists($f ilename)) {
} else {
$t->assign('siteth umbs', $filename);
}
/////end////////////


I think you are doing it unexpectedly... you are asking for the sitethumbs
to be set when the file does not exist? Shouldn't it be the otherway
around?

then I have a file called viewprofile.htm l which uses the profile.php
with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.j pg" border="0"
width="145" alt="Visit {$user.login}'s website">
{/if}

Basicly in the template file it is always showing ($sitethumbs)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2322
by: GAR | last post by:
I recently set up ampache so I can have an mp3 server. I dont like how they display album covers so I decided to try and change it a little. Instead of taking the album cover from the mp3s themselves I want it to just have a file called 'cover.jpg' in the album's direcory where when someone looks at the album the web browser will display...
2
3911
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in...
15
11759
by: Rex_chaos | last post by:
I am a c programmer and new to C++. In C, I am familiar with some operations on file. Now when shifting from c to c++, using iostream, I have no idea how to perform the following operations 1. check if a file or directory exists or not 2. delete all the files under a given directory 3. rename
8
5455
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
1
4465
by: Jo | last post by:
I am having a real problem with the Launch conditions in VS .NET and can only come to the conclusion that it is a bug. It states quite emphatically in the MSDN that Launch Conditions WILL be executed in the order added. This statement holds true if every Condition has a InstallURL value set. but not if there is no InstallURL value. For...
5
2044
by: Bo Peng | last post by:
Dear list, I have not done a thorough test, but it occurs to me that 1. python code can be interrupted by Ctrl-C. 2. A C module, if I add a main() function and run independently, can be interrupted by Ctrl-C. 3. If I load the C module in python and run, the program will not respond to Ctrl-C interruption. I have to kill python explicitly.
0
5532
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
4
2206
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I wanted to move my work and needed to place it on the server. Using VS 2005 , went to BUILD -Publish Web Site Checked the box for :: Alow this...
9
2488
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But *after* calling increase_arrays(), I received segmentation fault. I tried to step it through gdb, and I found out that after calling...
0
7473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7408
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7661
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7763
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5340
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
712
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.