Re: [PHP] sessions

2004-06-04 Thread Daniel Clark
Did you have session_start() on this page before accessing the session variables? Could also do: $name = "$_SESSION['first_name'] , $_SESSION['last_name']" ; >>why is this not working. I am using instead of a form ($name = >>$_POST[name];) >>and linking to it from a users logged in page. >> >>$F

Re: [PHP] script location

2004-06-04 Thread Daniel Clark
I use of realpath() > Does anyone know of a simple/efficient way to determine the path to a > script on the URL? > > For instance: > > http://www.nowhere.com/test/whatever/testing.php > > All I want out of that URL is this: > > /test/whatever/ > > I didn't see an element in one of the super global

Re: [PHP] Refresh Page

2004-06-05 Thread Daniel Clark
Put inside the tags, this refreshed the page every 10 seconds. >>I want to refresh page every 10 seconds, without clicking on "Refresh" >>button. >>Any ideas how this can be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Refresh Page

2004-06-05 Thread Daniel Clark
I've used this META tag is IF statement conditionals in the header too. Works well NOT to refresh when in a "edit mode". >>You can use javascript timer that are much more flexible than >HTTP-EQUIV="REFRESH"> because you can test for conditions, etc. >> >> >>"Mike Mapsnac" <[EMAIL PROTECTED]> es

Re: [PHP] DB Query

2004-06-05 Thread Daniel Clark
Run an explain plan, but my first quess would be to add indexes to c1, c2, c3, c4, c5 fields. >>I'm trying to optimize a query that in the first example is taking too long >>to run. >> >>This is my existing working query: >>$sql = "SELECT count(*) as cnt, id FROM `mYTable` WHERE c1 not in (1,16,

Re: [PHP] Prevent IE6 from blocking cookies

2004-06-05 Thread Daniel Clark
In IE you can turn ON or OFF accepting cookies, select Tools, Options, Security, Advanced, cookies. But the web server can't command IE to enable cookies. >>Do I a prevent Internet Explorer 6 from blocking cookies (session cookies, >>etc)? Do I have to setup something in the META HEADERS? >> >>

RE: [PHP] DB Query

2004-06-05 Thread Daniel Clark
gt;-Original Message----- >>From: Daniel Clark [mailto:[EMAIL PROTECTED] >>Sent: Saturday, June 05, 2004 11:41 AM >>To: bskolb; [EMAIL PROTECTED]; [EMAIL PROTECTED] >>Subject: Re: [PHP] DB Query >> >>Run an explain plan, but my first quess would be to add indexes to

Re: [PHP] mkdir after mkdir

2004-06-06 Thread Daniel Clark
I think PHP and mkdir() is using the web servers rights. So the web server would need rights to create directories. >>Hello, >> >>I have a problem with the mkdir function. >>I'm trying to make a seperate folder every photoalbum. inside I want to >>create another folder ('.../thumbnails/') for,

Re: [PHP] count number of occurences of character in a string

2004-06-08 Thread Daniel Clark
substr_count() http://www.php.net/manual/en/function.substr-count.php >>what function can I use to count the number of occurences of a certain >>character in a string? >> >>-- >>Diana Castillo >>Global Reservas, S.L. >>C/Granvia 22 dcdo 4-dcha >>28013 Madrid-Spain >>Tel : 00-34-913604039 >>Fax :

Re: [PHP] PDA / Normal Browser

2004-06-08 Thread Daniel Clark
$_SERVER['HTTP_USER_AGENT']; > [snip] > Is it possible to use PHP to detect the type of browser accessing my > site. > For example if a PDA is using it I would prefer not to include large > graphics... > [/snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP] previous page

2004-06-09 Thread Daniel Clark
Then you could set a hidden form variable or set a sesssion variable on the previous page. >>Larry, >> >>Thanks all makes sense, but, if I add this: >>>echo($_SERVER['HTTP_REFERRER']); >>?> >>I don't get anything back when the page is called? >> >>Cab >> >>"Larry E . Ullman" <[EMAIL PROTECTED]> w

Re: [PHP] Limit the number of characters in a string

2004-06-11 Thread Daniel Clark
substr( xxx, 1, 100) >> >>Hi >> >>Anyone know how to clip the number of characters in a string? For instance, >>I have a string carrying a long piece of text, say, of 200 characters, but I >>want to reduce this to just the first 100 characters. >> >> >>Thanks in advance. >> >>Russell -- PHP Gene

Re: [PHP] passing a function as a parameter

2004-06-11 Thread Daniel Clark
Can you use eval() ? > I want to pass a function as a parameter and execute it in another > function. > A callback. :-) > > For example: > > function a() { > echo "a"; > } > > > function b( $func ) { > func(); > echo "b"; > } > > > The output of "b( a )" will be "ab". -- PHP Gener

Re: [PHP] testing array_search

2004-06-11 Thread Daniel Clark
What output do you get? > I'm having a very hard time testing array_search. > > $j = array_search( $i, $errList ); > echo "j=" . $j; > if (($j != false) && ($j >= 0)) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function Date

2004-06-14 Thread Daniel Clark
How about. strtoupper( date("j M Y")) > I am using date("j M Y"), the format date is 14 Jun 2004, but i need this > format 14 JUN 2004. The unique difference is Jun -> JUN. How can i change > this?. > Thank You, > Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

Re: [PHP] Erroring out?!

2004-06-14 Thread Daniel Clark
I think you need single quotes around $user. $query = "select * from quoteprefs where salesman = '$user'"; > I am trying to figure out why if there is an error in my query it throws > an error message to the screen instead of parsing the rest of my script > to get the rest of the information. I

Re: [PHP] update count

2004-06-16 Thread Daniel Clark
If your table has a primary key, or auto increment field works well and is quick. > What is the best way to only do an update if it going to update only one > row? > I want to protect my code so that it won't accidentally update more than > one row. > I can do a select first but there must be an e

Re: [PHP] Problems with arrays

2004-06-17 Thread Daniel Clark
echo "$InputString" . ''; // for HTML echo "$InputString\n"; // for output to screen >>Hi, >> >>I have this array: >> >>$array = array(element1, element2, element3, element4) >> >>I want to list all elements of this array, so i used: >> >> foreach ($array as $index => $eleme

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Daniel Clark
Try adding number of bytes to read. $line = fgets($fp, 4096); > >> * Thus wrote Scott Miller ([EMAIL PROTECTED]): >> > I have a text file (log file) that I want to be able to read the last >> 30 > or >> > 40 lines of. I've created the code below, but since this file is so > large >> > (curren

Re: [PHP] variable question

2004-06-20 Thread Daniel Clark
How about: eval( '$lie' . x ) ; >>is there a way to use one variable to create another? >>Example >>$poo=1 >>and i want >>$lie1 >>OR >>$poo=2 >>and i want >>$lie2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] umm i am confused...

2004-06-20 Thread Daniel Clark
Looks like several lines need quotes around the print statements and \" inside. print("delete"); >>>//the function for adding new addresses >>function loop_new_address($loopnum,$url,$name){ >>//the ${'link' . $loopnum} says put $link and add $loopnum to the end >>if(isset(${'link' . $loopnum . '}

Re: [PHP] Mysql fetch_row()

2004-06-20 Thread Daniel Clark
Use mysql_fetch_assoc() for fieldnames >>when I call mysql_fetch_row() I get an array, but this Array doesn't have >>the fieldnames as array-keys. >>I've seen several codes from others where they use something like >> >>print $row['key']; >> >>This doesn't work on my server. Is this because my s

Re: [PHP] hi all can you read me ?

2004-06-21 Thread Daniel Clark
Can read you now(). >>Hi all just wanna check if you can read me >> >>Thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] file locking question

2004-06-21 Thread Daniel Clark
If you're just going to read only, no. >>Hi all >> >>I have this script whereby I use the php function file(). >>Just a quick question, do I need to implement file locking. >> >>if so, can I just use something like >> flock( file("/path/file.ext") ); >> >>Kind Regards >>Brent Clark -- PHP G

Re: [PHP] Association Problem?

2004-06-21 Thread Daniel Clark
Good idea storing it in an array. Sort the unique row ID and the count in the array and use asort(). > Wanted to see if anyone had any input on this. I have a recordset that > is returned to me in my script. What I then would like to do is go > through each row of the recordset and use the subs

Re: [PHP] TIFF display problem...

2004-06-21 Thread Daniel Clark
Do you want... if ( !isset($_SESSION['user_id']) ) > [snip] > session_start(); > > if ( !$_SESSION['user_id'] ) > { > exit(); > } > > [/snip] > > Are you sure you are getting past the if ( !$_SESSION['user_id'] ) > condition? -- PHP General Mailing List (ht

RE: [PHP] TIFF display problem...

2004-06-21 Thread Daniel Clark
culprit. > > -Dan Joseph > >> -----Original Message- >> From: Daniel Clark [mailto:[EMAIL PROTECTED] >> Sent: Monday, June 21, 2004 4:47 PM >> To: Matt Matijevich >> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] >> Subject: Re: [PHP] TIFF display problem... >&g

Re: [PHP] Sessions not working.

2004-01-29 Thread Daniel Clark
That's GREAT ! :-) > I remember back in the day > > > Sorry, couldn't resist. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Weird result from query...?

2004-02-26 Thread Daniel Clark
&p=4.78 I wonder if a dot is a valid character for a URL adderss? > Hi, > Just been getting some weird results from a query...can anybody tell me > why..? > > Basically am sending 3 variables via a link on the page... > http://localhost/show_accounts.php?o=8927437717300145&n=shane&p=4.78 > > whic

Re: [PHP] Math weirdness with doubles...

2004-02-27 Thread Daniel Clark
Looks like the Doubles are not exactly zero. Must be some precision points not displaying. > Ok... It's Friday and maybe my brain is dead, but I'm having a weird > problem with some basic math. > > Here's a little snippet of the code I'm working with: > > --- > echo "Curr

RE: [PHP] Math weirdness with doubles...

2004-02-27 Thread Daniel Clark
riginal Message- > From: Daniel Clark [mailto:[EMAIL PROTECTED] > Sent: Friday, February 27, 2004 3:16 PM > To: jon roig > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Math weirdness with doubles... > > > Looks like the Doubles are not exactly zero. Must be some precision &g

Re: [PHP] Re: interbase + php

2004-03-02 Thread Daniel Clark
I understand you can use base64_encode and decode. http://www.phpbuilder.com/manual/function.base64-encode.php >>> > i have the problem that i want to put an image into a firebird >>> database. >>> the >>> > problem is that when i copy the code of the image into my sql syntax, >> the >>> > code

Re: [PHP] Re: Sessions, sessions and... sessions

2004-03-02 Thread Daniel Clark
I believe the PHP.INI has to be set with a Session variable temp directory. > Hi Puiu, > I've been having the same problem too. My code that worked up until > recently > just stopped working. I did change from using: >session_register("user_id"); >if (!(user_id)){ > > to usin

Re: [PHP] Re: Sessions, sessions and... sessions

2004-03-02 Thread Daniel Clark
session.save_path string session.save_path defines the argument which is passed to the save handler. If you choose the default files handler, this is the path where the files are created. Defaults to /tmp. If session.save_path's path depth is more than 2, garbage collection will not be perfor

Re: [PHP] numeric characters

2004-03-02 Thread Daniel Clark
Or you can us client side JavaScripting. > Hello Dominique, > > Tuesday, March 2, 2004, 6:31:00 PM, you wrote: > > DA> Is there a way with php to force the user to put only numeric > character in a text field ? > > No, because that's a client-side thing. You can however use the PHP > function is_n

Re: [PHP] resubmitting $POST data to another script

2004-03-02 Thread Daniel Clark
That would be a great function, but I haven't heard of anything like that. > I'm creating a form with 170 fields, and I'd like to create > an intermediary page so the user can review their info > before submitting it again to the emailing script. > > Since the form has so much data, I was hoping

Re: [PHP] resubmitting $POST data to another script

2004-03-02 Thread Daniel Clark
You could loop throught the $_POST[] data and create 170 hidden fields with about 3 lines. >> When you create the "view" page store all of the passed variables in >> hidden form fields. That way they can then be submitted on to the next >> script. >> > > I could do it that way, but I was hoping f

Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Daniel Clark
foreach($file as $value ){ print "$value"; } > // This will print first and sixth line from the text file: > $file = file("people.txt"); > print "$file[0]"; > print "$file[6]"; > > // But how to print all the lines from [0] to [6] ? > // Hope you understood my problem. -- PHP General Maili

Re: [PHP] ASCII

2004-03-05 Thread Daniel Clark
ord() -- Return ASCII value of character http://www.phpbuilder.com/manual/function.ord.php > Hi! > Is there a function to convert a ASCII char to decimal or binary? > Or a program? > > csko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Daniel Clark
Wow, thanks John ! > Number values starting with a leading zero are assumed to be octal values. > > Octal 11 = Decimal 9 > > ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Daniel Clark
Doesn't putting and x11 tell PHP it's a decimal format? > $id = 11; > $id2 = preg_replace("/^0+(.*)$/","\\1",$id); > > echo $id2; // Displays 9 > echo $id; // Displays 9 as well. > > If the number begins with a zero, there seems to be no way to tell PHP > this >

Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Daniel Clark
Found this: $a = 1234; # decimal number $a = -123; # a negative number $a = 0123; # octal number (equivalent to 83 decimal) $a = 0x1A; # hexadecimal number (equivalent to 26 decimal) http://www.phpbuilder.com/manual/language.types.integer.php#language.types.integer.casting > hm > > ever try

Re: [PHP] includes

2004-04-05 Thread Daniel Clark
I had some similar problems ! Here's what I did. include $_SERVER['DOCUMENT_ROOT'] . '/includes/_myInclude.php' ; Putting the DOCUMENT_ROOT ensured I was always pointing to the top directory of the web pages. Daniel Clark >>I have a problem. My directory li

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Daniel Clark
I agree. I believe the default FORM METHOD is GET. > One problem > wrong > > right > > ?action is a variable with a value of post > > -Blake > > > DvDmanDT wrote: > >>Hmm.. Are there any PHP settings that only applies to that vhost? Can you >>please try to run PHP as CGI few tries.. If the inp

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Daniel Clark
> I am a newbie PHP programmer, I have some code that works but I want some > tips on how I an Improve my code, i.e. should I be doing my updates / > include ("../db.php"); Some things I do is use single quotes include '../db.php' ; (they are slightly faster, no replacments looking fo

Re: [PHP] Pulling Certain Data

2004-04-06 Thread Daniel Clark
Try something like this. (assuming "POSITION" is your peoples status within the organization $r1="SELECT * FROM $main_tbl WHERE position IN ('A', 'I', 'L') ORDER BY position"; > I would like to only show people who are active within our roster and > within > the database I have identified those

Re: [PHP] update mysql from php web page

2004-04-06 Thread Daniel Clark
I think you need a WHERE clause for the UPDATE, otherwise it will update ALL the records. e.g. WHERE OwnerName='$result' Then perhaps a redirect to another page. > I probably need to use if(isset($submit)): and an update statement, but my > attempt just causes the web page to display completel

Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
For the submit button to work it has to be in a form. Hope this helps. Daniel Clark > > ... more code ... > > endif; > ?> > > > - > > I don't see any reason for the submit button to not wor

Re: [PHP] Can I get varaibles from an include file without exectuting it?

2004-04-07 Thread Daniel Clark
I agree, the only way I see it can be done is to read the "include file" in as Text, and parse it. > I have a script that is run with a cronjob and would like to fetch some > variables from it, using another file, without the script executing. > > I could resort to putting the variables in a thir

Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
Something I like to do during troubleshooting is to have the page display the SQL statement I'm processing. Something like: print sql_query ; That was I can verify all the parameters are correct. Do you have autocommit ON? Or need to pass a commit statement? Daniel Clark > Of c

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Daniel Clark
My understanding is if the variable "exists" then the radio button was checked. > i have this code: > > accesskey="y">Yes > > accesskey="n">No > was just wondering if that was the right way to determine the state of a > radio button...? > if the value of $old['Type']="Annual" then the yes but

Re: [PHP] Need help

2004-04-09 Thread Daniel Clark
www.phpbuilder.com has some wonderful articles for beginners and advanced. > Hi, > Am working through a PHP Book (I am a noob), and it appears to fall over > on > the first tutorial. > Any ideas where I can get help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:

Re: [PHP] Understanding sessions

2004-04-09 Thread Daniel Clark
Todd, I think you want the session_id() function. http://us3.php.net/manual/en/function.session-id.php > I am trying to understand sessions are done with php. My "learning > script" has the following: > >session_start(); >if (isset($_SESSION['firstname'])) { > $_SESSION['firstname

Re: [PHP] Understanding sessions

2004-04-09 Thread Daniel Clark
I'm not certain. I normally use session variables to store and hold login username or order state. e.g. $_SESSION['username'] > If I use session_id(), I do get a value. However, I have > session_use_cookies = 0 and I do not have a value for SID. Is that > correct? > > Todd -- PHP General Ma

Re: [PHP] Understanding sessions

2004-04-09 Thread Daniel Clark
> As suggested, if I turn off cookies in my browser, then SID is set. So > the directive in php.ini does not cause the use of cookies to be > completely turned off? My understanding is the php.ini sessions.save_path(?) is for PHP to have a temp directory to write session information on the serve

<    1   2