[PHP] using mapquest with php

2002-11-18 Thread Alexander Ross
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

[PHP] getting directory info

2002-08-27 Thread Alexander Ross
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

[PHP] +=

2002-08-19 Thread Alexander Ross
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

[PHP] what am I missing here?

2002-08-15 Thread Alexander Ross
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

Re: [PHP] assoc array question

2002-08-15 Thread Alexander Ross
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- > >

RE: [PHP] assoc array question

2002-08-15 Thread Alexander Ross
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

[PHP] assoc array question

2002-08-15 Thread Alexander Ross
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

[PHP] mysql statement (still a semi newbie)

2002-08-14 Thread Alexander Ross
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

[PHP] newbie array question

2002-08-13 Thread Alexander Ross
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

[PHP] switch statement question

2002-08-13 Thread Alexander Ross
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" }

RE: [PHP] Re: including a php file in an html doc

2002-08-12 Thread Alexander Ross
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

[PHP] Re: including a php file in an html doc

2002-08-12 Thread Alexander Ross
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

[PHP] including a php file in an html doc

2002-08-11 Thread Alexander Ross
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

[PHP] Re: spiffy error handling ...

2002-08-09 Thread Alexander Ross
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

[PHP] spiffy error handling ...

2002-08-09 Thread Alexander Ross
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

[PHP] invalid use of group function (mysql)

2002-07-26 Thread Alexander Ross
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

Re: [PHP] datetime field - still a newbie

2002-07-25 Thread Alexander Ross
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

[PHP] datetime field - still a newbie

2002-07-24 Thread Alexander Ross
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

[PHP] date

2002-07-24 Thread Alexander Ross
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

[PHP] need some help on stratagy... (php/mysql/javascript)

2002-07-23 Thread Alexander Ross
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

[PHP] newbie: mysql statement

2002-07-15 Thread Alexander Ross
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

[PHP] mysql LIMIT

2002-07-14 Thread Alexander Ross
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

[PHP] objects in an array

2002-07-13 Thread Alexander Ross
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

[PHP] recusive functions

2002-07-13 Thread Alexander Ross
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

Re: [PHP] Re: session error ... I think

2002-07-11 Thread Alexander Ross
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

[PHP] Re: session error ... I think

2002-07-11 Thread Alexander Ross
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

[PHP] mysql question

2002-07-11 Thread Alexander Ross
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

[PHP] sessions

2002-07-10 Thread Alexander Ross
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

[PHP] session error ... I think

2002-07-10 Thread Alexander Ross
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

[PHP] if syntax

2002-07-10 Thread Alexander Ross
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

[PHP] cookies

2002-07-10 Thread Alexander Ross
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

Re: [PHP] tree structures

2002-07-09 Thread Alexander Ross
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

Re: [PHP] tree structures

2002-07-09 Thread Alexander Ross
; $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

[PHP] passing objects in url

2002-07-09 Thread Alexander Ross
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

Re: [PHP] newbie: question about question marks

2002-07-09 Thread Alexander Ross
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

[PHP] Re: newbie: a couple basic questions

2002-07-09 Thread Alexander Ross
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

[PHP] tree structures

2002-07-08 Thread Alexander Ross
(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(

[PHP] newbie: question about question marks

2002-07-07 Thread Alexander Ross
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

[PHP] newbie: a couple basic questions

2002-07-07 Thread Alexander Ross
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