473,327 Members | 2,118 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,327 software developers and data experts.

Weirdest PHP problem of all time?!

[PHP]
print_r("2hasResult = $hasResult<P>");

/*---------------------------------------------------------------------------------------------------------------------------------------------------------
Block to determine metadata. If you are coming from DownloadView
or RemoveView you will have to have
a database instance to generate proper metadata for display,
however, coming from CreateView or ResizeView you
will not have any database instance, so metadata will be limited
and derived from the image source itself.
-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
$imageURL = ($album) ? "$imageURLPath/$album" : $imageURLPath;

print_r("3hasResult = $hasResult<P>");

[/PHP]

At no time are any of the variables even remotely related to one
another, but watch this:

2hasResult =

3hasResult = /catalog/images/awards_2004
For some wacko reason $hasResult = $imageURL! I have never even used
reference pointers for any of these variables, how is that possible?

Thanx
Phil
Jul 17 '05 #1
4 1287
Phil Powell wrote:
[PHP]
print_r("2hasResult = $hasResult<P>");

/*---------------------------------------------------------------------------------------------------------------------------------------------------------
Block to determine metadata. If you are coming from DownloadView
or RemoveView you will have to have
a database instance to generate proper metadata for display,
however, coming from CreateView or ResizeView you
will not have any database instance, so metadata will be limited
and derived from the image source itself.
-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
$imageURL = ($album) ? "$imageURLPath/$album" : $imageURLPath;

print_r("3hasResult = $hasResult<P>");

[/PHP]

At no time are any of the variables even remotely related to one
another, but watch this:

> 2hasResult =

3hasResult = /catalog/images/awards_2004

For some wacko reason $hasResult = $imageURL! I have never even used
reference pointers for any of these variables, how is that possible?

Thanx
Phil


I am a PHP newbie.... but if I were trying to fix this, I might change this:
$imageURL = ($album)
....to this:
($imageURL == $album)

Jul 17 '05 #2
.oO(Westcoast Sheri)
I am a PHP newbie.... but if I were trying to fix this, I might change this:
$imageURL = ($album)
...to this:
($imageURL == $album)


Nope, it wasn't a comparison, it was an assignment using a ternary
operator.

The posted code looks correct, I guess the problem is somewhere in the
parts that were not posted.

Micha
Jul 17 '05 #3
On Sat, 24 Jul 2004 13:38:03 +0000, Westcoast Sheri wrote:
I am a PHP newbie.... but if I were trying to fix this, I might change this:
$imageURL = ($album)
...to this:
($imageURL == $album)

$imageURL = ($album) ? "$imageURLPath/$album" : $imageURLPath;
is the same as writing:
if ($album) {
$imageURL = "$imageURLPath/$album";
} else {
$imageURL = $imageURLPath;
}
and outlines perhaps more clearly being new, why it's as assignment rather
than a comparison.

Welcome to PHP =)

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #4
I noticed that Message-ID:
<pa****************************@bubbleboy.digiserv .net> from Ian.H
contained the following:
$imageURL = ($album) ? "$imageURLPath/$album" : $imageURLPath;
is the same as writing:
if ($album) {
$imageURL = "$imageURLPath/$album";
} else {
$imageURL = $imageURLPath;
}

Wouldn't both generate a notice? Does it matter?
--
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 17 '05 #5

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

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
9
by: syd | last post by:
I don't even know where to begin. This is just bizarre. I just picked up the Gnuplot.py module (a light interface to gnuplot commands) and was messing around with it today. I've got a tiny...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
4
by: Andrew Poulos | last post by:
How do I convert a length of time, measured in seconds, into a "point in time" type time interval or what's represented as: time (second,10,2) The format is: PS]] where: y: The number of...
8
by: peterbe | last post by:
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: cournape | last post by:
Hi there, I have some scientific application written in python. There is a good deal of list processing, but also some "simple" computation such as basic linear algebra involved. I would like to...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.