Re: [PHP] Problems creating images

2006-04-05 Thread Philip Hallstrom
I added image confirmation to a guestbook and even though it works greate for most people, some people have problem and I can't seem to figure out why this happens. Note that I'm not talking about the same guestbook on one server but the guestbook is on people's own hosting server. The php

Re: [PHP] int to string

2006-04-05 Thread Philip Hallstrom
I don't think it's built in, so I was wondering ya'll would recommend as the best way to convert int to string, not basic type casting, but converting to the english word the int represents. Something like this: 5 = Five or 20 = Twenty If you wanted a full solution (well maybe, I didn't read

Re: [PHP] Need a CRM recommendation

2006-04-04 Thread Philip Hallstrom
I need recommendations for a good CRM done in PHP, thanks! http://www.opensourcecms.com/ Lots of options, ratings, reviews, demos, etc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Need a CRM recommendation

2006-04-04 Thread Philip Hallstrom
[snip] I need recommendations for a good CRM done in PHP, thanks! http://www.opensourcecms.com/ Lots of options, ratings, reviews, demos, etc. [/snip] Lot's of good CMS's there, only one, maybe two CRM's. Woops. That's what happens when you read too fast... No experience with it, but

Re: [PHP] Strtodate() bug?

2006-04-03 Thread Philip Hallstrom
I've got some weird behavior using PHP 4.3.9. I use the function of strtotime(last Sunday); and it's returning the timestamp for last Saturday. However, if I use strtotime(-1 day); (I'm running this program on a Monday) it returns the correct timestamp for Sunday. Is this a bug in PHP 4.3.9?

Re: [PHP] Multidimentional array problems

2006-04-03 Thread Philip Hallstrom
I am trying to read form a database and place everything in a multi-dimentional array This is what I am doing and the output (for testing) seems correct while($row=mysql_fetch_array($result)) { $banner= array($arrayIndex = $row); echo $banner[$arrayIndex][image]. br; echo

Re: [PHP] XML-RPC or SOAP

2006-03-30 Thread Philip Hallstrom
I am at the beginning of creating a web service. As I am not very familar with both SOAP and XML-RPC it would not make much difference in which one I learn. Which one would you guys recommend for a web app that has to be transformed into a white lable solution. I just did one using SOAP.

Re: [PHP] Database connections

2006-03-30 Thread Philip Hallstrom
I have almost finished making a set of scripts that would communicate with maybe 1k sites to start with... I'm sorry I cannot give you more details about the scripts but this guy is really nervious and had me sign an NDA etc etc but what i would like to know is; would there be a problem with

Re: [PHP] validating ereg patterns

2006-03-29 Thread Philip Hallstrom
How do I detect the difference between a bad ereg pattern and no matches? I've got a UI that allows the user to enter an ereg expression. Clearly, the user may enter an invalid expression (for example, the expression may not have matching [] brackets). ereg returns false if there are no

Re: [PHP] $i vs. $r

2006-03-27 Thread Philip Hallstrom
I simplified the code a bit, and I am guessing that it was too much. Below is the complete code that works fine. The weird part is, the part that I have the question on, is if I change $r to $i, it doesn't work anymore. $i doesn't count up as it should and instead gives me some unpredictible

Re: [PHP] Security in php/ajax scripts

2006-03-20 Thread Philip Hallstrom
I am slowly converting my webapps to use the 'ajax' technology. I'd like to know what 'best practices' should I use when it comes to authenticate, identify the requests in a more restricted context. So far I've migrated some 'open' areas where the user, without having to identify himself can

Re: [PHP] GD2 gif resizing problem

2006-03-15 Thread Philip Hallstrom
I'm trying to resize GIF images and up with very large files For example: Original width = 720 New width = 980 Original height = 1008 New height = 1274 Original filesize = 80kb After resizing = 235kb Based on the area increase; I'd expect the file size to about double, not be 4x as large.

Re: [PHP] CLI versus apache module

2006-03-15 Thread Philip Hallstrom
I have a.php includes b.php . b.php is used by other pages that are served through apache. a.php used to be started through apache, but now need to be started from command line. How do I know if a php file is running as apache module or as CLI ?

Re: [PHP] Hostname Filtering

2006-03-14 Thread Philip Hallstrom
I have a few PHP scripts where I log hit to a page i.e. IP and hostname via a look up. What I want to do is create essentially a blacklist to prevent bots and other hosts and IP from being logged and skewing my stats. My local IP/host and the MSN and Googlebot hits should not be in my stats

Re: [PHP] moving data from mssql to mysql on linux

2006-03-14 Thread Philip Hallstrom
I have a project where I need to connect to a remote SQL Server and move data from their to my localy MySQL server. On the remote SQL Server, I only have access to a few views but need to get their data and move it to my local MySQL db. What is the best way to do this? I have freetds compiled

Re: [PHP] Zoomable map

2006-03-08 Thread Philip Hallstrom
I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have what you need...

RE: [PHP] Zoomable map

2006-03-08 Thread Philip Hallstrom
[snip] I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have

RE: [PHP] max unique number

2006-03-07 Thread Philip Hallstrom
[snip] How do i get a unique max number from a mysql table column? [/snip] SELECT MAX(number) FROM table LIMIT 1; That might not be unique though... I'm wondering if the original poster is looking for AUTO_INCREMENT (ie. sequences) to ensure a unique id to use for insertion...? -- PHP

Re: [PHP] Sessions in PHP... where to start???

2006-02-27 Thread Philip Hallstrom
Hi everybody! I have a problem and I was told to check out the sessions part in PHP. What I want to deal with is the following : I have a PHP page with a form, where the user writes some data. These data are then written into a file which is then used in a system command as input for an

Re: [PHP] defined

2006-02-25 Thread Philip Hallstrom
I'm having kind of a weird problem I want $MailSubject to contain a the value prayer unless I tell it other wise. // on a form processor. $MailSubject = Praise; include_once(mailit.php); // then in mailit.php include form2mail.php; // and in formtomail.php if(!defined($MailSubject)) // This

Re: [PHP] Conceptional question on dealing with different languages

2006-02-22 Thread Philip Hallstrom
Hello list, it has been a while since I've posted the last time, but now I need your help/ opinion again. I'm re-designing an existing page for an online shop which is supposed to be used in different languages. The former design was just a plan echo for an output since the page was only

Re: [PHP] Looping from A to Z

2006-02-19 Thread Philip Hallstrom
Good afternoon. I'm having trouble getting PHP to loop from A through Z. Here is what I tried, coming from a C background: for ($l = A; $l = Z; $l++) echo $l; // Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY, YZ. (26 * 26 results!) Interestingly, if I make it a less

Re: [PHP] PHP job postings?

2006-02-16 Thread Philip Hallstrom
Just wondering if anyone know of a mailing list of forum specifically dedicated to soliciting for programmers to fill PHP programming positions? I see people post to this list periodically but it really doesn't seem like the right place. Our project is going to be expanding quite a bit and

Re: [PHP] string size in bytes

2006-02-12 Thread Philip Hallstrom
i need to know how many bytes are in a string example: $string = blah; string == how many bytes Well, if you're willing to ignore all the unicode stuff, you can use strlen() since 1 byte = 1 character. Check that manpage to see if there's a unicode safe version. also i need to know how

Re: [PHP] how to learn php

2006-02-10 Thread Philip Hallstrom
i have been trying to learn php. what is the best approach to learning php for someone who has no programming experience? i am very familiar with html, xhtml, and css. i'm not an idiot when it comes to using computers. i have bought several books and have subscribed to a couple of the php

Re: [PHP] Re: [Off] Cheap SSL certificates?

2006-02-03 Thread Philip Hallstrom
Jim Moseby wrote: Well said. If you're going to buy a $15 Cert from billy-joe-bob's CA and carwash, you might as well sign your own cert. Thats free... That might work in an intranet setting, but in an internet setting, you will get the security warnings. :) Only once per user/browser

Re: [PHP] Re: [Off] Cheap SSL certificates?

2006-02-03 Thread Philip Hallstrom
On Fri, February 3, 2006 11:06 am, Philip Hallstrom wrote: it permanently. With IE you have to ask that they download your root certificate (click click, installed) I've never gotten that to work, actually... It always keeps asking me over and over to install the cert and I do, and next time

Re: [PHP] How can I dynamically place a small on a large image?

2006-01-30 Thread Philip Hallstrom
I'm working on an application using the html map tag where I'd like to automatically place a small image on a larger image automatically. For example, I've got a table of map coordinates such as: map name=Map area shape=rect coords=469,188,488,205 href=/courses/Start_Locs/Loc_Maps/baes.jpg

Re: [PHP] A black thumbnail.

2006-01-27 Thread Philip Hallstrom
(skip down) I'm trying to create a thumbnail from a jpeg stored in a long blob in mySQL. What's wrong here? I get an image that's the correct size, but it's black. Any ideas? code $dbQuery = SELECT image_type, image, image_width, image_height ; $dbQuery .= FROM pictures ; $dbQuery .= WHERE

Re: [PHP] header WWW-Authenticate Question

2006-01-26 Thread Philip Hallstrom
I have been looking for this in several areas and I can't seem to find it. I'm new to PHP (any programming since FORTRAN, really :) so please forgive my ignorance. I am trying to send username/password credentials to a web server using a PHP script. This is done to automatically log into a web

Re: [PHP] Get timestamp?

2006-01-25 Thread Philip Hallstrom
How would I go about getting the timestamp of a day of the week from 7 weeks ago? In my case I'm getting the timestamp of last Sunday (no matter what day of the week it is currently) and I want to get the timestamp of the Sunday that happened 7 weeks ago. $lastSunday = strtotime(last Sunday);

Re: [PHP] Get text from funky url?

2006-01-20 Thread Philip Hallstrom
I am trying to get xml from AIM's new presence API. The url is unusual, it has quotes in it. Anyone know a way to get the text from this? http://api.oscar.aol.com/SOA/key=PandorasBoxGoodUntilJan2006/resource-lists/ users/*anonymous*/presence/~~/resource-lists/list[name=\users\]/[EMAIL

Re: [PHP] Speed

2006-01-11 Thread Philip Hallstrom
Assume that I save data about an object and it has 10.000 observations of the object stored in a MySQL database. I want calculate the average value of a column, is it faster done by using PHP on the result array or using the MySQL function to do that? MySQL. You don't have to transfer all

Re: [PHP] Reading large files via PHP?

2006-01-11 Thread Philip Hallstrom
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the script,

RE: [PHP] Reading large files via PHP?

2006-01-11 Thread Philip Hallstrom
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the script, but

Re: [PHP] Re: array of checkbox values

2006-01-11 Thread Philip Hallstrom
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Nope. That's the problem. If a checkbox is unchecked the browser

Re: [PHP] Executing a string

2006-01-09 Thread Philip Hallstrom
If I have $myStr = $a * $b; and I pass it as an argument $result = myFunction($myStr); function myFunction($var) { $a = getData(1); $b = getData(2); return // Use $var } Is there a way to use $var to process $a and $b? http://us2.php.net/eval -- PHP General Mailing List

Re: [PHP] Strange problem with overlapping names

2006-01-06 Thread Philip Hallstrom
the page shown below works fine on my own machine, but on another (remote) server, it gives me a strange result. Here's what happens: The first time I view the page it says array(0) { } as I'd expect, but on the second it says object(kurv)(0) { } where I expected another array. The problem seems

Re: [PHP] web app in my portflio

2005-12-29 Thread Philip Hallstrom
I have a web application I've just completed, and I want to present it as part of my online portfolio, most of which hi-lights my work as a front end developer. My question is this: How do I go about showing off all of the hard-work I've done on the back-end? Do I simply describe the structure

Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Philip Hallstrom
I'm writing a filter/parsing function for texts entered by users, and I've run into a problem... What I'm trying to do is to parse URLs of different sorts, ftp, http, mms, irc etc and format them as links, that part was real easy.. The hard part is when a user has already entered a complete

Re: [PHP] duplicate filenames but different .extention

2005-12-18 Thread Philip Hallstrom
hello again I am trying to figure out how i can read the list of files in a directory using the opendir() and readdir() functions. Normally this goes fine but within the loop, what i am wanting to do is echo the filename if it is a jpg file, but if its a .gif, just continue. I have several

Re: [PHP] Is it possible to use header() to POST form data?

2005-12-15 Thread Philip Hallstrom
Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? No, but a quick search for HTTP POST PHP example will get you the code you need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Accessing photos outside the web folder

2005-12-10 Thread Philip Hallstrom
I'm writing a content management application which saves file paths in a database and allows users to search the database for those files. Problem I'm having is that although the PHP script that handles the database queries works fine, when the search results get to the browser, all the paths

Re: [PHP] Re: Server Client Architecture, best parctice

2005-11-19 Thread Philip Hallstrom
Reading this, a question arose me: is it possible to read a shared memory area with php, supposing than both programs are in the same machine? does php support ipc? that would be greatly useful. yes. http://us3.php.net/manual/en/ref.sem.php Mariano. James Benson wrote: Each has its

Re: [PHP] PHP Search Engine

2005-11-08 Thread Philip Hallstrom
HI All, Has anyone on here created a search engine in PHP? I have project to create a search engine that will search about 50K or so pages of information on 100 or so various domain names. What have you all done in the past? PHPdig was a failure. Do you recommend any of the ones that are for

Re: [PHP] proc_open, fwrite, 16384 bytes magic

2005-11-03 Thread Philip Hallstrom
Sorry, as a follow-up, I just realized that from 'cat' I AM finally getting an error in the log file, which will perhaps help trace the issue: cat: stdout: Broken pipe Could be wrong, but I think you're getting that error because you are closing $pipes[0] which well, closes the pipe and

Re: [PHP] Small regex help?

2005-10-12 Thread Philip Hallstrom
Can anyone suggest the correct regex to replace col1,col2... with count(*) and strip out everything just before ORDER BY? so for this: SELECT col1,col2... FROM tbl WHERE filter1 filter2 ORDER BY order1,order2 I would get this: SELECT count(*) FROM tbl WHERE filter1 filter2 $str = SELECT

Re: [PHP] storing passwords in $_SESSION

2005-10-10 Thread Philip Hallstrom
How secure is it to save a password in $_SESSION. i.e. $_SESSION['password'] is it safe and is it practical? Probably not. If you're on a shared server, I could write a PHP script to look in /tmp and read the contents of every session file there... -philip -- PHP General Mailing List

Re: [PHP] user admin/site admin open source functions..

2005-10-10 Thread Philip Hallstrom
i'm trying to find an open source app that would provide me with user admin/site admin functionality. i've been playing with a few of the open source cms apps to get a feel for how they implement this kind of funtionality. i could rip out what i need, but it might be painful for something like

RE: [PHP] Dynamic sub directory listing without redirect

2005-10-08 Thread Philip Hallstrom
Hi List, I am trying to allow dynamic URL's for my users to remember similiar to: www.mysite.com/joesoap So I want to use joesoap in a PHP script to pick up the user's details from a MySQL database. If the joesoap does not exist in the table I will handle that. So basically I have one file

Re: [PHP] Dynamic sub directory listing without redirect

2005-10-07 Thread Philip Hallstrom
Hi List, I am trying to allow dynamic URL's for my users to remember similiar to: www.mysite.com/joesoap So I want to use joesoap in a PHP script to pick up the user's details from a MySQL database. If the joesoap does not exist in the table I will handle that. So basically I have one file

Re: [PHP] Handling competing edits in a wiki engine?

2005-10-03 Thread Philip Hallstrom
I've recently been working on building my own wiki engine for my blog site. While the majority of the engine is complete, a remaining concern I have is how to handle competing edits (ie when two or more people are editing the same wiki page simultaneously). I'm wondering if anyone else on the

Re: [PHP] Sanitize paths

2005-10-02 Thread Philip Hallstrom
realpath() is your friend... That has been my first impression too, but... realpath() expands all symbolic links I am actually using symlinks :) I trust the files on my server so local redirects via symlinks are no problem, the user submitted data is. Then realpath() your doc root as

Re: [PHP] Sanitize paths

2005-10-01 Thread Philip Hallstrom
I'm working on a script which basically loads an image, the user requested and wonder how to properly sanitize the passed path. For instance the user should never ever be able to do somtehing like ?load=../../../etc/passwd. My approach so far is to simply urldecode() the given string and return

Re: [PHP] Regex Help

2005-09-28 Thread Philip Hallstrom
Hi, folks. I'm having trouble with a simple regex. I'm sure it's just something small that I'm missing but nothing I'm trying is working. In an HTML file I have comments like this: !-- START PRINT -- various html crap here !-- END PRINT -- Here's the regex I'm using: /!-- START PRINT

Re: [PHP] split line of text

2005-09-27 Thread Philip Hallstrom
if chunk_split function split the line of text (here on 50 char) I was wondering if there exists one function who take care if the 50 char is in the middle of the word and split the line first empty space before the word or just after? $newstring = chunk_split($row[1], 50, 'br /'); echo

Re: [PHP] how to stream a movie file with fread

2005-09-23 Thread Philip Hallstrom
I am trying to stream a movie file with 'fread' this my first step in trying to dynamically encrypt the file as it is being streamed from the server do I need to fread the data in chunks? If so, how? $filename =$path2file; $file = fopen($filename,'r'); $fileSize = filesize($filename);

Re: [PHP] Problem with Internet Explorer when downloading / viewing dynamically generated PDF files

2005-09-22 Thread Philip Hallstrom
I have written a script which dynamically generates PDF documents (with PDFlib). The link to the PDF file is presented as a static link (thanks btw to Richard Lynch and his previous contributions to this list on the subject force download). It is redirected to the script via a htaccess file. If

Re: [PHP] Problem with Internet Explorer when downloading / viewing dynamically generated PDF files

2005-09-22 Thread Philip Hallstrom
to expose this server to the Internet. Any ideas are still welcome! /frank 2005-09-22 kl. 18.55 skrev Steve Lefevre: Philip Hallstrom wrote: We finally figured out that IE was beginning the download of the PDF itself, but if it downloaded more than about 1mb, it would pass it off to a helper

Re: [PHP] help out a noob w/ include switch?

2005-09-21 Thread Philip Hallstrom
Hi All, My very first post to this group as I'm a freshly spanked new born php baby. Hope I have the correct stop for noob tech questions. Please re-direct me if I have it wrong. I've been doing web dev for a quite while with a variety of methods (html, xhtml/css, cfml, flash/as, on and

RE: [PHP] Re: email validation (no regex)

2005-09-21 Thread Philip Hallstrom
but you could do what you want to do. however, it's going to be painful if you want it to match the rfc spec... Really? Why does it need to be painful? I just need to do a 'EHLO', 'Mail From:' and 'RCPT to:' and 'QUIT'. It's not going to actually send an email. Seems simple to me. Maybe

Re: [PHP] comparing dates

2005-09-20 Thread Philip Hallstrom
Is there a quick way to compare dates in the format dd/mm/yy without exploding and comparing the individual parts? Compare them in what way? Before, after, days between? In any case, i'd look at strtotime() to convert them into timestamps, then diff them to get the number of seconds b/n

Re: [PHP] Size limits of mysql

2005-09-14 Thread Philip Hallstrom
I have a simple database with one table with about 6 fields, just holding filenames, filepaths and sizes. Very basic audit for management here. Problem is I import a load of records into this table and it seems to only allow me to put in about 550,000 records.Maybe it's just mysqlFront

RE: [PHP] trying to figure out the best/efficient way to tell who is logged into a site..

2005-09-13 Thread Philip Hallstrom
any code/pointers to this... i've been doing the google/search thing and haven't come across anything which relates to what i'm searching for... so.. any help in this area would be greatly appreciated!! i would have thought there would be articles/open course code/apps on this!! -thanks

Re: [PHP] incrementing in a for loop

2005-09-12 Thread Philip Hallstrom
I've searched online and am unable to find how to increment by more than one in a for loop. for ($i = 1; $i = 6; $i++) { Is it possible to increment $i by 5? Sure. for ($i = 1; $i = 6; $i+=5) { -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] How large string in cookie?

2005-09-08 Thread Philip Hallstrom
How large can a string be in a cookie? (the value-parameter) According to here: http://wp.netscape.com/newsref/std/cookie_spec.html There are limitations on the number of cookies that a client can store at any one time. This is a specification of the minimum number of cookies that a client

Re: [PHP] Inserting records question

2005-09-08 Thread Philip Hallstrom
Still learning, so sorry if this sounds really simply noobish. But as I understand things currently this should work. But doesn't. I've been looking over tutorials but just don't see whatever the problem is. I created a simple table with the following fields (in order) tc_id (auto nmbr) lname

Re: [PHP] Stripping control M character (^M)

2005-09-07 Thread Philip Hallstrom
Hello All, I'm having some issues with carriage returns. Specifically the control M character (^M). I have attempted to clean and validate the file I'm creating. Here's the code. while ($row = mysql_fetch_array($result)){ // assign and clean vars $artist = trim($row[artist]); $tdDate

Re: [PHP] regular expression for integer range

2005-09-06 Thread Philip Hallstrom
On Tue, 6 Sep 2005, babu wrote: Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1. only integer 2. an integer, range of integers example 3 and no other

Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom
I am searching for the right equivalent for cut -d : -f5 but it must work with php4. $fields = explode(':', $string, 5); Hmmm.. that's going to create a 5 element array assigned to $fields. So, using /etc/passwd as an example... philip:*:1000:1000:Philip Hallstrom:/local/home/philip:/bin

Re: [PHP] Re: php equivalent for cut

2005-09-06 Thread Philip Hallstrom
Am 2005-09-06 12:18:18, schrieb [EMAIL PROTECTED]: $etcpasswd = username:passwd:123:345::/home/username:/bin/sh; $pwdarr = explode(:, $etcpasswd); echo $pwdarr[4]; OK, this works now. But can I read a whome /etc/passwd into an 3d array ? This would avoid multiple reads... I know, that I can

Re: [PHP] Session expires randomly

2005-09-06 Thread Philip Hallstrom
On Tue, 6 Sep 2005, Mauricio Pellegrini wrote: You were right! That was exactly the problem after reading your message, I 've verified the value for gc_maxlifetime and found that it was set to 1440 secs in other words 24 minutes. Thank you for that. But, now I need to come up with something

Re: [PHP] intval() vs. (int)

2005-09-02 Thread Philip Hallstrom
On checking form fields that they are of type int, what is best to use: intval() or type casting (int)? In terms of speed, would (int) not be better, because we save a function call (especially on very large sql statements)? Time it. On an 800mhz box doing absolutely nothing else (it's just

Re: [PHP] Session expires randomly

2005-09-02 Thread Philip Hallstrom
On Fri, 2 Sep 2005, Mauricio Pellegrini wrote: Hi, I have this problem , When I start a Session everything seems to be ok but sometimes with no reason the session vanishes. I'm using PHP 4.3.4 as a Apache module. Apache version is 1.3 under Suse Linux 8.2 All settings are default , I mean

Re: [PHP] session cookies

2005-09-02 Thread Philip Hallstrom
Rasmus Lerdorf wrote: That's a bit misleading. The HTTP response headers are sent a soon as you output something from your script (calling header() or setcookie() doesn't count as output, so you can set all the headers and cookies you want). They're sent to Apache, but that doesn't mean

Re: [PHP] Content - strip...

2005-09-02 Thread Philip Hallstrom
Hi there! Anyone that has an easy solution to this? I have a string filled with content. A lot of content is before Jumping Jack flash I want the $content - string to start at Jumping Jack flash Is there any smart way of doing this? Use strstr() to find the first occurence of Jumping Jack

Re: [PHP] need information on sending email using php

2005-09-02 Thread Philip Hallstrom
I am new to php. I am going to be setting up a page that has a form on it. When the user clicks on submit an email should be sent with the contents of the form. My question is How do I do that? the webserver that I will be placing this page on has php ver 4.4.0 on it. Any help would be

Re: [PHP] Saturdays and Sundays

2005-09-01 Thread Philip Hallstrom
Is it possible to get the number of saturdays and sundays for a given month / year? This seems to work... ?php $month = 9; $year = 2005; $day = 1; $ts = mktime(0, 0, 0, $month, $day, $year); $week_day = date(w, $ts); // 0 (for Sunday) through 6 (for Saturday) if ( $week_day 0 $week_day

Re: [PHP] CookieMonster

2005-09-01 Thread Philip Hallstrom
Simple question I guess.. How do I set a cookie so it will never expire? (I don't want it to expire) You can't really... I could delete it and that would be the same as expiring it... Best you can do is set it to expire 100 years in the future or some such... see the manual for SetCookie()

Re: [PHP] CookieMonster

2005-09-01 Thread Philip Hallstrom
the number of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If not set, the cookie will expire at the end of the session (when the browser closes). Jason On 9/1/05, Philip Hallstrom [EMAIL PROTECTED] wrote

Re: [PHP] Port 443

2005-09-01 Thread Philip Hallstrom
Using an API for an Ecomemrce app. Wondering how I can ensure I have access to port 443 and that it's open? use fsockopen() to open a socket connection to the host on port 443. You should at least connect... if it fails to connect, it's not open... -philip -- PHP General Mailing List

Re: [PHP] session cookies

2005-09-01 Thread Philip Hallstrom
Is there a way, using PHP, to determine if session cookies are enabled (or disabled) in the user's browser privacy settings? Set a cookie using setcookie(). Then use an HTML meta refresh (or javascript, just not Header(Location...) to redirect them to another page. On that page, see if the

Re: [PHP] session cookies

2005-09-01 Thread Philip Hallstrom
Philip Hallstrom wrote: Then use an HTML meta refresh (or javascript, just not Header(Location...) to redirect them to another page. Why not header(Location...)? Just out of interest -- it's always worked for me, and it's a much better way to redirect users for many reasons[1] (like

Re: [PHP] String format problem

2005-08-31 Thread Philip Hallstrom
hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code ? $Text = D:\AppServ\www\intranet\admin\store\nodirectory\sub; $Replace = D:\AppServ\www\intranet\admin\store; $with = http://localhost/bank/admin/store;; //$doc =

Re: [PHP] weird results from imagettfbbox()

2005-08-31 Thread Philip Hallstrom
I have an array of strings in which I am passing to imagettfbbox() in order to calculate the height of the text box for each string. I am then subtracting the height from the y position in order to deviate the pivot point form the top left corner to the bottom left corner when I used

Re: [PHP] displaying certain number of character

2005-08-30 Thread Philip Hallstrom
$words= If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative). If start denotes a position beyond this truncation, an empty string will be returned. ; echo substr($words, 0,

Re: [PHP] read directory and paginate

2005-08-26 Thread Philip Hallstrom
A little while back there was a post where someone needed to read all files (images/thumbs) from a gallery and paginate them automatically, I cannot find the thread in the archive but if anybody can point me to the thread or knows how the poster solved his problemplease reply as i need

Re: [PHP] Sort table by column and pagination

2005-08-26 Thread Philip Hallstrom
We have quite a complex product all written in PHP and our own mySQL wrapper. We initially wanted to use smarty, but due to time constraints, we couldn't re-write everything, so it never got implemented. Two feature requests we get a lot are the ability to sort the tabular data by column heading

Re: [PHP] PHP vs. ColdFusion

2005-08-24 Thread Philip Hallstrom
It's too bad you have to use Windows and IIS. Just curious but why are they not wanting to use Linux? Do they know it's free and way less likely to be attacked? I've made this argument numerous times. Management seemed to be receptive, and I thought they were starting to change their

Re: [PHP] parsing useragent string without get_browser

2005-08-24 Thread Philip Hallstrom
I've done a google and can't find anything on this. I want to parse a long list of useragent strings for a web analysis script I am writing. I could use get_browser, but firstly this would slow down my script quite a bit and secondly I am relying on the browscap.ini file of the newness of

Re: [PHP] syntax for two comparison operators

2005-08-24 Thread Philip Hallstrom
Is there a technical reason why PHP does not allow comparison operator expressions like the following: if (2 $x = 4) {} I prefer this concise way as it is common for mathematics expressions, and much easier to grasp physically on first glance. From what I can tell, this expression can

Re: [PHP] Files passing through

2005-08-23 Thread Philip Hallstrom
Benchmark it both ways and see. I benched this with a 100 MiB text file (largest I could find at short notice). Buffer used for fread() calls was 2 KiB as above. Values are averaged over 100 runs (I would have liked to do more, but I don't have time). All values are to 4 significant

Re: [PHP] Files passing through

2005-08-22 Thread Philip Hallstrom
What is the fastest way to do this? I know echo(file_get_contents('myfile')); is not a good idea ;) Why not? My guess would be because file_get_contents returns the contents as a string. So if 'myfile' is 100mb, you're going to have to allocate 100mb of memory to store that string while

Re: [PHP] Week Days

2005-08-19 Thread Philip Hallstrom
All you need is the mktime() command. do something like: $futureDate = date(Y-m-d, mktime(0, 0, 0, $month, $today+ $daysToAdd, $year)); Jordan http://www.php.net/mktime mktime() is useful for doing date arithmetic and validation, as it will automatically calculate the correct value for

Re: [PHP] Week Days

2005-08-19 Thread Philip Hallstrom
Easy enough to change that date(...mktime(...)) command above to return the weekday and while the weekday is a weekend just add a day and repeat. Actually sorry to post again on the same post, but this is like the first solution posted and is invalid since it doesn't account for non-weekdays

Re: [PHP] Re: previous + next buttons, no DB

2005-08-18 Thread Philip Hallstrom
Ashley, How are you creating the gallery page? You must be reading the filenames in the directory and producing an img for each one. Can you create an array of those filenames, save it to session (or generate it each time), and iterate through them? Say the images are in a folder

Re: [PHP] one more mysql question

2005-08-12 Thread Philip Hallstrom
I apology for mysql question posted here, but, as I said once, I like you guys more! :) have two tables: orders and special_orders. foreign key is trans_no. I can't figure it out how to create a query that pulls orders from the orders tables that are NOT in special_orders table? I can never

Re: [PHP] Re: possible bug (string equality to zero)?

2005-08-11 Thread Philip Hallstrom
No, Christopher, that is not a bug. As long as the var is empty, and if you try to compare with 0, or false, it will report true in the comparison because the variable does not contain anything, which will mean false for a boolean and 0 for a variable. If you are attempting to discover if a

Re: [PHP] Blatantly Evil Question

2005-08-11 Thread Philip Hallstrom
robots.txt will not do what you want it to. Just sniff for those robots' User-Agents (Google, MSN and Yahoo all publish their UA strings on their websites, AFAIK) and send different content if it's one of those. they will hammer you for it eventually - AFAICT all major SEs send out their

Re: [PHP] graph - dowloads/hr

2005-08-09 Thread Philip Hallstrom
i'd like to create a graph with the amount of downloads per hour, i am a little confused how i should go about this. i know i can use rrdtool/mrtg, but im looking for more 'user friendly' graphs with custom colors,etc. each time someone downloads a file it is incremented in the db and the

  1   2   3   4   5   >