I want to make a very simple form which asks for a starting city/state
and an ending city/state. When the user hits submit, the number of miles
from city A to City B is displayed ... no directions, no maps, no exact
locations .. just the milage. Can I use mapquest to do this? how? Is
there anoth
Can I use php to get a list of all the jpgs in a folder? I want to make a
photo album type thing for a website, and I want it to be real simple (i.e.
you put photos (jpgs) in a folder called photos and upload them. Then the
album is built dynamically using php. Thoughts?
--
PHP General Mail
Is there a += equivilant for strings??
$string = "Hello";
$string += "world.";
I know that
$string = $string." world.";
would work, but I keep having to do it. Is there a shortcut?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
what am i missing here?? I have a simple if statement that wont do whats
inside it even when true.
this works:
echo $key==$info_keys[0]; // returns 1 or 0 correctly
if($key==$info_keys[0])
$query = $query;
else $query = $query." and ";
$query = $query.$key."='".$va
aha!! array_keys !!!
"Brian V Bonini" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Off teeh top of my novice head I think count() or sizeof() is what your
> looking for.
>
> > -Original Message-
> >
But what about the first position??
-Original Message-
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 5:37 PM
To: Alexander Ross; [EMAIL PROTECTED]
Subject: RE: [PHP] assoc array question
Off teeh top of my novice head I think count() or sizeof() is
I have this: (note that $info is an Assoc Array
while (list ($key, $val) = each ($info))
{
do stuff
}
I would like to do slightly different stuff if I'm at the very first, or
very last item in the array. How do I do this. Below is the pseudo code
which would be ideal:
while (list ($key
What is wrong with the statement below? Am I using DEFAULT incorrectly?
That first column is an auto_incrementing column so i don't want any data to
get inserted there. Thanks for you help.
INSERT INTO cast VALUES(DEFAULT, 'Rick', 'Blaine', 'Humphrey', 'Bogart',
'male');
Thanks!
Alex
--
PH
If I have a string variable that is already of the form
('item','item2','item3') [including the parens and quotes in the string],
is there an easy way to change that variable into an array??
Array($var) doesn't work. Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
Say i have a variable $string_var = "Once upon a time";
is there a way to do this:
Switch($string_var)
{
case(contains "Once"):
doSomething();
break;
case(contains "the end.")
doOtherThing();
break;
case(contains "time")
doNothing();
break;
default:
echo "ERROR"
}
So is there any way to accomplish what I want to using php without
naming the files *.php??
-Original Message-
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 10:11 AM
To: Alexander Ross; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: including a php file in an
es the code (because it knows how to execute JavaScript).
>
> What you should do would be write
>
> instead of "
> Bogdan
>
> Alexander Ross wrote:
> > I have a .php file whose purpose, ultimately, is to set one variable;
> > $hotspot. Now I want to include t
I have a .php file whose purpose, ultimately, is to set one variable;
$hotspot. Now I want to include that var in a bunch of places in my html
page (it must remain html). So this was my thought. In the include
the following:
and then anywhere in the html doc I want to print the value of $ho
p.s. alert is a simple function I wrote to call a javascript alert window.
"Alexander Ross" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This may be kids play for some of you, but I figured this out and thought
> I'd sh
This may be kids play for some of you, but I figured this out and thought
I'd share...
$connect = connect-to-db() or (alert("error") xor die());
or
$connect = connect-to-db() or (alert("error") xor return(false));
It makes for much cleaner code than what I used to do:
$connect = connect-to-db
Why am I getting this error? My statement is:
SELECT * FROM shots WHERE shot_num = MAX(shot_num) LIMIT 1;
There is one record in the table "shots". Its shot_num value is 0.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thanks bunches
"John Holmes" <[EMAIL PROTECTED]> wrote in message
001101c233ba$3de3d430$b402a8c0@mango">news:001101c233ba$3de3d430$b402a8c0@mango...
> > I have a datetime field in one of my mysql tables...when displaying
> some
> > of
> > my records I want to display the date in the aforemention
I have a datetime field in one of my mysql tables...when displaying some of
my records I want to display the date in the aforementioned datetime field,
but if the date is today I want to display "today" instead. If the date is
yesterday I want it to display that so I how do I compare the dat
I have a column in one of my mysql tables which holds the date & time that
the record was inserted. When I run a query later on I want to display the
date, but if the date is today or yesterday I want to display "today" or
"yesterday" instead .. how do i compare to stored date with todays date?
t
I have an embedded object in my webpage which will play a DVD movie right in
the page (provided you have a disc in teh dvdrom drive). One of the
javascript methods attached to this object returns the current time. OK, on
to the php/mysql part. I have a mysql database which has a table to catalo
I want to update the most recent record (based on the timestamp in field
posted) where the parent field == a specified value (in a table called
header).
I tried the following mysql statement:
"UPDATE header WHERE parent = '$this->postid' ORDER by posted SET
parent='$this->parent' LIMIT1";
but a
can I use limit to show the 2nd record on without knowing how many more
records there might be?
also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but
there are only 3 results? 7 results?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www
I have an array filled with objects. Each object has a method called
"display".
I have
$var = $arr[0];
$var->display();
but I keep getting an error. What am I doing wrong?
(I do a print_r of the array immediately before this code and there is an
object at array[0])
Thanks
Alex
--
PHP Ge
Does exit() in a recursive function exit the entire function, of does it
only exit that iteration of teh function?? Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ok ... but the line of code that was the culprit was simply:
print "var id = ".$id.""; //for debugging
how does that line constitute sending more header info?
Alex
"Chris Hewitt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news
I'm slowly beginning to undrestand this, but please bear with a php novice.
When/how were the headers sent? In other words, how do I know that they
have already been sent?
Thanks for humoring me
alex
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> >what does th
I realize this isn't a php question, but I figured that someone here knows
of a good mysql newsgroup and in the mean time someone here probaby knows
the answer to my question.
Can I set up a query like this:
select * from table where start_shot <= $current_shot and end_shot >=
$current_shot
not
I'm trying to understand sessions so I can set session variables. I set up 2
very simple pages:
Page 1:
Click here
Page 2:
This doesn't seem to work though. $test_var doesn't seem to have a value
when I go the second page. What am I missing. Thanks for helping a newbie.
Alex
--
PH
what does this mean:
Warning: Cannot send session cache limiter - headers already sent (output
started at /home/.edy/alexross/bleen.net/forum/discussion_fns.php:88) in
/home/.edy/alexross/bleen.net/forum/index.php on line 5
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vis
I know this is correct:
if ($something)
{
...
}
else
{
...
}
But I recently saw someone use this instead:
if($something):
...
else:
...
Is that also correct?? No brackets needed?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How can I set a cookie which expires when the borwser is closed?? How can I
delete a cookie via PHP?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Never mind .. That can't happen because of how I build the tree .. thank
you!!!
"Alexander Ross" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yes but the first 10 rows may or may not be the correct information to
> po
; $NextPage = $P + $C;
> if ($P > $C)
> $PreviousPage = $P - $C;
> else
> $PreviousPage = 0;
>
> print "Next Page";
>
> You get the idea...
>
>
>
> -Original Message-
> From: Alexander Ross [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 6
If $this is an object, can I have the following link?
Process
Will the URL become too long? Will teh info get passed correctly? thanks
Alexander Ross
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How bout the question marks in the following line of php generated html:
what do they mean?
"Miguel Cruz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sun, 7 Jul 2002, Alexander Ross wrote:
> > Can someone explain
Thank you kindly ...
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> >1) in a fuction, does a return statment automatically exit the function
as
> >well?
>
> Yes. Nothing more will get executed inside the function after the
"return;"
>
> Some purists claim that
(including
relies in that count) at a time; then have a next link and display the next
10 (you've all seen it before). How do I modify a recursive function to
stop and start? My display finction is listed below.
Thanks
Alexander Ross
function display($row, $start = 0)
{ //display the tree
if(
Can someone explain to me what the ? does. I have a vague idea of what it
means in a URL (please cearify that) but I haven't the slightest what it
means in php code. Thanks for your help
Alex
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.p
1) in a fuction, does a return statment automatically exit the function as
well?
2) can someone give me a better explination of $HTTP_POST_VARS
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
39 matches
Mail list logo