473,385 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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($filename)) {
} else {
$t->assign('sitethumbs', $filename);
}
/////end////////////

then I have a file called viewprofile.html which uses the profile.php with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.jpg" 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 4777
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($filename)) {
} else {
$t->assign('sitethumbs', $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.html which uses the profile.php with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.jpg" 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.com> 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($filename)) {
} else {
$t->assign('sitethumbs', $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.html which uses the profile.php
with
smarty templates so in this file I use
{if ($sitethumbs)}
<img src="members/sitethumbs/thumbs/{$user.login}.jpg" 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
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...
2
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...
15
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....
8
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 -------------------------------------------------------------------------------- ...
1
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...
5
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...
0
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...
4
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...
9
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.