473,471 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Gif based counter

I am having trouble using a very simple, modifed script from this
address:
http://www.weberdev.com/ViewArticle/...-PHP-and-MySQL

The script outputs an image with an incorrect file name. For example.
"http://www.debatron.com/numbers/.gif" Notice the file name is
only partially there. It should be pulling out something like
"1.gif" for a picture of the number 1 etc.

Below is the code I am using. The segment that prints the gif sequence
is at the end. I took alot out, but we are in a large while loop that
is grabbing alot of stuff from mysql. You might have to ignore some of
the code, but I put some in, just in case thats whats screwing it up.
//Grabs $noyes string from mysql data base? (there is more mysql/php
code above this that my progammer was doing in a while loop. Only
$noyes variable is important)

$sqlyes = "Select * from db_debateresponse where db_debate_iddebate =
". MYSQL_RESULT($result,$i,"iddebate") . " and responsetype=0";

$resyes = MYSQL_QUERY($sqlyes);
$noyes = MYSQL_NUMROWS($resyes);

$sqlno = "Select * from db_debateresponse where db_debate_iddebate =
". MYSQL_RESULT($result,$i,"iddebate") . " and responsetype=1";

$resno= MYSQL_QUERY($sqlno);
$noNo = MYSQL_NUMROWS($resno);
//configuring variables for the gif counter

$numurl = 'http://www.debatron.com/numbers/';
$fileending = '.gif';
//Prints the number from $noyes back out as gif image sequence

for ($l = 0; $l < strlen($noyes); $l++) {
echo "<img src=\"$numurl$noyes[$l]$fileending\">";
}

Jul 25 '07 #1
3 1442
Message-ID: <11*********************@19g2000hsx.googlegroups.c omfrom
Allan Drake contained the following:
>echo "<img src=\"$numurl$noyes[$l]$fileending\">";
$noyes probably contains a number, not a string.

Try adding

settype($noyes,"string");
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 25 '07 #2
$noyes probably contains a number, not a string.

Try adding

settype($noyes,"string");

Thanks you were right. I found strval($noyes) to work great for my
puproses :) Its always the little things that catch me up.

Jul 25 '07 #3
On Jul 25, 2:34 pm, Allan Drake <superc...@chartermi.netwrote:
$noyes probably contains a number, not a string.
Try adding
settype($noyes,"string");

Thanks you were right. I found strval($noyes) to work great for my
puproses :) Its always the little things that catch me up.
Take a look to http://www.webrickco.com. i have a file based counter
with images there. You can access the code and see.

Jul 25 '07 #4

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

Similar topics

18
by: deko | last post by:
I have a counter file that records page hits - each hit is a UNIX timestamp in the file. But I'm only interested in page hits in the last 365 days. The below code creates an array from the file...
28
by: Paul Rubin | last post by:
http://www.nightsong.com/phr/python/sharandom.c This is intended to be less predicable/have fewer correlations than the default Mersenne Twister or Wichmann-Hill generators. Comments are...
4
by: Tan Thuan Seah | last post by:
Hi all, I am currently coding a sparse factorization program for my project. I intend to make a comparison of the column based method and multifrontal method in terms of running time, but I am...
1
by: Andrew | last post by:
I am looking for a simple JavaScript program that would redirect users to one of two web pages based on the web page counter. For example, when the counter is odd, the user would be redirected to...
4
by: Larry R | last post by:
I am trying to use XPath (XSLT 1.0), EXSLT 1.1 (.Net) to select the nodelist consisting of the 'top n' nodes. THe counter is the count of item/value. Using a traditional for-each logic, the...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
1
by: senger.kim | last post by:
Hello World, I'm relatively new to MS Access (2003) and am trying to implement something that I feel should be simple but cannot find a solution. Hoping that you can help me or point me where to...
2
by: hash4sp | last post by:
I have just started my career in programming. My Problem is reading a text file using VB.NET. The text contains the state names followed by respective city names. My task is to read the file and...
0
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...
0
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.