Re: [PHP] Can't connect to MySQL via PHP

2013-01-13 Thread Rick Dwyer
Hi Jim, and all the rest. Thanks for the help. What was throwing me was the EXACT same creds were being used to connect via Navicat… but not when using PHP. Could not figure it out. So I zapped gremlins in BBEdit on my test file.. which had literally no more lines than what I posted to this li

Re: [PHP] Can't connect to MySQL via PHP

2013-01-12 Thread Rick Dwyer
On Jan 12, 2013, at 3:56 PM, "admin" wrote: > > >> -Original Message----- >> From: Rick Dwyer [mailto:rpdw...@earthlink.net] >> Sent: Saturday, January 12, 2013 8:26 AM >> To: php-general@lists.php.net >> Subject: [PHP] Can't connect t

[PHP] Can't connect to MySQL via PHP

2013-01-12 Thread Rick Dwyer
Hello all. I used the code below successfully to connect to a MySQL db on one hosting provider. I've moved the code to a new hosting provider with new values and it returns: Access denied for user 'user'@'db.hostprovider.net' (using password: YES) Even though I can copy and paste these three

Re: [PHP] Pear Mail - Trap for errors?

2012-11-15 Thread Rick Dwyer
On Nov 14, 2012, at 10:48 PM, tamouse mailing lists wrote: > On Wed, Nov 14, 2012 at 7:19 PM, Rick Dwyer wrote: >> Hello all. >> >> I have some Pear Mail code composing an email and sending it to an external >> smtp server for sending. >> >> The iss

[PHP] Pear Mail - Trap for errors?

2012-11-14 Thread Rick Dwyer
Hello all. I have some Pear Mail code composing an email and sending it to an external smtp server for sending. The issue is determining whether that external server actually accepted the mail or not. In the IF(PEAR… code below, it will return success even if I leave the $to value empty. Ho

Re: [PHP] PHP to decode AES

2012-10-18 Thread Rick Dwyer
On Oct 18, 2012, at 4:39 PM, Adam Richardson wrote: > On Thu, Oct 18, 2012 at 12:06 PM, Rick Dwyer wrote: >> Hello all. >> >> Has anyone ever tried to decode a JAVA AES/CBC encrypted string with PHP >> before? >> >> I found a tutorial online with the

Re: [PHP] PHP to decode AES

2012-10-18 Thread Rick Dwyer
On Oct 18, 2012, at 2:38 PM, Matijn Woudt wrote: > On Thu, Oct 18, 2012 at 7:19 PM, Rick Dwyer wrote: >> To correct what I posted below, $code that I'm passing to my function is >> encrypted… not plain text: >> >> ch7WvaSrCiHLstNeNUp5SkPfPgw0Z8vrNPJT+9vU7jN/C

Re: [PHP] PHP to decode AES

2012-10-18 Thread Rick Dwyer
To correct what I posted below, $code that I'm passing to my function is encrypted… not plain text: ch7WvaSrCiHLstNeNUp5SkPfPgw0Z8vrNPJT+9vU7jN/C --Rick On Oct 18, 2012, at 12:06 PM, Rick Dwyer wrote: > Hello all. > > Has anyone ever tried to decode a JAVA AES/CBC encrypt

[PHP] PHP to decode AES

2012-10-18 Thread Rick Dwyer
Hello all. Has anyone ever tried to decode a JAVA AES/CBC encrypted string with PHP before? I found a tutorial online with the following code to use as starting point, but it fails to return anything readable: $code ='Hello World'; $key = 'my key'; function decrypt($code, $key) { $key = hex2bi

[PHP] Serving an image

2012-10-15 Thread Rick Dwyer
Hello all. I am sending an email with a logo at the top of the email. The source of the image for the logo is: http://myurl.com/image.php?id=5 Image.php then calls a function that simply returns the following: $image='http://myurl.com/images/logo.jpg"; />'; return $image; Calling the pag

Re: [PHP] Array_diff problems

2012-04-27 Thread Rick Dwyer
l Message----- > From: Rick Dwyer [mailto:rpdw...@earthlink.net] > Sent: Friday, April 27, 2012 3:37 PM > To: PHP-General > Subject: [PHP] Array_diff problems > > Hello all. > > I have two arrays and when compared against each other via array_diff, I do > not get any

[PHP] Array_diff problems

2012-04-27 Thread Rick Dwyer
Hello all. I have two arrays and when compared against each other via array_diff, I do not get any output: $myarray1 = Array ( [0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 [Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] => 2 [Funding_Type] => Tru

[PHP] Insert group by

2012-04-26 Thread Rick Dwyer
Hello all. This is more of a MySQL question, but I'm hoping it can be answered here. On one of my pages, I issue a SQL command to group data as such: $sql='select count(*) as count, searchkeywords from searchkeywords group by searchkeywords order by count desc' Works well... but I would like it

Re: [PHP] Selecting checkboxes based on SQL query

2012-02-23 Thread Rick Dwyer
0] => Array ( [cb] => 2 ) [1] => Array ( [cb] => 6 ) [2] => Array ( [cb] => 1 ) ) --Rick On Feb 23, 2012, at 2:08 PM, Fatih P. wrote: On Thu, Feb 23, 2012 at 8:49 PM, Rick Dwyer wrote: Hello all. I perform a SQL query like the following: $sql = 'select * f

[PHP] Selecting checkboxes based on SQL query

2012-02-23 Thread Rick Dwyer
Hello all. I perform a SQL query like the following: $sql = 'select * from my_table where id="10" It returns the the following array for 3 records: Array ( [0] => Array ( [cb] => 2 ) [1] => Array ( [cb] => 6 ) [2] => Array ( [cb] => 1 ) ) The values of CB in the above array are the values

Re: [PHP] Form Post to different domain

2012-02-14 Thread Rick Dwyer
1:39 PM, Daniel Brown wrote: On Tue, Feb 14, 2012 at 13:36, Rick Dwyer wrote: I only have access to domain B... the one receiving the Form POST. Then all you should need to do is: a.) Verify that Domain A is indeed pointing to Domain B, to the script you expect, as a POST request

Re: [PHP] Form Post to different domain

2012-02-14 Thread Rick Dwyer
On Feb 14, 2012, at 1:16 PM, Daniel Brown wrote: On Tue, Feb 14, 2012 at 13:14, Rick Dwyer wrote: Hello all. If I have a form on domain A that uses POST to submit data and I want to submit the form to domain B on an entirely different server, how do I pull the form values (... echo

[PHP] Form Post to different domain

2012-02-14 Thread Rick Dwyer
Hello all. If I have a form on domain A that uses POST to submit data and I want to submit the form to domain B on an entirely different server, how do I pull the form values (... echo $_POST["myval"] returns nothing) from the form at domain B? --Rick -- PHP General Mailing List

Re: [PHP] Curl problems

2012-01-11 Thread Rick Dwyer
On Jan 11, 2012, at 6:29 PM, Matijn Woudt wrote: On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer wrote: Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see

[PHP] Curl problems

2012-01-11 Thread Rick Dwyer
Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is suppo

Re: [PHP] PHP page source charset

2011-12-20 Thread Rick Dwyer
On Dec 20, 2011, at 1:32 PM, Jim Lucas wrote: On 12/19/2011 6:44 PM, Rick Dwyer wrote: Hello all. When I set my page charset from iso-8859-1 to utf-8, when I run it through the W3C validator, the validator returns an error that it can't validate the page because of an illegal char

[PHP] PHP page source charset

2011-12-19 Thread Rick Dwyer
Hello all. When I set my page charset from iso-8859-1 to utf-8, when I run it through the W3C validator, the validator returns an error that it can't validate the page because of an illegal character not covered by UTF-8. "Sorry, I am unable to validate this document because on line 199

Re: [PHP] Preferred Syntax

2011-12-14 Thread Rick Dwyer
On Dec 14, 2011, at 1:53 PM, > wrote: The key thing to remember here is that this is a preference and not a performance thing. Thank you... this is basically what I wanted to know. I was concerned that not breaking the VARS out separately from the echo'ed text might cause some sort of per

[PHP] Preferred Syntax

2011-12-14 Thread Rick Dwyer
Hello all. Can someone tell me which of the following is preferred and why? echo "$page_name"; echo "".$page_name.""; When I come across the above code in line 1, I have been changing it to what you see in line 2 for no other reason than it delineates out better in BBEdit. Is this jus

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
On Nov 30, 2011, at 7:38 PM, Matijn Woudt wrote: On Thu, Dec 1, 2011 at 1:14 AM, Rick Dwyer wrote: On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote: Your decrypt function seems fine, and the encrypt/decrypt functions work fine both in the same file for me. Now you say you use $_GET["

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote: Your decrypt function seems fine, and the encrypt/decrypt functions work fine both in the same file for me. Now you say you use $_GET["myval"], which means you get them from URL. Base64 is not URL safe, have you used urlencode()? Matijn OK,

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
et_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))); } echo decrypt($myval); --Rick On Nov 30, 2011, at 4:14 PM, Adam Richardson wrote: On Wed, Nov 30, 2011 at 3:57 PM, Rick Dwyer wrote: Hello all. I am using the following function to encrypt a string: define('SALT

[PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
Hello all. I am using the following function to encrypt a string: define('SALT', 'myvalueforsalthere'); function encrypt($text) { return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT

[PHP] Writing out errors to a file

2011-11-03 Thread Rick Dwyer
Hello all. How do I get PHP to write out any errors or warnings to a text file that I can review and go through to troubleshoot issues? I don't have access to the ini file... so I was hoping for a simple write to a file at the web root. Thanks, --Rick -- PHP General Mailing List (http:

[PHP] PHP and webmaster tools

2011-11-02 Thread Rick Dwyer
Hello list. I am looking for someone who knows PHP and has extensive experience with webmaster tools. I have a series of crawl errors I need resolved but cannot find the bad URL's anywhere on the site. Please contact me off list. Thanks, --Rick -- PHP General Mailing List (http://www.php.

Re: [PHP] function.session-start in Webmaster Tools

2011-10-31 Thread Rick Dwyer
this... so I eliminated it. Not sure if that will fix as the page has never displayed an error and Google takes forever to recrawl the whole site. --Rick On Oct 31, 2011, at 5:44 AM, Stuart Dallas wrote: On 30 Oct 2011, at 20:30, Rick Dwyer wrote: Hello all. Not sure just how much

[PHP] function.session-start in Webmaster Tools

2011-10-30 Thread Rick Dwyer
Hello all. Not sure just how much of this is PHP related, but hoping someone has come across this before. I Google's webmaster tools for a site I work on, they list more than 100 crawl errors for pages with URL's as follows: http://mydomain.com/My-Directory/function.session-start Can any

[PHP] Displaying variables in text - clarification needed

2011-10-26 Thread Rick Dwyer
Hello all. I inherited some PHP pages about a year ago. They have been fine all along but now a bunch of erroneous errors and results are popping up. I traced it to the way the variables were being used on the page... for example, the following SQL statement (a space between ' and " for

[PHP] PHP Rounding Question

2011-05-20 Thread Rick Dwyer
I have a division formula that will return an value from 0.00 to 5... so I can get values like 2.38 or 4.79. However, never lower than 0 or higher than 5. How do I coerce the result to always round up to the nearest increment 1/4? So for example: 2.06 gets rounded to 2.25 0.01 gets rounde

Re: [PHP] Destroying cookies... not working

2011-04-27 Thread Rick Dwyer
The following did the trick... is there any reason I should not use it? $name="mysession"; setcookie($name); --Rick On Apr 27, 2011, at 7:16 PM, Rick Dwyer wrote: Hello all. I have a logout page that should be destroying cookies when loaded... but it is not. setcookie

[PHP] Destroying cookies... not working

2011-04-27 Thread Rick Dwyer
Hello all. I have a logout page that should be destroying cookies when loaded... but it is not. setcookie("mycookie", "False", time() - 3600, "/"); However, I can still pull values stored in the cookie and I can still see the cookie in my browser's "Show Cookies" window. So I tried the f

[PHP] Memory_Limit adjustments

2011-01-06 Thread Rick Dwyer
Hello all. I am using a form combined with PHP to upload files to a website directory. Worked fine until I tried to upload a file 1.7 mb in size. My php code isn't the bottleneck as I scan the file first and reject the upload request if it exceed 4096KB. So I looked at the php.ini file a

Re: [PHP] Re: Parsing a phrase

2010-12-12 Thread Rick Dwyer
I have it working now using preg_replace. --Rick On Dec 12, 2010, at 3:50 PM, Rick Dwyer wrote: Thanks Nathan. The MySQL Match/Against will probably work well... but I would need to somehow add a "+" to the beginning of each word in the phrase so PHP will still be involved.

Re: [PHP] Re: Parsing a phrase

2010-12-12 Thread Rick Dwyer
Thanks Nathan. The MySQL Match/Against will probably work well... but I would need to somehow add a "+" to the beginning of each word in the phrase so PHP will still be involved. --Rick On Dec 12, 2010, at 2:51 PM, Nathan Rixham wrote: Rick Dwyer wrote: Hello all. I have a

[PHP] Parsing a phrase

2010-12-12 Thread Rick Dwyer
Hello all. I have a page where the user can enter a search phrase and upon submitting, the search phrase is queried in MySQL. However, I need to modify is so each word in the phrase is searched for... not just the exact phrase. So, "big blue hat" will return results like: "A big hat - bl

Re: [PHP] PHP loop to issue sql insert

2010-11-14 Thread Rick Dwyer
On Nov 14, 2010, at 8:15 PM, Simon J Welsh wrote: On 15/11/2010, at 12:47 PM, Rick Dwyer wrote: Hello List. I have a sql command that counts, groups and sorts data from a table. I need to insert the results of that sql command into different table. My sql SELECT looks like this

[PHP] PHP loop to issue sql insert

2010-11-14 Thread Rick Dwyer
Hello List. I have a sql command that counts, groups and sorts data from a table. I need to insert the results of that sql command into different table. My sql SELECT looks like this: select count(*) as count, searchkeywords from searchtable group by searchkeywords order by count desc;

Re: [PHP] Quotes vs. Single Quote

2010-08-05 Thread Rick Dwyer
On Aug 5, 2010, at 10:43 PM, Michael Shadle wrote: > On Thu, Aug 5, 2010 at 7:10 PM, Rick Dwyer wrote: >> Hi List. >> I've mentioned before that I am both just beginning to learn PHP AND I have >> inherited a number of pages that I'm trying to cle

[PHP] Quotes vs. Single Quote

2010-08-05 Thread Rick Dwyer
Hi List. I've mentioned before that I am both just beginning to learn PHP AND I have inherited a number of pages that I'm trying to clean up the w3c validation on. Something that confuses me is how the code on the page is written where in one instance, it follows this: echo " And elsewhere

Re: [PHP] Encoding for W3C Validation

2010-08-03 Thread Rick Dwyer
On Aug 3, 2010, at 3:36 PM, Ashley Sheridan wrote: > On Tue, 2010-08-03 at 15:32 -0400, Rick Dwyer wrote: >> >> On Aug 3, 2010, at 3:15 PM, Sebastian Ewert wrote: >> >> > Ashley Sheridan wrote: >> >> On Tue, 2010-08-03 at 15:00 -0400, Rick Dwyer wrote

Re: [PHP] Encoding for W3C Validation

2010-08-03 Thread Rick Dwyer
On Aug 3, 2010, at 3:15 PM, Sebastian Ewert wrote: > Ashley Sheridan wrote: >> On Tue, 2010-08-03 at 15:00 -0400, Rick Dwyer wrote: >> >>> On Aug 3, 2010, at 2:47 PM, Sebastian Ewert wrote: >>> >>>> Rick Dwyer wrote: >>>>> Hello Lis

Re: [PHP] Encoding for W3C Validation

2010-08-03 Thread Rick Dwyer
Thanks Ash... this worked. --Rick On Aug 3, 2010, at 3:01 PM, Ashley Sheridan wrote: > On Tue, 2010-08-03 at 15:00 -0400, Rick Dwyer wrote: > >> On Aug 3, 2010, at 2:47 PM, Sebastian Ewert wrote: >> >>> Rick Dwyer wrote: >>>> Hello List. >>>>

Re: [PHP] Encoding for W3C Validation

2010-08-03 Thread Rick Dwyer
On Aug 3, 2010, at 2:47 PM, Sebastian Ewert wrote: > Rick Dwyer wrote: >> Hello List. >> >> In the Alt section of the IMG tag below, the variable $myitem has a value of >> "Who's There". >> >> echo " > src='/itemimages/$m

[PHP] Encoding for W3C Validation

2010-08-03 Thread Rick Dwyer
Hello List. In the Alt section of the IMG tag below, the variable $myitem has a value of "Who's There". echo " http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Encoding Ampersands

2010-07-28 Thread Rick Dwyer
ies($test_one); // Green, Red & Blue > echo htmlentities($test_two); // htm?color=blue&number=2&letter=a > > ?> > > Regards, > > -Josh > > On Jul 29, 2010, at 12:29 AM, Rick Dwyer wrote: > >> So htmlentities() will work for "Green, Red &am

Re: [PHP] Encoding Ampersands

2010-07-28 Thread Rick Dwyer
do str_replace("&", > "&"); > > Regards, > > -Josh > > On Jul 29, 2010, at 12:18 AM, Rick Dwyer wrote: > >> Hello List. >> >> I have variables displaying content from mysql fields. The contents >> contains & like "Dogs

[PHP] Encoding Ampersands

2010-07-28 Thread Rick Dwyer
Hello List. I have variables displaying content from mysql fields. The contents contains & like "Dogs & Cats"... so naturally the W3C validator chokes on them. Is there a way to encode so they display properly on the page but the validator is OK with them? Is the answer as simple as: urlenc

Re: [PHP] PHP Pill

2010-07-17 Thread Rick Dwyer
On Jul 17, 2010, at 2:34 PM, Peter Lind wrote: On 17 July 2010 20:08, Rick Dwyer wrote: On Jul 17, 2010, at 1:29 PM, Ashley Sheridan wrote: Well, I did suggest one thing that could be happening. What do both string lengths come to? On the PC, the length of variable old string is 44

Re: [PHP] PHP Pill

2010-07-17 Thread Rick Dwyer
On Jul 17, 2010, at 2:08 PM, Rick Dwyer wrote: On Jul 17, 2010, at 1:29 PM, Ashley Sheridan wrote: Well, I did suggest one thing that could be happening. What do both string lengths come to? On the PC, the length of variable old string is 44 and new string is 39 On the Mac, the

Re: [PHP] PHP Pill

2010-07-17 Thread Rick Dwyer
On Jul 17, 2010, at 1:29 PM, Ashley Sheridan wrote: Well, I did suggest one thing that could be happening. What do both string lengths come to? On the PC, the length of variable old string is 44 and new string is 39 On the Mac, the length of varialbe old string is 44 and new string is

Re: [PHP] PHP Pill

2010-07-17 Thread Rick Dwyer
lugin is working as it is removing everthing... but gets tripped on the trade mark symbol. I sent a side by side screen shot of the fields on the mac and pc to your personal address. --Rick On Jul 17, 2010, at 12:34 PM, Ashley Sheridan wrote: On Sat, 2010-07-17 at 12:30 -0400, Rick

[PHP] PHP Pill

2010-07-17 Thread Rick Dwyer
Hello all. I inquired about the problem below on a FM board but no one could help. Hoping someone here may have an explanation or a workaround. I have PHP Pill installed on both a Mac and PC versions of FileMaker 11. On the Mac, things behave as expected. On the PC, they do not. My code

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Very good. Thank you. --Rick On Jun 22, 2010, at 8:14 PM, Ashley Sheridan wrote: On Tue, 2010-06-22 at 20:03 -0400, Rick Dwyer wrote: Hello again list. My code for stripping characters is below. I'm hoping to get feedback as to how rock solid it will provide the desired output

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
logic above capture and remove every non alpha numeric character and place a SINGLE hyphen between the non contiguous alpha numeric characters? Thanks for the help on this. --Rick On Jun 22, 2010, at 4:52 PM, Rick Dwyer wrote: On Jun 22, 2010, at 1:41 PM, Ashley Sheridan wrote: It

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
On Jun 22, 2010, at 1:41 PM, Ashley Sheridan wrote: It is clean, but as Richard mentioned, it won't handle strings outside of the traditional 128 ASCII range, so accented characters and the like will be converted to an underscore. Also, spaces might become an issue. However, if you are

Re: [PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Thanks to everyone who responded. Regarding the myriad of choices, isn't Ashley's, listed below, the one most like to guarantee the cleanest output of just letters and numbers? --Rick On Jun 22, 2010, at 11:44 AM, Ashley Sheridan wrote: On Tue, 2010-06-22 at 11:40 -0400,

[PHP] Stripping Characters

2010-06-22 Thread Rick Dwyer
Hello List. I need to remove characters from a string and replace them with and underscore. So instead of having something like: $moditem = str_replace("--","_","$mystring"); $moditem = str_replace("?","_","$mystring"); $moditem = str_replace("!","_","$mystring"); etc. For every possibl

[PHP] What am I missing here?

2010-06-19 Thread Rick Dwyer
Hello List. I am completely at a loss for why the line of code below returns the desired value: $PATH_INFO= substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRI PT_NAME']), strlen($_SERVER['REQUEST_URI'])); BUT, putting the same line of code on 1 line fails to return anything: $PATH_INFO=

Re: [PHP] Replacing Registered Symbol

2010-06-18 Thread Rick Dwyer
OK, it's definitely an encoding issue... when I change the encoding of my PHP page in BBedit to Western ISO Latin 1, it replaces successfully. --Rick On Jun 18, 2010, at 5:13 PM, Daniel Brown wrote: On Fri, Jun 18, 2010 at 17:07, Rick Dwyer wrote: Navicat shows it as Latin

Re: [PHP] Replacing Registered Symbol

2010-06-18 Thread Rick Dwyer
On Jun 18, 2010, at 5:13 PM, Daniel Brown wrote: Can you hit the database from the command line to see if there's a difference in the output when you take the server and browser out of the equation? No, I'm on Mac OS 10.5 and apparently I don't have a MySQL client installed in terminal

Re: [PHP] Replacing Registered Symbol

2010-06-18 Thread Rick Dwyer
On Jun 18, 2010, at 4:52 PM, Daniel Brown wrote: Check your database's character encoding. My check: Navicat shows it as Latin1. I believe UTF-8 is what it should be, but I don't want to change it without understanding what impact it will have. Note that, while it won't make a

Re: [PHP] newbie sequel question: how do we search for multiple things on 1 field like:

2010-06-18 Thread Rick Dwyer
SELECT * FROM contacts WHERE state = 'CA' and (name = 'bob' or name = 'sam' or name = 'sara') --Rick On Jun 18, 2010, at 4:30 PM, Dave wrote: SELECT * FROM contacts WHERE state = 'CA' and name = 'bob' or name = 'sam' or name = 'sara' -- Thanks - Dave -- PHP General Mailing Lis

[PHP] Replacing Registered Symbol

2010-06-18 Thread Rick Dwyer
Hello List. I'm trying to replace the registered (®) symbol from a variable via PHP. The variable $mystring is set to a MySQL field that contains the value "This Is The Registered Symbol ®". Using the following, I try to replace the symbol, but it persists: $moditem = str_replace("®","","$m

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
... if there were 5 more subdirectories... they would be dynamically assigned to a variable. --Rick On Jun 13, 2010, at 6:42 PM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 18:35 -0400, Rick Dwyer wrote: OK, I get the following error: Warning: basename() expects parameter 1 to

Re: [PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
Sheridan wrote: On Sun, 2010-06-13 at 18:13 -0400, Rick Dwyer wrote: Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion of the path down into its own variable. The

[PHP] String Parse Help for novice

2010-06-13 Thread Rick Dwyer
Hello List. I need to parse the PATH portion of URL. I have assigned the path portion to a variable using the following: $thepath = parse_url($url); Now I need to break each portion of the path down into its own variable. The problem is, the path can vary considerably as follows: /myd

Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer
On Mar 2, 2010, at 9:45 AM, Joseph Thayne wrote: I do not know if the question has been answered, but how are you opening the session? Are you using session_start() or are you using session_register()? Hi Joseph. It is created via: session_start(); --Rick -- PHP General Mailing List

Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer
On Mar 2, 2010, at 9:35 AM, Ashley Sheridan wrote: I'm assuming then that both the Javascript an the PHP code you have above are both on the same page. The only way I can see your problem occurring would be if your javascript part was on a different page and you were attempting to output t

Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer
On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote: How is $item_id created? You've not shown that in your PHP script examples. // parse item id from the url $refer=$_SERVER['HTTP_REFERER']; $thispage=$_SERVER['PHP_SELF']; $item_id=substr($thispage, -9); $item_id=substr($item_id, 0, 5); $_SE

Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer
The most annoying thing in making it difficult to to troubleshoot is this message does not always appear. --Rick On Tue, Mar 2, 2010 at 5:46 AM, Rick Dwyer wrote: Hello List. I have some JS code that open a new window with a contact form in it. When the link is clicked to open the

[PHP] Error Message - Need help troubleshooting

2010-03-01 Thread Rick Dwyer
Hello List. I have some JS code that open a new window with a contact form in it. When the link is clicked to open the new window, I will get the following error SOMETIMES: "Warning: Unknown: Your script possibly relies on a session side- effect which existed until PHP 4.2.3. Please be ad

Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer
k.php is not enough. if you modify the header('Location: /mypage.php') to.. header('Location: /mypage.php?my_id=5') it will take the variable to mypage.php as $_GET['my_id] you can not expect a variable value set in to $_POST array to reflect on a totally different page

Re: [PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer
preciated. Thanks. --Rick On Feb 25, 2010, at 12:31 AM, Paul M Foster wrote: On Thu, Feb 25, 2010 at 12:16:08AM -0500, Robert Cummings wrote: Rick Dwyer wrote: Hello all. I'm trying to learn PHP on the fly and I have a line of code that contains syntax I can't find documented an

[PHP] PHP Syntax Help - Check?

2010-02-24 Thread Rick Dwyer
Hello all. I'm trying to learn PHP on the fly and I have a line of code that contains syntax I can't find documented anywhere: php echo check('element8'); In the above line, can someone tell me what "check" means? Thank you. --Rick -- PHP General Mailing List (http://www.php.net/) To u

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
Thank you Nathan, This worked quite well. --Rick On Jan 22, 2010, at 8:10 PM, Nathan Rixham wrote: Rick Dwyer wrote: On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. np - here's a more condensed version: function round_to_half_ce

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. --Rick your doing the number format before the rounding.. here's a version of the function that should fit the bill: function round_to_half_cent( $value ) { $value *= 100; if( $value ==

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 4:24 PM, tedd wrote: Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP r

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
ias 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, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9

Re: [PHP] Formatting Decimals

2010-01-11 Thread Rick Dwyer
On Jan 11, 2010, at 4:56 PM, 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, 4, 5, 6 it gets rounded to 5. And if it 7, 8

Re: [PHP] Formatting Decimals

2010-01-11 Thread Rick Dwyer
well, I am not aware of the logic to configure this accordingly. Thanks, --Rick On Jan 11, 2010, at 10:55 AM, Ryan Sun wrote: $newprice = sprintf("$%.2f", 15.109); On Sun, Jan 10, 2010 at 8:36 PM, Rick Dwyer wrote: Hello List. Probably an easy question, but I am not able t

[PHP] Formatting Decimals

2010-01-10 Thread Rick Dwyer
Hello List. Probably an easy question, but I am not able to format a number to round up from 3 numbers after the decimal to just 2. My code looks like this: $newprice = "$".number_format($old_price, 2, ".", ","); and this returns "$0.109" when I am looking for "$0.11". I tried: $newprice

Re: [PHP] Re: First time PHP user question

2010-01-07 Thread Rick Dwyer
hley Sheridan wrote: On Thu, 2010-01-07 at 09:19 +, Nathan Rixham wrote: Rick Dwyer wrote: > Hello List. > I have been playing around with PHP, running a few tutorials and I came > across an error message I could not resolve. > > The tutorial is Generating

[PHP] First time PHP user question

2010-01-06 Thread Rick Dwyer
Hello List. I have been playing around with PHP, running a few tutorials and I came across an error message I could not resolve. The tutorial is Generating One Time URL's by Oreilly: http://www.oreillynet.com/pub/a/php/2002/12/05/one_time_URLs.html Basically the PHP code is supposed to read f