RE: [PHP] Variable naming

2001-09-25 Thread Adam Plocher
$id = 1; ${"sql_" . $id} = "hey"; print $sql_1; Try that -Original Message- From: Kyle Moore [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 9:15 AM To: [EMAIL PROTECTED] Subject: [PHP] Variable naming I want to use the value of a variable in a variable name. For instance

RE: [PHP] How to obtain all the fields' names of a MySQL table?

2001-09-25 Thread Adam Plocher
How about this... $db = "name_of_database"; $query = "DESCRIBE table_name"; $query = mysql_db_query($db,$query); while ($row = mysql_fetch_row($query)) { echo "$row[0]\n"; } -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 12:03 PM

[PHP] single dimensional array questions

2004-08-04 Thread Adam Williams
Here is my snippet of code. It takes cardnum from the database, removes the duplicates for each individual date, and then counts how many discrete numbers there was. //database connect and selection here, now my sql statement: $sql = "select convert( varchar,eventime, 110) as date, cardnum f

[PHP] opposite of array_unique()?

2004-08-04 Thread Adam Williams
array_unique() removes duplicate values from an array. Is there an opposite function or way of keeping all values in a single dimentional array that are duplicates and removing all that are duplicates? for example if I have an array: array( [0] => 'dog', [1] => 'cat', [2] => 'rabbit', [3] => '

[PHP] fopen and http://

2004-10-08 Thread Adam Williams
Hi, I'm having a problem with fopen and http files. I keep getting the error: Warning: fopen(http://zed/htdocs/rgfindingaids/series594.html ) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15 http://zed

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Matt M. wrote: > > But I don't understand why I am getting that error about failed to open > > strem: HTTP request failed, when I can bring up the links fine in a > > browser on the server running the php script. So can anyone help me out? > > Thanks > > do you have allow_url

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Hendrik Schmieder wrote: > What say phpinfo about Registered PHP Streams ? > >Hendrik > > Hi, I think I just figured out my problem...I had to use rtrim($line) because I think there was a \n or an invisible character at the end of the line that was being passed to

Re: [PHP] Trre/Drop Down quick app for testing database tbls

2008-11-28 Thread Adam Lewis
2008/11/28 Adam Lewis <[EMAIL PROTECTED]> > > > 2008/11/28 bruce <[EMAIL PROTECTED]> > > Hi. >> >> I've got a few tbls that I'm testing. I'd like to have a simple web app to >> be able to iterate through the tbls to test out what I h

[PHP] Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
e document into smaller single or multipage documents. Has anyone ever heard of anything that might help me in this process? Adam. -- Adam Randall AIM: blitz574 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
Are you referring to a project, class, or just generally curious about what I'm asking? Barcode reader can be many things, including a scanning wand (not applicable to what I am looking for). On Wed, Dec 17, 2008 at 3:47 PM, Robert Cummings wrote: > On Wed, 2008-12-17 at 14:56 -08

Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
This completely internal, and highly sensitive. Also, the documents themselves will different every time likely as they can either be faxes with who knows what type of skewing/quality/orientation. I need to be able to read them and find out what the barcodes are, if any. Adam. On Wed, Dec 17

Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
I would have thought so too, but haven't found anything yet. Maybe there is an answer there (I have Imagick installed for example). iText, a java utility, has the ability to write barcodes nicely to PDF, too bad that there's no some reverse there either. Adam. On Wed, Dec 17, 2008 at 4

Re: [PHP] Re: Read/decode barcodes from an image

2008-12-17 Thread Adam Randall
Yeah, I have played with JOCR/GOCR, but it seemed somewhat inaccurate. Does anyone have any examples of working with it in code so that I can figure out how to incorporate it into my solutions? Adam. On Wed, Dec 17, 2008 at 5:17 PM, Bastien Koert wrote: > On Wed, Dec 17, 2008 at 7:42 PM,

[PHP] help with end of line charater

2009-01-30 Thread Adam Williams
I have staff inputting email addresses into a named $list on a form and when they click submit, my php script sorts the email addresses and writes to disk. The problem is, lets say they enter the email addresses b...@mdah.state.ms.us ama...@mdah.state.ms.us sa...@mdah.state.ms.us j...@mdah.s

Re: [PHP] Re: help with end of line charater

2009-01-30 Thread Adam Williams
Shawn McKenzie wrote: This may be best handled in your sorting code. What does it look like? yeah just a second ago a big lightbulb went off in my head and i fixed my code to add a \r\n on saving, and strip it on viewing. I sort on viewing, not sort on saving. The viewing code looks lik

[PHP] header() and passing sessions

2009-04-15 Thread Adam Williams
I need some help passing a session variable with a header() function. According to www.php.net/header, the documentation states: *Note*: Session ID is not passed with Location header even if session.use_trans_sid is enabled. It must by passed manually using *SID* constant. so, I'm trying

Re: [PHP] header() and passing sessions

2009-04-15 Thread Adam Williams
abdulazeez alugo wrote: Hi, Well I'ld say the reason is quite obvious. You have simply not set $_session["username"] . I'ld have done something like: -- option.php -- header('Location: http://intra.mdah.state.ms.us/helpdesk/viewpending.php?PHPSESSID='.SID); //

Re: [PHP] GIS with PHP tutorial

2009-04-15 Thread Adam Williams
have you looked into this? http://postgis.refractions.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] php isn't displaying mysql query correctly

2009-04-17 Thread Adam Williams
I have the code: $mysqli_get_support_types = "Select types from support_types order by types"; $mysqli_get_support_types_result = mysqli_query($mysqli,$mysqli_get_support_types) or die(mysqli_error($mysqli)); while (mysqli_fetch_array($mysqli_get_support_types_result)) { echo "

Re: [PHP] php isn't displaying mysql query correctly

2009-04-17 Thread Adam Williams
Shawn McKenzie wrote: No. How about: while ($row = mysqli_fetch_array($mysqli_get_support_types_result)) { echo "".$row['types']; } thanks, now that you provided that, I see that I left out the $row variable! -- PHP General Mailing List (http://www.php.net/) To uns

[PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Is there a way to determine if a mysql query returns an empty set? I am selecting 10 results at a time with a limit statement and need to know when i've ran out of rows. I've only got 2 rows in the database, so when I start with row 10, it returns an empty set. I have the following code: /

Re: [PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Nitsan Bin-Nun wrote: mysql_num_rows() maybe? if not I probably haven't understood your question. Thanks, I never thought of trying that. This code works! $mysqli_get_requests = mysqli_query($mysqli,$get_requests); if (!mysqli_num_rows($mysqli_get_requests))

Re: [PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Andrew Ballard wrote: It won't be any of those because the query is successful even if it returns no records. You could use http://us2.php.net/manual/en/mysqli-stmt.num-rows.php to determine how many rows were returned. Andrew Oh ok, thanks that makes sense. Thanks for the link also --

[PHP] help with explode()

2009-04-24 Thread Adam Williams
I have a form where users submit search terms and it explodes the terms into an array based upon spaces. But, how can I have explode() keep words in quotation marks together? For example, if someone enters on the form: John Jill "Judy Smith" and I run $termsarray = explode(" ", $_POST["term

Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
Jan G.B. wrote: You could try it with regular expression matching.. for example: Regards Thanks. That seems to create 2 duplicate arrays, though. Can it be narrowed down to just array [0]? preg_match_all('/([a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray); echo $_POST["terms"]."

Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
Jan G.B. wrote: Yes, preg_match_all returns all matches and the subpattern matches (the "stuff" inside the brakes) You can ommit stop it by using (?:) instead of ().. So: preg_match_all('/(?:[a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray) You might want to check out the regular expression

Re: [PHP] I need ideas for things to code

2009-04-24 Thread Adam Williams
Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it. I'm currently writing an in-house PHP helpdesk ticket system. I looked at all the open source ones i

Re: [PHP] SMTP mail server

2009-04-24 Thread Adam Williams
Ron Piggott wrote: How do I specify an actual SMTP server? (Like mail.host.com) This is what I have so far: mail($email, $subject, $message, $headers); I was to http://ca2.php.net/manual/en/function.mail.php and saw this syntax: mail ( string $to , string $subject , string $message [, stri

[PHP] graphical integrated development environment recommendations?

2009-05-01 Thread Adam Williams
With the wide range of users on the list, I'm sure there are plenty of opinions on what are good graphical IDE's and which ones to avoid. I'd like to get away from using notepad.exe to code with due to its limitations. Something that supports syntax/code highlighting and has browser previews

[PHP] fixing new lines from in an email?

2009-06-26 Thread Adam Williams
I have staff fill out a form that contains a with their problem description and emailed to me when they click submit. Staff will press enter in the text area, but I'm having problems converting the \r\n into a new line in the email that is sent to me, here is the code: $subject = "new suppor

Re: [PHP] fixing new lines from in an email?

2009-06-26 Thread Adam Williams
Daniel Brown wrote: In a cursory glance, I've noticed the following code: htmlspecialchars(nl2br(str_replace('\r','',$_POST["problem"]))) You are using a literal '\r' in your str_replace() function. This should instead be replaced with double quotes to translate the \r to its appropr

Re: [PHP] Split up Date Range

2009-07-01 Thread Adam Shannon
09 and 8/20/2009 but > > I think its as safe as any assumption that "regular people" wouldn't > > enter that as a date range. > > > > If you have more than three elements then split on the dash and as > > long as you have have only two elements then

Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Adam Shannon
upported? > > > > Thanks! > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] Re: RFC/Survey for Our Newer Folks (Including Lurkers)

2009-07-11 Thread Adam Shannon
ds. I found the list by the link on php.net (lists.php.net), I mainly joined to grow in my experience with PHP. -- - Adam Shannon ( http://ashannon.us )

[PHP] running php script as a user?

2009-07-15 Thread Adam Williams
I have a page where a user authenticates, fills in some information in an HTML form, and then when clicking on the submit button, will need to execute a php schell script as that user to write some data to their /home/username directory. Since apache web server runs as the user nobody, how wil

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-18 Thread Adam Shannon
On Sat, Jul 18, 2009 at 7:54 PM, Govinda wrote: > > On Jul 18, 2009, at 6:36 PM, Adam Shannon wrote: > > > > On Sat, Jul 18, 2009 at 7:01 PM, Govinda wrote: > >> Hi all, >> >> ..sitting here thinking this is so easy, and I must have been over this >>

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-18 Thread Adam Shannon
e telling .html files in a /sub/directory/ to treat .html files as .php Just add this to your root .htaccess AddType x-mapp-php5 .html > > Thank you > -Govinda > > > > > Govinda > govinda.webdnat...@gmail.com > > -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Adam Shannon
mselves. It's certainly the > de-factor standard that .html files only contain flat markup, but > that's by no means a rule or anything, but it's common practice > (mostly because programmers are lazy). > > Sorry if I sound rude, just quit smoking :) > --Eddie > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Eddie your exactly right, changing file MIME types is often used for security and protection. It is harder to know what is behind the "show" when you don't visually expose it. (A simple curl will give you the HTTP headers often with PHP as a/the agent.) -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Adam Shannon
; > what does this one ^^^ do exactly ? It turns off the "Powered By: PHP v5.30" on Apache/IIS Error messages. > > > * You turn display_errors off in your php.ini >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] Server change affecting ability to send downloaded files???

2009-08-07 Thread Adam Randall
at's going on in the ../../store/files path. Adam. On Fri, Aug 7, 2009 at 5:05 PM, Brian Dunning wrote: > Correct, the files on the server have not changed either, and have been > working fine for a long time. No funny characters. > > On Aug 7, 2009, at 4:59 PM, Adam Randall wrote: >

Re: [PHP] Undefined symbol "ssl_onceonlyinit"

2009-08-08 Thread Adam Randall
brary I'm expecting is not in the shared library I am using). You know, looking at the error messages that you posted again I now realize that the incompatability is not between imap and php, but imap and /libexec/ld-elf.so.1. That's where you need to look it seems. Adam. On Sat, Aug 8,

Re: [PHP] reason for a "Notice:.." on one site but not another? (Same code.)

2009-08-10 Thread Adam Randall
That should be !== not !=== Adam. On Mon, Aug 10, 2009 at 12:17 PM, Ralph Deffke wrote: > for the same story there are the -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Adam Randall
http://us3.php.net/manual/en/language.operators.comparison.php Find "Ternary" on that page. It's a shortened conditional: cond ? true : false Adam. On Mon, Aug 10, 2009 at 6:27 PM, John Butler wrote: >>  echo "something " . (($a = $a^1) ? "red\n" :

Re: [PHP] Re: how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Adam Randall
No...not zerowing...no... But yes, the ternary operator is the bomb, which you can get carried away with. Daevid knows what I mean :) Adam. On Mon, Aug 10, 2009 at 6:59 PM, Daevid Vincent wrote: > Pretty much the best operator ever invented IMHO. And Since PHP 5.3, it is > possible to lea

Re: [PHP] Sending email w/ attachments

2009-08-10 Thread Adam Randall
Funny, I just had to figure out today how to nicely do HTML e-mails. I ended up using PEAR:Mail_mime, and it worked pretty well. It will also work for your attachments. I believe that PHP itself recommends it on their mail() function reference page. Adam. On Mon, Aug 10, 2009 at 6:49 PM, Skip

Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Adam Shannon
er("Content-Type: image/png"); > header("Pragma: no-cache"); > header("Expires: 0"); > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Take the if (!headers_sent()) out and always send the headers. -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] Include Paths

2009-08-12 Thread Adam Shannon
20 records has suddenly turned > into > something of a matter of a minute rather then seconds. > > Has anyone ever experienced such an issue? > > Can anyone please advise? > > Thanks I wonder if loading the script/page with an absolute path would fix the problem. -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] Sanitizing mysql inserts of user data

2009-08-16 Thread Adam Randall
same. You should in pretty much all cases be safe with just using the mysql_real_escape_string, which takes care of the - for you as well. Adam. On Sun, Aug 16, 2009 at 11:42 AM, Dotan Cohen wrote: > I am sanitizing user-entered data before storing in mysql with this function: > > functi

Re: [PHP] to a css file requires .css ???

2009-08-16 Thread Adam Shannon
ce, > dK > ` > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Oh, I think it's part of the spec. You could always use .htaccess rules to parse .css files as .php, this will keep search engines happy and browsers happy as well. -- - Adam Shannon ( http://ashannon.us )

Re: [PHP] Form Spam

2009-08-20 Thread Adam Randall
know that since it looks like it was sent :) That's assuming that they were able to figure out the math question before hand. Maybe not fort knox, but it does help out for me at least. Adam. On Thu, Aug 20, 2009 at 6:11 AM, Gary wrote: > I have a client with a form on his site and he

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-20 Thread Adam Randall
echo "sum=7 or 6\n"; break; case 1: case 2: echo "sum=2 or 1\n"; break; case 0: echo "sum=0\n"; break; default: echo "sum=3/4/5\n"

[PHP] Help: DOMXPath->Query, quotes and apostrophes

2007-03-15 Thread Adam Randall
at the data be unencoded to work. I've seen reference to using XSLT to set XPath variables instead, but I don't understand how to do implement this. I would really appreciate any examples on what people have done to get around this issue, if any one has at all. Regards, Adam. -- Adam

[PHP] Best way to test for form submission?

2009-08-28 Thread Adam Jimerson
This question might give away the fact that I am a php noob, but I am looking for the best way to test for form submission in PHP. I know in Perl this can be done with if (param) but I don't know if that will work with PHP. I have read the Learning PHP 5 book and the only thing that was mention

[PHP] Re: Best way to test for form submission?

2009-08-28 Thread Adam Jimerson
On 08/27/2009 11:09 PM, Adam Jimerson wrote: > This question might give away the fact that I am a php noob, but I am > looking for the best way to test for form submission in PHP. I know in > Perl this can be done with > > if (param) > > but I don't know if that will w

[PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
I have users enter support tickets into a a form and then it emails it to me, I'm trying to get the emails to display when they hit enter correctly, so i'm changing the \r\n to , but in the email i'm getting, its displaying the instead of a line break: here is the code: $message = "new supp

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
Thanks, i'll try that. what is the difference in using '' and ""? I thought they were interchangeable. Jonathan Tapicer wrote: \r\n should be between double quotes: "\r\n" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
oh nevermind, i see double quotes translate the \r\n to its appropriate EOL character. Adam Williams wrote: Thanks, i'll try that. what is the difference in using '' and ""? I thought they were interchangeable. Jonathan Tapicer wrote: \r\n should be bet

[PHP] COM Help (hopefully)

2009-10-09 Thread Adam Randall
05 doesn't seem to think much of it :) While I could go with a VB solution for doing the address scrubbing, I had wanted to set it up in PHP so that I could open one COM connection to the DLL, and then via database burn through a large number of addresses. If I had the skills I'd also rather just create an extension for PHP itself that is a wrapper for the ZP4 DLL. If someone is interested in building that for my company on commission I'd love to discuss that with you. If anyone wants to help me with this I'd greatly appreciate it. Regards, Adam. -- Adam Randall http://www.xaren.net AIM: blitz574 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] security/deployment issue

2009-10-16 Thread Adam Randall
match for the UID and GID then it will just display the UID or GID number. Adam. On Fri, Oct 16, 2009 at 1:13 PM, Augusto Flavio wrote: > Humm.. thanks for the replies. But i have another problem about rsync again. > > > > When i deploy a project using the rsync the permissions of

Re: [PHP] How is this possible?

2009-10-28 Thread Adam Randall
es). If you want to do basic sanitization to your incoming values, such as trimming them, you can do something like this too: foreach( $_GET as $k => $v ) $$k = trim( $v ); None of this is best practices, FYI. Adam. On Wed, Oct 28, 2009 at 10:29 AM, David Otton wrote: > 2009/10/28 tedd :

Re: [PHP] =??Q?Esco=AE?= Frontier Acela High Performance Fume Hoods

2009-11-03 Thread Adam Randall
l Pharmacy >> Isolators<http://escoglobal.com/products/hospital-pharmacy-products/detail.php?id=HPI-N>I >> IVF >> Workstations <http://escoglobal.com/products/ivf-workstations/> I Lab >> Animal Research >> Products<http://escoglobal.com/products/lab-an

Re: [PHP] Checkbox in PHP form

2009-11-10 Thread Adam Randall
value="PFDs" name="f_sequipment1">PFDs Or with short tags: value="PFDs" name="f_sequipment1">PFDs Adam. On Sun, Nov 8, 2009 at 5:39 PM, Ernie Kemp wrote: > Need some help here with checkboxes in an html form. > > > > My issue is

Re: [PHP] Re: Checkbox in PHP form

2009-11-10 Thread Adam Randall
On Sun, Nov 8, 2009 at 9:52 PM, Brian Hazelton wrote: > 'no') { echo "checked="checked";  } ?> value="PFDs" > name=f_sequipment1>PFDs > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.

Re: [PHP] Help needed with calculation

2009-11-15 Thread Adam Shannon
php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- - Adam Shannon ( http://ashannon.us ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] DailyWTF - Maybe I Needing Later

2009-12-23 Thread Adam Randall
to know that the guys making your bridges more earthquake resistant are the ones who are the cheapest. Adam. On Wed, Dec 23, 2009 at 7:34 AM, John Meyer wrote: > On 12/22/2009 9:10 PM, Daevid Vincent wrote: > >> http://thedailywtf.com/Articles/Maybe-I-Needing-Later.aspx >> >&g

Re: [PHP] Unable to get output from exec "ssh remote-server 'ping -c4 ip'"

2009-12-29 Thread Adam Randall
$host . ' \>/dev/null 2\>\&1 \&\& echo "Alive"' ) ) == 'Alive'; var_dump( $alive ); I use a variant of the above with good success on Gentoo. Adam. On Sun, Dec 27, 2009 at 1:53 PM, robert mena wrote: > Hi, > > I need to develop an interface

Re: [PHP] Formatting Decimals

2010-01-11 Thread Adam Richardson
On Mon, Jan 11, 2010 at 7:45 PM, Mattias Thorslund wrote: > tedd wrote: > >> At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: >> >>> I have been asked to further modify the value to the nearest half cent. >>> >>> So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 >>> If it ends in 3,

Re: [PHP] strtotime

2010-01-14 Thread Adam Richardson
When you set the date to "-00-00", you start the following sequence: 1. strtotime returns false, because "-00-00" isn't a date it can parse into a timestamp. 2. date returns 1969, because it's not passed a valid timestamp and it works from December 31, 1969 for any invalid dat

Re: [PHP] strtotime

2010-01-14 Thread Adam Richardson
valid date lets you easily identify an error. Again, I didn't read this anywhere, though, and I could be wrong. Adam On Thu, Jan 14, 2010 at 3:47 PM, Kim Madsen wrote: > Hi guys > > I have a question: > > > Ashley Sheridan wrote on 14/01/2010 19:20: > > MySQL use

[PHP] PHP 5.3 shared hosting

2010-01-15 Thread Adam Richardson
ing hosts about their shared hosting options, and I've only found a couple that accommodate PHP 5.3 so far. Anybody have recommendations for shared hosting providers that are supporting php 5.3 (many of the smaller sites I'm working with don't merit a VPS?) Thank you very much for

Re: [PHP] Cookies & sessions

2010-01-19 Thread Adam Richardson
On Tue, Jan 19, 2010 at 12:42 PM, Paul M Foster wrote: > On Tue, Jan 19, 2010 at 10:06:26PM +1100, clanc...@cybec.com.au wrote: > > > I am trying for the first time to use cookies. The manual contains the > > statement "Cookies > > are part of the HTTP header, so setcookie() must be called before

Re: [PHP] PHP 5.3 shared hosting

2010-01-20 Thread Adam Richardson
On Fri, Jan 15, 2010 at 6:25 PM, Michael A. Peters wrote: > Adam Richardson wrote: > >> Hi, >> >> I've developed a framework that requires PHP 5.3 (it takes a more >> functional >> approach.) I'm hosting my own apps on a dedicated server run

Re: [PHP] Re: http vs https

2010-01-23 Thread Adam Richardson
, so make sure you test it out well. Adam On Sat, Jan 23, 2010 at 12:44 PM, Nathan Rixham wrote: > Ben Miller wrote: > > Is there a PHP function that will return whether the request was http or > > https? I have functions that need to cURL other servers - sometimes over >

Re: [PHP] help with preg_replace pattern

2010-01-26 Thread Adam Richardson
ensitivity fix is not just a matter of making > the letter capitals. I'm sure someone who knows more than I about > preg_replace will see the > immediate error of my ways. Any advice is greatly appreciated. > > > > > > Your regex is looking for case-sensitive match

Re: [PHP] Appalling Dreamweaver performance

2010-01-31 Thread Adam Richardson
issue, but I pointed it out just in case it was contributing to your pain. Adam On Sun, Jan 31, 2010 at 8:02 PM, Allen McCabe wrote: > Notepad++ also has session saving capabilities. This means you can save > which files you're working on, close Notepad++, and reload those files a

Re: [PHP] Facebook PHP compiler

2010-02-02 Thread Adam Richardson
Looks very promising !!! On Tue, Feb 2, 2010 at 1:12 PM, Robert Cummings wrote: > Cesar D. Rodas wrote: > >> Hello, >> >> Have you guys checked this PHP to C++ converter from the Facebook People? >> >> http://developers.facebook.com/news.php?blog=1&story=358 >> > > Very interesting... I heard abo

Re: [PHP] session variables and SVG documents

2010-02-03 Thread Adam Richardson
tangle test'; > > > > > > > > > for ($i = 0; $i < 20; $i++) { > > > > > >$x = floor(rand(0,$svgwidth-1)); > > >$y = floor(rand(0,$svgheight-1)); > > >$width = floor(rand(0,$svgwidth-$x)); > > >

Re: [PHP] PHP will NOT display this on my dev machine: Warning: session_start()...

2010-02-11 Thread Adam Richardson
Do you have output buffering turned on? On Thu, Feb 11, 2010 at 1:19 PM, John Black wrote: > I am running into a strange problem and I hope someone might have an > idea why this is happening. > > My installation of PHP will *NOT* display the warning message below on my > development machine where

Re: [PHP] array conversion

2010-02-18 Thread Adam Richardson
Or, function new_arr(array $arr) { $count = count($arr); if ($count % 2 != 0) throw new Exception('The new_arr() function requires an even number of elements.'); for ($i = 0; $i < $count; $i += 2) { $new_arr[$arr[$i]] = $arr[$i + 1]; } return $new_arr; } $test = ne

Re: [PHP] Re: Pre/Post inc (Was array conversion)

2010-02-20 Thread Adam Richardson
not the increment operator, itself. >> $b[$a[$i++]] = $a[$i++]; // *** It's actually quite a clever implementation of the algorithm request that prompted this thread, and because of it's uniqueness, (incrementing a variable multiple times within the same statement on both sides of the '='), I don't this reflects that Clancy "stopped to learn the very basics of PHP." Actually, Clancy taking the time to try something to better learn the language (just for the sake of coding fun, no less) reflects the desire to learn new things, and that's exactly the type of person I hope is drawn to the PHP community. Thanks for the example, Clancy :) Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

Re: [PHP] HipHop and other PHP compiler performance evaluation

2010-02-24 Thread Adam Richardson
Really nice article, Manuel. Thanks for writing and sharing the link. Adam On Wed, Feb 24, 2010 at 11:14 AM, Manuel Lemos wrote: > FYI > > http://digg.com/programming/PHP_compiler_performance > > -- > > Regards, > Manuel Lemos > > Find and post PHP jobs &g

Re: [PHP] When to use namespaces

2010-03-01 Thread Adam Richardson
sert(); Just a quick couple thoughts on the decision. Both have their strengths :) Adam On Mon, Mar 1, 2010 at 11:14 AM, Auke van Slooten wrote: > Hi everyone, > > I'm doing a small hobby project to better my understanding of php5, > specifically php5.3 and I'm wondering when

Re: [PHP] When to use namespaces

2010-03-02 Thread Adam Richardson
Thanks, Richard, I wasn't aware of that function. Another nice option. On Tue, Mar 2, 2010 at 6:18 AM, Richard Quadling wrote: > On 1 March 2010 19:34, Adam Richardson wrote: > > I use namespaces within my web framework because the framework takes a > more > > function

Re: [PHP] PHP: inexplicable behaviour of pre- and post-increment operators

2010-03-02 Thread Adam Richardson
Thanks for taking time to provide the examples, Clancy, I'll know what potential pitfalls to wary of now :) On Fri, Feb 26, 2010 at 11:01 PM, wrote: > A week ago Dasn asked a question about converting arrays, and I quoted one > possible way of > achieving his task, using the operation: > > $i =

Re: [PHP] EHLO error 554: what can it be?

2010-03-09 Thread Adam Richardson
ling List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I learned something and chuckled at the same time. Thanks for the info, Kevin. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

Re: [PHP] php string syntax question with html

2010-03-10 Thread Adam Richardson
Try this: ''; On Wed, Mar 10, 2010 at 7:15 PM, David Mehler wrote: > Hello, > I've got what is probably a very simple question, probably something > having to do with quotes single vs. double, but the answer is > frustrating elusive, I keep getting a syntax error. > I'm trying to customize a wo

Re: [PHP] $_GET is Mangling Base64 value

2010-03-11 Thread Adam Richardson
On Thu, Mar 11, 2010 at 4:57 PM, George Langley wrote: >Hi all. Is there an issue with $_GET not handling a Base64-encoded > value correctly? (PHP is 5.1.6) >Am receiving a Base64-encoded value: > > theurl.com/index.php?message=x > > and retrieving it with $_GET: > > echo $_GE

Re: [PHP] Re: PHP in HTML code

2010-03-16 Thread Adam Richardson
can use simple message passing capabilities in Scala or transactional memory in Clojure to perform tasks in parallel as opposed to the olden days of dealing with threads in Java? When I can type less, maintain clarity, and perform the same action, I consider it an act of beauty. When you compare

Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Adam Richardson
On Thu, Mar 18, 2010 at 11:28 AM, tedd wrote: > At 9:34 AM + 3/18/10, Pete Ford wrote: > >> >> I do tend to use > camp here. >> > > > Whoa, that's even worse -- make a choice and stick with it -- IMO. > > I'm all for consistency and have often found myself redoing dozens of > scripts because

Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Adam Richardson
/nowdoc isn't recognised as XML by any > editor I know of. All of that to avoid writing a few extra characters to > "save myself some work"... > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > - 310 characters. - Differentiation between

Re: [PHP] web sniffer

2010-03-18 Thread Adam Richardson
On Thu, Mar 18, 2010 at 6:03 PM, madunix wrote: > I've been trying to read the contents from a particular URL into a > string in PHP, and can't get it to work. any help. > > Thanks > > -- > If there is a way, I will find one...*** > If there is none, I will make one..."*** > mad

Re: [PHP] web sniffer

2010-03-18 Thread Adam Richardson
On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan wrote: > On Fri, 2010-03-19 at 00:11 +0200, madunix wrote: > > trying http://us3.php.net/manual/en/function.fsockopen.php > > do you a piece of code that read parts pages. > > > > > > On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan > > wrote: >

Re: [PHP] Example of good PHP namespace usage?

2010-03-19 Thread Adam Richardson
o see how I'm using namespaces for my project. The framework takes a largely functional approach, so some of the Object-naming conventions aren't present, but you still might see some things you like (or hate.) It seems to work well with Netbeans (I haven't tried other IDE's.) ht

Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Adam Richardson
e any database calls that you > think might throw up any issues. I believe the Pear module supports all > the mysql functions, but there might be issues if you want to change the > back end at some point in the future. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > >

Re: [PHP] Session Variable Problem

2010-03-20 Thread Adam Richardson
ariable present, which means if (isset($_POST['lend_fname'])) { $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); } Also, some users will likely click the back button during the process, which brings up a funky message. You might try building one page that is dedicated to saving all of the session variables, which then redirects to the corresponding next page in the process. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

Re: [PHP] Session Variable Problem

2010-03-20 Thread Adam Richardson
On Sat, Mar 20, 2010 at 6:56 PM, Gary wrote: > Adam > > Thank you for your reply. > > ""Are you checking to see if the post variable is set in the code that > handles saving the form values to session variables? "" > > No, I not done anything ab

Re: [PHP] Re: Pulling my hair out over an include_once();

2010-03-20 Thread Adam Richardson
n.include.php Try file_get_contents instead, as in the below example: http://www.jennysjunket.com/magpierss/rss_fetch.inc ");?> And if that's not enabled on your server, try using CURL as outlined in this tutorial: http://phpsense.com/php/php-curl-functions.html Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

Re: [PHP] Re: Pulling my hair out over an include_once();

2010-03-20 Thread Adam Richardson
t;> Watson >>> >>> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Actually, after looking at the link you mentioned, I see it's PHP (I'm sorry, I didn't check the link before), and I'm wondering if you were just trying to include a file that's already on your server. Grabbing a PHP file from a remote source for parsing is a bad idea in terms of security, so hopefully that's not what you're doing. If the file is on your server, then the path would be something like below judging by your error message: Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

Re: [PHP] Re: Pulling my hair out over an include_once();

2010-03-20 Thread Adam Richardson
RL work? > > > On Sun, Mar 21, 2010 at 2:13 AM, Adam Richardson wrote: > >> On Sun, Mar 21, 2010 at 1:45 AM, Stan Vassilev wrote: >> >>> >>> Hi, >>> >>> As the error says, this is a problem with the server configuration. >>> In your p

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-22 Thread Adam Richardson
neral Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Hi Deavid, At this point, I find that when I need threading capabilities, I switch over to developing with C# or Java most of the time, but it would be nice to stay in PHP for these tasks (I, too, looked into the pcntl technique and that just didn't seem like the right way to handle them.) Yes, your last paragraph was a doozy, and few will accuse you of long-term political aspirations in any arena ;) However, I will go on record saying that having threading would be a feature I'd very much appreciate, and I believe it would strengthen the value proposition of PHP in the ever-changing world of development. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com

<    2   3   4   5   6   7   8   9   10   11   >