[PHP] PHP as HTML
Hey there- I'm trying to use an .htaccess file to parse .php files as .html does anyone know how to do this? It doesn't work with the same structure as parsing the .shtml files. any suggestions would be great. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as HTML
I tried this, and it just prompts me to download the file from the server. I can't see what the issue is. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 5:35 PM Subject: Re: [PHP] PHP as HTML AddType application/x-httpd-php .html AddType application/x-httpd-php .htm - Original Message - From: Tom Ray [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 2:41 PM Subject: [PHP] PHP as HTML Hey there- I'm trying to use an .htaccess file to parse .php files as .html does anyone know how to do this? It doesn't work with the same structure as parsing the .shtml files. any suggestions would be great. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as HTML
you know, that's a good question. How would I determine that on the server? Peter wrote: Tom, this does work fine... doing what Kevin says... ie the AddType application/x-httpd-php .html AddType application/x-httpd-php .htm is PHP installed as a module or cgi ver? Cheers -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 5 June 2002 9:49 AM To: Kevin Stone; [EMAIL PROTECTED] Subject: Re: [PHP] PHP as HTML I tried this, and it just prompts me to download the file from the server. I can't see what the issue is. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 5:35 PM Subject: Re: [PHP] PHP as HTML AddType application/x-httpd-php .html AddType application/x-httpd-php .htm - Original Message - From: Tom Ray [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 2:41 PM Subject: [PHP] PHP as HTML Hey there- I'm trying to use an .htaccess file to parse .php files as .html does anyone know how to do this? It doesn't work with the same structure as parsing the .shtml files. any suggestions would be great. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as HTML
Thanks. I got the issue figured out. There was an .htaccess file in the root of the website that I had forgotten about, it was affecting everything due to it's bad config. Pushkar Pradhan wrote: If you do a phpinfo() you get a columen Server API, mine lists CGI as it is what I installed php as. you know, that's a good question. How would I determine that on the server? Peter wrote: Tom, this does work fine... doing what Kevin says... ie the AddType application/x-httpd-php .html AddType application/x-httpd-php .htm is PHP installed as a module or cgi ver? Cheers -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 5 June 2002 9:49 AM To: Kevin Stone; [EMAIL PROTECTED] Subject: Re: [PHP] PHP as HTML I tried this, and it just prompts me to download the file from the server. I can't see what the issue is. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 5:35 PM Subject: Re: [PHP] PHP as HTML AddType application/x-httpd-php .html AddType application/x-httpd-php .htm - Original Message - From: Tom Ray [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 2:41 PM Subject: [PHP] PHP as HTML Hey there- I'm trying to use an .htaccess file to parse .php files as .html does anyone know how to do this? It doesn't work with the same structure as parsing the .shtml files. any suggestions would be great. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -Pushkar S. Pradhan
[PHP] Retrieving Info from Cookies
I've been playing with cookies, and I've been able to write information to a cookie, but now what I want to do is pull that information from the cookie. Is there something special I need to do to pull that info or should I just be to get that data by delcaring a variable in the php script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retrieving Info from Cookies
when I do that it comes up with Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' Justin French wrote: you should be able to access it via $_COOKIE['name'], or what I do, $cookie = $_COOKIE['name']. Justin French on 05/06/02 2:19 PM, Tom Ray ([EMAIL PROTECTED]) wrote: I've been playing with cookies, and I've been able to write information to a cookie, but now what I want to do is pull that information from the cookie. Is there something special I need to do to pull that info or should I just be to get that data by delcaring a variable in the php script? .
[PHP] Search a flat file.
I want to be able to search a flat file line by line looking for data such as a username then display all the information in that line. Is there some way to search the following format: record1:username:info:info:info record2:username:info:info:info record3:username:info:info:info So if someone submits the username in record two for the search I want it to stop at record two and then display that information... any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search a flat file.
ok I believe I follow you on that, I will give that a try. But the question I have now is how do I loop that request? Gaylen Fraley wrote: Use the explode() function based on the colon. Then parse the 2nd array element for the username that you want. If matched, display all elements in that array row. Conversely you could use the implode() to reassemble the array row. (Assume $file_row is the row name that you have assigned) /* your code to loop through the file goes here */ $your_array = explode(:,$file_row); /* remember that arrays start with element 0 */ if ($your_array[1]) == some name { /* routine to display entire row */ } /* continue processing loop */ -- Gaylen PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Tom Ray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I want to be able to search a flat file line by line looking for data such as a username then display all the information in that line. Is there some way to search the following format: record1:username:info:info:info record2:username:info:info:info record3:username:info:info:info So if someone submits the username in record two for the search I want it to stop at record two and then display that information... any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting users monitor size
Is there a way to do this with PHP? I couldn't find it in the online docs and the archive search is offline :( thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another Flat File question.
I know I've asked this before but I don't believe I asked the question correctly. I have a flat file database that is delimited with colons. This file will have new records added to it on a regular basis. What I want to do is be able to search that file based on a keyword that is inputted by a user, then it will search that database comparing each record for that value, if that value returns true, I want it to display the results of that record. How would I do this when I don't know the number of records that will be searched (since it will rise and fall almost daily)? Also, how would I create a dynamic array? I hope this makes sense to someone, I've been pulling my hair out on this. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include question
I'm trying to use the include function in some PHP scripts, but when I do include 'config.inc'; or include 'config.php; It returns all the information in the file when I look at my test php file (which calls the include) Anyone know why this is? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include question
Yes, but according to http://www.php.net/manual/en/function.include.php I should be able to delcare the include and then pull the information out normally. So by what the manual says I can do this somefile.php ? $apple = 'green'; $pear = 'yellow'; ? callfile.php ? include 'somefile.php'; echo Apples are $apple and Pears are $pear; \\ which would return the line with green and yellow in the correct spots. ? But when I just do ? include 'somefile.php'; ? It prints: $apple = 'green'; $pear = 'yellow': Why is that? John Holmes wrote: Umm...that's what it's supposed to do...it's including it... ---John Holmes... -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Include question I'm trying to use the include function in some PHP scripts, but when I do include 'config.inc'; or include 'config.php; It returns all the information in the file when I look at my test php file (which calls the include) Anyone know why this is? -- 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
Re: [PHP] Include question
Well I got it solved. It would help if I formatted my files correctly. Sorry about that, i've been messing with PHP for about a year now, but am now really diving into it so I may have stupid questions here and there :) TIA to all for help. John Holmes wrote: Umm...that's what it's supposed to do...it's including it... ---John Holmes... -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Include question I'm trying to use the include function in some PHP scripts, but when I do include 'config.inc'; or include 'config.php; It returns all the information in the file when I look at my test php file (which calls the include) Anyone know why this is? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unlink question more or less
I want to use unlink() to delete a wildcard, but at the moment I keep getting parse errors. Here's what happening: I'm mucking around with some login stuff, when a user logs in it writes a flat file that collects some information about them, the flat file is created with the name username.dateyeartime Now each time they log in I want to delete that file and replace it with the new file that has the latest dateyeartime ending on it. I've tried unlink (username.*); but that returns an error. Is there a way for unlink() to recongize wildcards? If not how would I do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unlink question more or less
Yeah they are, actaully I switched it to a static name and then added the time stamp as part of the information I'm gathering. Now I just re-write the file on each log in. John Holmes wrote: You can't use wildcards. Use a system() or exec() call to do it. Why use the datetime part at all? The usernames are unique, right? ---John Holmes... -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 11:06 PM To: [EMAIL PROTECTED] Subject: [PHP] Unlink question more or less I want to use unlink() to delete a wildcard, but at the moment I keep getting parse errors. Here's what happening: I'm mucking around with some login stuff, when a user logs in it writes a flat file that collects some information about them, the flat file is created with the name username.dateyeartime Now each time they log in I want to delete that file and replace it with the new file that has the latest dateyeartime ending on it. I've tried unlink (username.*); but that returns an error. Is there a way for unlink() to recongize wildcards? If not how would I do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .
Re: [PHP] Unlink question more or less
Any word on when glob() will be in the production version? thanks for the help Miquel. - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: Tom Ray [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, June 12, 2002 2:01 AM Subject: Re: [PHP] Unlink question more or less On Tue, 11 Jun 2002, Tom Ray wrote: I want to use unlink() to delete a wildcard, but at the moment I keep getting parse errors. Here's what happening: I'm mucking around with some login stuff, when a user logs in it writes a flat file that collects some information about them, the flat file is created with the name username.dateyeartime Now each time they log in I want to delete that file and replace it with the new file that has the latest dateyeartime ending on it. I've tried unlink (username.*); but that returns an error. Is there a way for unlink() to recongize wildcards? If not how would I do this? Once glob() makes it into the production version, foreach(glob('*') as $f) unlink($f); Until then, use system('rm *'); or a readdir loop. unlink() is not the rm command. It's a system call that deletes a specific named file. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic Arrays
I have an array question. I want to use a dynamic array but I don't know how to do this. What I want to do is this, I want to write a form script that takes the elements of the form and submits them in the array then I want to do a loop and check to see if each element in the array has a value and then if it does bullocks for them, but if it doesn't then I want it to come to a screeching halt and tell them what dolts they are for missing a field. So basically I want to have a Required field option for the form. I'm still learning arrays and dynamic arrays are just throwing me and I can't find a good code example to work from. TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] beginner in PHP
Try this: echo $catalog[unitprice]; in my experience I've only been able to use the echo() without the quotation marks if I'm calling a function, for variables you need the quotation marks. Hope this helps. Phillip Perry wrote: Can someone tell me why this doesn't work? The $mycart array is fine and the $catalog array is also fine but nothing inside the if statement prints. I've tried other echo statements but nothing prints at all. while (list($key,$value) = each($mycart)) { if ($value == $catalog[itemcd]) { echo $catalog[unitprice]; } } Thanks Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] server problems
And what are the directory/file permissions where you are writing the archive files? - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: Kris Vose [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 11:54 AM Subject: Re: [PHP] server problems Are you sure display_errors is turned ON in php.ini on the new server? Do the two servers have different settings for register_globals in php.ini? ---John Holmes... - Original Message - From: Kris Vose [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 11:12 AM Subject: [PHP] server problems I just uploaded a php driven web site that use text files to archive data to a unix server. When I went to try and add another archive the script fails without a warning. It does not store the data in the text file and it does not add another archive. I wrote this application about 4 months ago when I was just learning php and I have found since then that mysql is the best way to store data! duh... Anyway I was wondering if my permissions are screwed up on the unix server, or if there is something that I am overlooking here! I do not really want to rewrite the code! I spoke with the administrator of the server and he has no idea. They are using PHP 4.0.2B and we are using PHP 4.1.2 Anyway...thanks in advance. Kris -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ErrorDocument 404 Form
Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in httpd.conf or an .htaccess file) follows absolute paths, so you are calling your engine.php out of the root directory of the machine. So the question is, do you have engine.php in the / folder? If not you can put it there or just adjust your ErrorDocument command to point to the path of the file. Hope this helps. - Original Message - From: Fabien Penso [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 17, 2002 1:21 PM Subject: [PHP] ErrorDocument 404 Form Hi. I got a trouble I don't know if Apache or PHP is in fault. Let's say I got something like : ErrorDocument 404 /engine.php If I make a form which use POST and redirect to something which doesn't exist, then a phpinfo() in engine.php won't show the variables. Am I wrong thinking it should ? Is there a way to make this work ? Thanks. -- Fabien Penso [EMAIL PROTECTED] | LinuxFr a toujours besoin de : http://perso.LinuxFr.org/penso/ | http://linuxFr.org/dons/ -- 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
[PHP] Mcrypt Function - New to it
Hi there..some what a new programmer when it comes to all this. I'm trying to encrypt some data and then decrypt it. It doesn't have to be high bit encryption just something simple like 3DES. But I keep getting it wrong. Any help would be greatful. Here's the piece of code: $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, MCRYPT_MODE_ECB), MCRYPT_RAND); $key = md5(Secret Key); $sample2 = Hello; $lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, MCRYPT_MODE_ECB, $iv); echo $lockdata\n; $text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, $iv); echo $text\n; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mcrypt Function - New to it
Well now I have the Encryption problem figured out but when I try to decrypt the information, I'm getting this error: Warning: mcrypt module initialization failed in test.php on line 11 Here's Line 11: $text = mcrypt_decrypt (MCRYPT_TripleDES, $key, $lockdata, MCRPYT_MODE_ECB, $iv); again any help would be appreciated. Tom Rogers wrote: Hi Here are a couple of functions that should help to get you started, iv is set to all 0's so it does not have to be passed around or stored in sessions. It is base64 encoded so it can be stored or passed to the browser. Function Code_id($id,$password){ $eid = 0; $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, ); $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); mcrypt_generic_init ($td, $password, $iv); $eid = base64_encode(mcrypt_generic ($td, $id)); mcrypt_generic_end ($td); return $eid; } Function Get_id($eid,$password){ $id = 0; $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, ); $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); mcrypt_generic_init ($td, $password, $iv); $id = mdecrypt_generic ($td, base64_decode($eid)); mcrypt_generic_end ($td); return $id; } Tom At 11:07 PM 30/05/2002 -0400, Tom Ray wrote: Hi there..some what a new programmer when it comes to all this. I'm trying to encrypt some data and then decrypt it. It doesn't have to be high bit encryption just something simple like 3DES. But I keep getting it wrong. Any help would be greatful. Here's the piece of code: $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, MCRYPT_MODE_ECB), MCRYPT_RAND); $key = md5(Secret Key); $sample2 = Hello; $lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, MCRYPT_MODE_ECB, $iv); echo $lockdata\n; $text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, $iv); echo $text\n; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail () will send to everyone except my own domain
Gareth- This sounds more like a sendmail issue to me. I've run into this a few times myself. What's happening is simple, sendmail has a file that it reads generally called domains this file tells sendmail what domains it should be handling mail for. When you submit your form the first thing sendmail is doing is checking that domains file, and if your domain is listed in that file sendmail will then handle the mail locally. So basically the server is sending mail to itself. You need to edit that domains file and remove the domain name in question. Once that's done sendmail will look outside the server for answers on what it needs to do with the mail delievery. I can't remember the exact path off the top of my head because we use EXIM here (and it has the same issue) I would try either /etc/sendmail or /etc/mail or you can always do a find or whereis for domains Hello all, Having a real problem. Have written a very simple php email script that I'm testing on our server. The script works fine if I set the 'to' field as any email address but our own - i.e. [EMAIL PROTECTED] This works fine, however as soon as I set the script to email me at the domain to which the server resolves too it fails. I do not get a error message, it says that the mail has been sent. The server runs Apache 1.3 and Php 4.1.2 (I will update to 4.2.2 once I have resolved this). The error logs on the server give no indication of any problem. I cannot work this out at all - it simply will not email to the same address as the DNS resolves its own IP address too. Our mx records are held elsewhere. I'm at complete loss on this one - I've been checking php.ini, httpd.conf etc etc and cannot work out why this is happening. Php.ini is set too: sendmail_from [EMAIL PROTECTED] sendmail_path /usr/sbin/sendmail -t -i smtp localhost do I need to set the smtp to point to the server that holds the mx records? any help/advice much appreciated, thanks, Gareth --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whois query
Yes, but how do you format the information that comes back out of the whois? I'm doing this: ? $whois = system(whois [EMAIL PROTECTED]); print pre$whois/pre; ? But all the information is shown as one big line, no breaks or anything. How would I do this so it showed properly formatted output? Adam Williams wrote: Have a php page that runs exec() or system() and does a whois query on the domain you want and then have it output the text to a page. Very simple to do, less then 2 minutes of coding. Adam On Thu, 12 Sep 2002, yasin inat wrote: please anyone can help me about querying a domain like whois queries ? if someone has got a script , it's acceptable
Re: [PHP] whois query
Nope still comes up with everything in one big line. I'm running through different options right now..but I'm tired and my brain is starting to hurt :) Adam Williams wrote: try with p /p and see if that works. Adam On Thu, 12 Sep 2002, Tom Ray wrote: Yes, but how do you format the information that comes back out of the whois? I'm doing this: ? $whois = system(whois [EMAIL PROTECTED]); print pre$whois/pre; ? But all the information is shown as one big line, no breaks or anything. How would I do this so it showed properly formatted output? Adam Williams wrote: Have a php page that runs exec() or system() and does a whois query on the domain you want and then have it output the text to a page. Very simple to do, less then 2 minutes of coding. Adam On Thu, 12 Sep 2002, yasin inat wrote: please anyone can help me about querying a domain like whois queries ? if someone has got a script , it's acceptable
Re: [PHP] Re: whois query
A working solution to the whois question ? $whois = `whois [EMAIL PROTECTED]`; print pre$whois/pre; ? Notice those are back ticks, not single quotes. This will give youthe information you need, and the pre tag puts it out in the proper format for you. yasin inat wrote: Thanx friends -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COOKIE Question.
I'm having some issue's with $_COOKIE and $HTTP_COOKIE_VARS, I can't seem to retrieve data from them. First I set the cookie like so: setcookie (Access, Test_Value,time()+31536000); Then I check my Cookies in Netscape and I can see that I have the cookie stored. But when I go to the page that has print $HTTP_COOKIE_VARS[Access]; print $_COOKIE[$Access]; and even print $Access; I don't get the value set in the cookie, and I don't know why...any help, please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
I do the print $_COOKIE[Acccess]; and I still don't see any data print. Leif K-Brooks wrote: First of all, the second try should be print $_COOKIE[Access]; with no second $. But, more importantly, I would reccomend you change the cookie name to access. This may not be the problem, but case in names seems to generally cause problems. Tom Ray wrote: I'm having some issue's with $_COOKIE and $HTTP_COOKIE_VARS, I can't seem to retrieve data from them. First I set the cookie like so: setcookie (Access, Test_Value,time()+31536000); Then I check my Cookies in Netscape and I can see that I have the cookie stored. But when I go to the page that has print $HTTP_COOKIE_VARS[Access]; print $_COOKIE[$Access]; and even print $Access; I don't get the value set in the cookie, and I don't know why...any help, please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test
Test message -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
Discovered my cookie issue. I wasn't setting the path in setcookie() so it defaulted to what ever directory the script ran in. I set it so it loads from the root of the website now, and it's working like a charm. Thanks to all that helped! John Holmes wrote: I do the print $_COOKIE[Acccess]; and I still don't see any data print. Did you typo in your code like you did here?? Try to dump the whole $_COOKIE[] array and see what's in it. print_r($_COOKIE); Did you mention what version of PHP you were using? ---John Holmes...
[PHP] Calling on functions in a url
I have a question that I have yet to figure out. Let's say I have a PHP script with multiple fuctions, how do I call on the script to perfom specific functions through a url? Ex: http://www.sample.com/script.php?fucntion1 TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script Modificaton question
I have a chat script that I downloaded and according to the license I can modify it as much as I want, and I'm a little stuck on a simple modification I want to make. When you type in a message it stores in in a file called text.php and then the chat page does an include call for the text.php file. Currently, the writer of this script has it setup so all new text added is placed at the begining of the file using the w+ command, according to php.net with fopen if I switch the w+ to a+ it shoudl place the new data at the end of the file. However, when I make this switch, the data is still being placed at the begining of the text.php file. I've including the portion of the script that writes to text.php can someone help me find what I'm not seeing? $filename = text.php; $fileAr= file($filename); exec(cat /dev/null '$filename'); $fd = fopen( $filename, w+ ); $filemessage = a href=\javascript:launcher('profile.php?username=$username');\B$username/B/a: ; $filemessage .=font color=\$fcolor\$chat/fontBR\n; fputs($fd,$filemessage); $numLines = 20; for ($i=0;$i$numLines;$i++) { fputs($fd,$fileAr[$i]); } fclose( $fd ); TIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script Modificaton question
Ahah! That's what I was thinking, thatnks for helping me clear that up! John Holmes wrote: I have a chat script that I downloaded and according to the license I can modify it as much as I want, and I'm a little stuck on a simple modification I want to make. When you type in a message it stores in in a file called text.php and then the chat page does an include call for the text.php file. Currently, the writer of this script has it setup so all new text added is placed at the begining of the file using the w+ command, according to php.net with fopen if I switch the w+ to a+ it shoudl place the new data at the end of the file. However, when I make this switch, the data is still being placed at the begining of the text.php file. I've including the portion of the script that writes to text.php can someone help me find what I'm not seeing? $filename = text.php; $fileAr= file($filename); It's reading the whole file into an array here. The newest lines will still be first. exec(cat /dev/null '$filename'); $fd = fopen( $filename, w+ ); This opens the file and truncates it to zero length. $filemessage = a href=\javascript:launcher('profile.php?username=$username');\B$user na me/B/a: ; $filemessage .=font color=\$fcolor\$chat/fontBR\n; fputs($fd,$filemessage); This write the new, formatted message. $numLines = 20; for ($i=0;$i$numLines;$i++) { fputs($fd,$fileAr[$i]); And then write the first 20 lines of the file. } fclose( $fd ); So, if you want it in the new format of newest chat last in the file, then use the same script, but fputs() the 20 old lines first, then the new line. Just change the order. This would work for you: $numLines = 20; $filename = text.php; //read whole file $fileArr = file($filename); //open file and truncate to zero $fp = fopen($filename,w+); //write 20 lines of old file to new file fputs($fp,array_slice($fileArr,0,$numLines); //format $message //write message to file fputs($fp,$message); //close file fclose($fp); Adapt to your needs... ---John Holmes...
[PHP] Encryption Question
I want to compare a password to a encrypted password stored in my mySQL database using password('password'), what's the best way to compare the two? Encrypted the password sent by the user and compare or pull the password from the database based on username, decrypt it and then compare? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another Encryption question
I dipped into mcrypt about a month or so, and did this script back then. I had it working, it would kick out the encrypted data for me but today when I test it I get a Fatal error: Call to undefined function: mcrypt_create_iv() in test2.php on line 3. And I don't understand why...any help would be great...thanks! ? $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_TripleDES, MCRYPT_MODE_CFB), MCRYPT_RAND); $key = Secret; $sample2 = Hello; $sample3 = Hello There; $lockdata = mcrypt_encrypt (MCRYPT_TripleDES, $key, $sample2, MCRYPT_MODE_CFB, $iv); $test = mcrypt_encrypt (MCRYPT_TripleDES, $key, $sample3, MCRYPT_MODE_CFB, $iv); echo $lockdatabr\n; echo $test\n; ?
Re: [PHP] Another Encryption question
also if I comment out $iv, I get the error Call to undefined function mcrypt_encrypt() on that line.. I just don't understand why it keeps doing this. I'm running 4.2.2 Tom Ray wrote: I dipped into mcrypt about a month or so, and did this script back then. I had it working, it would kick out the encrypted data for me but today when I test it I get a Fatal error: Call to undefined function: mcrypt_create_iv() in test2.php on line 3. And I don't understand why...any help would be great...thanks! ? $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_TripleDES, MCRYPT_MODE_CFB), MCRYPT_RAND); $key = Secret; $sample2 = Hello; $sample3 = Hello There; $lockdata = mcrypt_encrypt (MCRYPT_TripleDES, $key, $sample2, MCRYPT_MODE_CFB, $iv); $test = mcrypt_encrypt (MCRYPT_TripleDES, $key, $sample3, MCRYPT_MODE_CFB, $iv); echo $lockdatabr\n; echo $test\n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Form and Arrays help
I'm having a small problem with a form I'm designing and I hope someone can point me in the right direction here. The form's function is rather simple actaully. It's supposed to take the information, run through it to make sure all the required fields have data in them, if there is a blank required field it is supposed to redraw the form showing the field missed but also store the data that was already submitted so you don't have to fill the form out all over again. Now I have it so it stores the values of text boxes, drop down menus and radio buttons but I'm having a real tough time with the check box values. Example of what I'm doing: (Gender Selection with Radio Buttons). I declare an array in my PHP by doing $genderarray=array(); Then I store the value of the form for the redraw like so: $mygender=$HTTP_POST_VARS[gender]; $genderarray[$mygender]=checked; In the actaul form I decalre a global: global genderarray(); And under the gender selection I have: input name=gender type=radio value=Male ?= $genderarray[Male] ? (works the same for the Female) Now my question is how can I do this with check boxes. I thought I could through them all into a single array, then pull out the ones who have values to them, but that's not working the way I thought. Any thoughts or suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searching for a new provider
Hey Andy- I work with a hosting company that I believe has everything you're looking for in your wish list. They're a small company that's been around for about 10 years (started as an ISP). If you can get me more information on the type of hosting you're looking to do and what other specifics you might need for your sites, I can get you a ball park figure on what it will cost. Andy wrote: Hi there, I am searching for a provider who fullfills those criterias and does not cost a fortune: - PHP = 4.06 bzw. PHP 4.x mit GDLibrary ab 2.0 - GDLibrary = 2.0 - PHP installed as module - mind 5 Subdomains - mind 100 MB Speicherplatz - evtl. Java VM - MySQL Thanx andy
[PHP] Simple Question
I have a quick question that I haven't been able to find the answer to yet. I've made a couple of guest books via PHP but the biggest problem I'm having is if any one inputs a ' or or anything like that, the output in the book shows the stupid \ for the escape. So the word Tom's looks like Tom\'s Is there anyway for me to handle those characters so the backslash doesn't appear in the output? Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Simple Question
oh no, Iv'e gotten two answers... stripslashes() and strip_slashes() which one? which one?! G Gaylen Fraley wrote: strip_slashes() -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite Tom Ray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a quick question that I haven't been able to find the answer to yet. I've made a couple of guest books via PHP but the biggest problem I'm having is if any one inputs a ' or or anything like that, the output in the book shows the stupid \ for the escape. So the word Tom's looks like Tom\'s Is there anyway for me to handle those characters so the backslash doesn't appear in the output? Thanks, Tom
[PHP] PHP Upgrade Question
Hey all- I'm running a SuSE 9.1 box that was built from the RPMs from the CD with Apache2.0 and PHP 4.3.4. I've made modifications to the server over the last year without using the CD's and justing installing from the source. However, I just installed PHP 4.4.2 and I used all the same path calls as the build of 4.3.4 and it seems to have upgraded without an issue. When I type /usr/bin/php -v I get the following: PHP 4.4.2 (cgi) (built: May 3 2006 16:34:27) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies However, when I restart the web server and I run my phpinfo() script, I am still seeing the 4.3.4 build information. Did I miss something with this? I've updated other servers but they were all built using source only, no rpms... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade Question
On 05.03.2006 at 16:46:21, Eric Butera [EMAIL PROTECTED] wrote: On 5/3/06, Tom Ray [EMAIL PROTECTED] wrote: Hey all- I'm running a SuSE 9.1 box that was built from the RPMs from the CD with Apache2.0 and PHP 4.3.4. I've made modifications to the server over the last year without using the CD's and justing installing from the source. However, I just installed PHP 4.4.2 and I used all the same path calls as the build of 4.3.4 and it seems to have upgraded without an issue. When I type /usr/bin/php -v I get the following: PHP 4.4.2 (cgi) (built: May 3 2006 16:34:27) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies However, when I restart the web server and I run my phpinfo() script, I am still seeing the 4.3.4 build information. Did I miss something with this? I've updated other servers but they were all built using source only, no rpms... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Just a stab in the dark, but are you sure you built it the way you meant? Your php says cgi. Did you mean to compile as cgi or with apxs? That might be the problem. But I could be very wrong. Appologies if I am. No, you're not. I tried to build with apxs because that is what the phpinfo file calls on --with-apxs2=/usr/sbin/apxs2-prefork but apxs2-prefork doesn't exist there or within the apache2 directory structure. I ended up using --with-httpd2=/usr/sbin/httpd2 because thats the closest I found. It also had --without-cli in the phpinfo so that's what I used in the new configuration. Perhaps that is the problem? Another thing to consider is if you built it, you could easily have different versions installed on the machine. Issuing a locate /bin/php might prove that or not. Only one version installed on the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade Question
On 05.03.2006 at 16:46:21, Eric Butera [EMAIL PROTECTED] wrote: On 5/3/06, Tom Ray [EMAIL PROTECTED] wrote: Hey all- I'm running a SuSE 9.1 box that was built from the RPMs from the CD with Apache2.0 and PHP 4.3.4. I've made modifications to the server over the last year without using the CD's and justing installing from the source. However, I just installed PHP 4.4.2 and I used all the same path calls as the build of 4.3.4 and it seems to have upgraded without an issue. When I type /usr/bin/php -v I get the following: PHP 4.4.2 (cgi) (built: May 3 2006 16:34:27) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies However, when I restart the web server and I run my phpinfo() script, I am still seeing the 4.3.4 build information. Did I miss something with this? I've updated other servers but they were all built using source only, no rpms... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Just a stab in the dark, but are you sure you built it the way you meant? Your php says cgi. Did you mean to compile as cgi or with apxs? That might be the problem. But I could be very wrong. Appologies if I am. Ok so I can't find apxs on the server at all, even though the 4.3.4 phpinfo claims to have been configured with --with-apxs2=/usr/sbin/apxs2-prefork. I did some search via google and I reconfigured using --enable-cli and --disable-cgi but I still had to use --with-apache2=/usr/sbin/httpd2 because I need to have that correct? Since all the builds I done with PHP call on a Apache source in some way. It still compiled with it's SAPI choice being cgi then I ran 'make install-cli' and now when I do a /usr/bin/php -v I get: PHP 4.4.2 (cli) (built: May 3 2006 18:36:11) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies But when I restart apache I'm still seeing 4.3.4 in the phpinfo() information. I've even restarted the server with no luck. Can someone tell me what I missing? It seems SuSE compiled PHP with the --disable-session call in the configuration and we need Sessions enable to support Zencart and phpOpenChat for some clients. Another thing to consider is if you built it, you could easily have different versions installed on the machine. Issuing a locate /bin/php might prove that or not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade Question
On 05.03.2006 at 20:34:20, Eric Butera [EMAIL PROTECTED] wrote: Ok so I can't find apxs on the server at all, even though the 4.3.4phpinfo claims to have been configured with --with-apxs2=/usr/sbin/apxs2-prefork. I did some search via google and I reconfigured using --enable-cli and --disable-cgi but I still had to use --with-apache2=/usr/sbin/httpd2 because I need to have that correct? Since all the builds I done with PHP call on a Apache source in some way. It still compiled with it's SAPI choice being cgi then I ran 'make install-cli' and now when I do a /usr/bin/php -v I get: PHP 4.4.2 (cli) (built: May 3 2006 18:36:11) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies But when I restart apache I'm still seeing 4.3.4 in the phpinfo() information. I've even restarted the server with no luck. Can someone tell me what I missing? It seems SuSE compiled PHP with the --disable-session call in the configuration and we need Sessions enable to support Zencart and phpOpenChat for some clients. Another thing to consider is if you built it, you could easily have different versions installed on the machine. Issuing a locate /bin/php might prove that or not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I run Ubuntu Dapper Drake at home (the only place I've dabbled with compiling php). To get it to compile I had to install the packages apache2-mpm-prefork and apache2-prefork-dev to get the system setup correctly. By default it had something else which did not give me apxs2. My apxs2 is in /usr/bin/apxs2. So maybe if you could figure out how to get that package /usr/sbin/apxs2-prefork on your system that might do it. I'm really not the one who should be giving any advice on this since I just kept beating on mine till it worked. ;) But then again, nobody else is replying so... Well I finally got PHP 4.4.2 installed. I ended up having to install a fresh version of Apache2 and then compiling PHP into that version. Now I have the fun task of configuring the new install of Apache2 with all the current sites on that server so they can run PHP 4.4.2 Thanks for the help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP question
Are PHP script supposed to run as the user or as the web server? Currently I'm running Red Hat 7.3 with apache 1.3.x and all my PHP scripts run as apache, not as the user. I'm wonder if I can run the scripts as the user and how do I fix this? Any help would be great! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I redirect to another php page
You could use an include statement in one of two ways. 1) you can just include the page that you want to show, however the url doesn't change it will still be select.php 2) if you want to sent them to yellow.php or green.php you could include an html page that had a meta-refresh in it set for 0 seconds to move them to the seperate pages. -Original Message- From: Teo Petralia [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 9 Jan 2003 09:46:30 +1300 Subject: [PHP] How can I redirect to another php page Hi All! I would like to redirect the user to another php page accordingly to his/her chosen options, example: if ($Color == Yellow) { go to page else if ($Color == Green) go to page } Does anyone knows how to achieve the goal?? Thanks Teo -- 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
Re: [PHP] Newbee observation
Mail servers play a part in this too. Maybe the admins should pack up their servers and send them back too :) -Original Message- From: Hendrik van Niekerk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 9 Jan 2003 11:11:30 -0600 Subject: [PHP] Newbee observation Why does the webmaster not reject messages that are dates today's date eq there are numerous messages that have dates with year 2010 and up. A moron who does not have the correct computer date on his machine should pack it up and send it back to the company that sold it to them. JMHO -- 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
[PHP] mysql_connect error
Can someone please tell me why I'm getting this error: *Fatal error*: Call to undefined function: mysql_connect() in */webs/tom/www.bohabcentral.com/www/bohabs/auth.php* on line *4 *mysql_connect was working a week or so ago, and I haven't made any changes to the servers configuration. If someone could point me in the right direction I would love to get this function running again. TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect problem..update
It turns out after some checking, the other admin on the machine ran a kernel update last week. I hadn't been testing any scripts over the last week myself so I didn't notice the issue until the other day. When I run a function_exists() for mysql_connect it comes back false. When I run phpinfo() there is no reference to mysql at all. I'm still kind of new to all this, and I'm just wondering what I need to do to get php and mysql talking again. Is there a service or command I can run to get things going again? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect problem..update
Thanks, we're going to give that a try. -Original Message- From: Tracy Finifter Rotton [EMAIL PROTECTED] To: Tom Ray [EMAIL PROTECTED], [EMAIL PROTECTED] Date: Tue, 21 Jan 2003 10:25:55 -0800 Subject: Re: [PHP] mysql_connect problem..update Talk to the other admin. If you're using RPMs, you just need to install the php_mysql RPM, restart apache, and you should be up and running again. If you're compiling PHP from scratch, you'll have to do so again with --with-mysql in the configure command. But, as this is the default when compiling PHP from scratch, my hunch is the first option is what you really need. -- t On 1/21/03 10:01 AM, Tom Ray [EMAIL PROTECTED] wrote: It turns out after some checking, the other admin on the machine ran a kernel update last week. I hadn't been testing any scripts over the last week myself so I didn't notice the issue until the other day. When I run a function_exists() for mysql_connect it comes back false. When I run phpinfo() there is no reference to mysql at all. I'm still kind of new to all this, and I'm just wondering what I need to do to get php and mysql talking again. Is there a service or command I can run to get things going again? -- Tracy F. Rotton [EMAIL PROTECTED] http://www.taupecat.com/ ... I like the 49ers because they're pure of heart, Seattle because they've got something to prove, and the Raiders because they always cheat. -- Lisa Simpson, Lisa the Greek -- 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
Re: [PHP] Simple E-mail Question
you would put that in the $mailheaders variable. Something like $mailheaders = From: Joe Bloe [EMAIL PROTECTED]\r\n; $mailheaders .= Cc: Some Dude [EMAIL PROTECTED]\r\n; $mailheaders .= Bcc: Some Other Guy [EMAIL PROTECTED]\r\n; That should work for you. Just do this for whatever other headers you want to add to the mail -Original Message- From: Scott Saraniero [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Wed, 22 Jan 2003 09:47:52 -0500 Subject: [PHP] Simple E-mail Question Hi, I'm using this line to send an e-mail with info: mail([EMAIL PROTECTED], $Event Ticket Form, $msg, $mailheaders); If I want to add mail recipients, or cc, or bcc, how would I do this? Thanks, Scott -- 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
[PHP] Random Images
I'm trying to set it up so that a random image from either a mysql table or a text file list is displayed on a page each time a user goes to it. I'm a little stumped as to how to do this with phpany suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little help please
I'm looking for a webbased interface that will allow me to managae mysql databases. However, phpmyadmin has been ruled out due to the fact it requires the username and password to be stored in the config file and that it doesn't have any security to protect the average joe from stumbling across it. So can anyone point me in the direction of a utility that requires a login that checks of the users database then throws that information into the config for the mysql management? I would be greatful for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] time() question
Is there an easy way to display the epoch time given by time() in a human readable format? Basically, if I do $time = time(); and the insert that data into my mysql database and then pull that information out again how do I make it look like 2003-03-13 or a variant of that? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html parsing
Ron Croonenberg wrote: Hello, I have a script that ads data to a html template. However when there is an include in the html like: !--#include file=include/header.sinc -- it is not processed, but just ends up as a string in the page. So I guess it needs to be parsed. Is there an easy way to do that ? thanks, Ron Do you have SSI enable in Apache? You are running Apache right? Do you have the file named .shtml? Or do you have Apache setup to run SSI through the HTML parser allowing you to have the files named .html instead. But I guess the other question is why are you using an SSI command that you could easily use a PHP command for and thus not have to mix the two? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrade to PHP5 and having issues with mysql
Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Chris wrote: Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Did you get any errors when configure ran? I'm not sure if it will stop configure working when it can't find a library you want to compile in or if it just ignores the error and keeps going. No errors during the ./configure part only when I run make -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Chris wrote: Tom Ray [Lists] wrote: Chris wrote: Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Did you get any errors when configure ran? I'm not sure if it will stop configure working when it can't find a library you want to compile in or if it just ignores the error and keeps going. No errors during the ./configure part only when I run make What happens if you configure --with-mysqli not --with-mysql ? Just wondering if it makes any diff.. it shouldn't really I don't think. Yeah it doesn't still have issues with it. I need to upgrade to PHP5 since some of the new OpenSRS stuff needs it but this is being a damn pain,. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Robert Cummings wrote: On Mon, 2008-01-21 at 18:01 -0500, Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. What's your ld.so.conf pointing to for MySQL? It should be pointing to: /usr/local/mysql/lib/mysql And not: /usr/local/mysql/lib Presuming that /usr/local/mysql/ contains the following directories as expected: bin/ include/ info/ lib/ libexec/ man/ mysql-test/ share/ sql-bench/ Cheers, Rob. ARUGH! I fixed my ld.so.conf file and tried again and I'm still dying in the make process at the same spot. Here's what I have: ld.so.conf mx02:~:# cat /etc/ld.so.conf /usr/kerberos/lib /usr/X11R6/lib /usr/local/ssl/lib /usr/local/opensrs-client/lib /usr/local/lib/perl5/site_perl/5.6.1/i686-linux /usr/local/freetds/lib /usr/lib/libmcrypt/lib /usr/local/mhash0-9-3/lib /usr/local/mysql/lib/mysql Here's my mysql structure: (var softlinks to data) mx02:~:# ls /usr/local/mysql binCOPYING docs include INSTALL-BINARY libexec mysql-test scripts sql-bench tests configure data EXCEPTIONS-CLIENT info lib man README sharesupport-files var Here's my configuration setup: mx02:~:# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache-dev/bin/apxs --with-mysql=/usr/local/mysql Compiles just fine but when I run make I get the errors previously listed. I've run ldconfig, I rebooted the machine...I just don't know what I'm doing wrong here. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Robert Cummings wrote: On Tue, 2008-01-22 at 12:42 -0500, Tom Ray [Lists] wrote: Robert Cummings wrote: On Mon, 2008-01-21 at 18:01 -0500, Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. What's your ld.so.conf pointing to for MySQL? It should be pointing to: /usr/local/mysql/lib/mysql And not: /usr/local/mysql/lib Presuming that /usr/local/mysql/ contains the following directories as expected: bin/ include/ info/ lib/ libexec/ man/ mysql-test/ share/ sql-bench/ Cheers, Rob. ARUGH! I fixed my ld.so.conf file and tried again and I'm still dying in the make process at the same spot. Here's what I have: ld.so.conf mx02:~:# cat /etc/ld.so.conf /usr/kerberos/lib /usr/X11R6/lib /usr/local/ssl/lib /usr/local/opensrs-client/lib /usr/local/lib/perl5/site_perl/5.6.1/i686-linux /usr/local/freetds/lib /usr/lib/libmcrypt/lib /usr/local/mhash0-9-3/lib /usr/local/mysql/lib/mysql Here's my mysql structure: (var softlinks to data) mx02:~:# ls /usr/local/mysql binCOPYING docs include INSTALL-BINARY libexec mysql-test scripts sql-bench tests configure data EXCEPTIONS-CLIENT info lib man README sharesupport-files var This looks like the MySQL source tree and not the installation tree. Please provide your ./configure line for building MySQL. Cheers, Rob. This is how I setup mysql: #upgrades: cd mysql tar -zxf mysql-version-x.tar.gz cp -R * /usr/local/mysql cd /usr/local/mysql chown -R mysql:mysql * scripts/mysql_install_db --user=mysql /usr/local/mysql/bin/mysqld_safe mysql starts/runs just fine. This server has been upgraded from 3.x to 4.x to 5.0.45 currently. Is there something I'm missing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Currency Exchange Database?
I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? Any help would be appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency Exchange Database?
I thought about that but I'm looking to make it seem-less. I just want to get the numbers and do the conversion myself not have the third party do it. I just need an updated list on a daily/hourly basis. Paul Scott wrote: On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote: I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? I am pretty sure, although I may be wrong, that http://xe.com provides a webservice for this. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Richard Heyes wrote: Every single one of us has been guilty of it at some time or another You can't make that assumption. Sure he can. Assumptions are like opinions which are like ...well you know what I'm getting at...we all have them. And if someone can honestly say they've never stolen ANYTHING in their life, I'd be hard press to buy it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Daniel Brown wrote: P.S. - If a rooster lays an egg in a nest under a tree that falls in the woods and no one is there to hear it, how soon will train B meet train A if the wind blows the egg off the top of a barn facing west before sundown? Oh, I know this! Roosters can't lay eggs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload Tracker.
I'm a little unsure on how to do this but basically when someone uses a form to upload a file I want to have a popup window come up and so the process in percentage of the transfer. Anyone do this before? Is it possible in PHP or do I need to do it in javascript or a mixture of both? Any suggestions, ideas, commands or functions to try to use? I would greatly appreciate it. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML Email Composing Problem.
I'm trying to use PHP to compose an HTML formatted email and I'm running into some small problems. 1) When using Content-Type: multipart/mixed during my testing both Thunderbird and Gmail display the plain text and html version of the email and Firefox attaches the html portion as an attachement. 2) When using Content-Type: multipart/alternative during my testing Thunderbird only showed the HTML portion of the email but Gmail displayed only a blank email. 3) Spam Assassin doesn't like it either way and tags the email as SPAM for the following reasons: 0.6 HTML_SHORT_LENGTH BODY: HTML is extremely short 0.0 HTML_MESSAGE BODY: HTML included in message 1.5 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding Here is the script, which I mostly borrowed from tutorials/how to examples on the web. $to=Tom Ray [EMAIL PROTECTED]; $from=Support [EMAIL PROTECTED]; $subject=Test HTML Email; // -- plain text part of the email $msgtext=This is HTML Testing; //-- html part of the email $htmlmsg=chunk_split(base64_encode(This is bHTML/b testing.)); //-- create boundary $sep = strtoupper(md5(uniqid(time(; //-- create email $header = From: $from\n; $header .= MIME-Version: 1.0\n; $header .= Content-Type: multipart/mixed; boundary=$sep\n\n; $header .= --$sep\n; $header .= Content-Type: text/plain; charset=ISO-8859-1\n; $header .= Content-Transfer-Encoding: 8bit\n\n; $header .= $msgtext\n\n; $header .= --$sep\n; $header .= Content-Type: text/html; charset=ISO-8859-1\n; $header .= Content-Transfer-Encoding: base64\n\n; $header.= $htmlmsg\n\n; $header .= --$sep--; //-- mail it mail($to, $subject, , $header); Any help/suggestions would be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Email Composing Problem.
Chris wrote: Richard Lynch wrote: On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote: I'm trying to use PHP to compose an HTML formatted email Don't do that... 3) Spam Assassin doesn't like it either way and tags the email as SPAM for the following reasons: 0.6 HTML_SHORT_LENGTH BODY: HTML is extremely short 0.0 HTML_MESSAGE BODY: HTML included in message 1.5 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding The only people who send out these stupid HTML enhanced (cough, cough) messages are spammers. Pfft. There are tons of legitimate reasons to send html emails. To get rid of the last one, don't base_64 encode your html content. You only need to base64_encode embedded images or attachments (pdf's, docs, stuff like that). As someone else suggested, check out phpmailer - it handles all this for you and works pretty nicely. I would have to agree with you Chris, there a many legitimate reasons for having HTML mail. I was trying to be a nice guy and send both the plain text version and the html version out but like I said, I couldn't get it to stop displaying both. I dumped the base_64 encoding already and also gave up on trying to do a multipart/mixed with both plain text and html and am just composing them as plain text or html as needed. PHPMailer is great for a resource but this is a customized project and PHPMailer won't fit in it. Plus I really would like to have this knowledge rattlin' around in my head anyways. It all works with Yahoo, Gmail and Hotmail. It displays properly and isn't shoved into the Junk/Spam folders. Everything displays right in Thunderbird and Outlook Express and the only time it's flagged as spam is if it goes through my main account which, in reality, has a insanely low score base (.5) and it's now scoring a .6 so I think I've got a solution. However, I would still like to get answers on questions 1 and 2 for future reference so any thoughts would be great. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hide the real URL
Eric Butera wrote: On 7/28/07, brian [EMAIL PROTECTED] wrote: Eric Butera wrote: On 7/27/07, Richard Lynch [EMAIL PROTECTED] wrote: On Fri, July 27, 2007 8:20 am, Eric Butera wrote: Not everyone has the option to do that. Plus I think it is unintuitive to have things outside of your actual web site. You can disallow traffic with Apache fairly easily if you're paranoid of such things. If your host doesn't give you a directory outside the webtree, find a new host that does :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? We have our own dedicated server that we host client sites on. If I were to back out into the root then I would be at the level of all the other sites. It just doesn't make sense in my case. Then you haven't set up your directories properly, IMHO. Let's say you want all of your client web directories under /var/www/vhosts. Create a dir for each client and set up each of your DocumentRoots as a dir inside of that one. This way all of your clients now have a directory above their web root that they can place into anything they want to keep private. /var/www/vhosts/client_[1 .. n]/htdocs brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I didn't set it up. It is how things have been and will continue to be regardless of my opinion. :) I use this type of structure for my virtual hosting: domainname.com -- cgi-bin (CGI and Perl scripts here) -- error_docs (Custom error pages here. 400, 401, 403, 404 500 templates already in place) -- ftp (Holds virtual FTP user information along with a data directory for ftp only upload/downloads) -- htdocs (the website) -- logs (the site log file) -- other (where all non-web accessible files/directories/etc go) Even if they where to go above the domainname.com folder it would just lead them to /home/user anyways and the FTP server locks them into their home directories. This allows one user to control multiple domains under his account. The beauty about the other directory is that you can store anything you need there. I put hidden .password directories for htaccess authentication files, attachments for email, data files for things I don't want web accessible. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Really, I had expected more mature commentary from the adults on this list. So did I. I expect adults to display morality and values. Really? Have you hung out with many computer geeks? Oh..wait..morality..I thought you said maturity. Pardon me. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Rules of Engagement
Colin Guthrie wrote: Daniel Brown wrote: As a relatively-new contributor to this list (read: under 2 years), I realize that I have no business requesting a change, but I'll breech etiquette and hope for the best. Can we update the filters on the list to have the reply-to address header marked to the php-general address? The reason I ask this is because, when people are on vacation (such as Juan is now), we receive responses to our personal addresses. Secondly, we have to continually Reply All the messages, which - though it's not a problem - can cause issues when attempting to respond to those [URGENT] replies. Third, our addresses are included in gmane, et al, which is an inherent risk --- I understand. Maybe it's just the ramblings of someone attempting to read and type on a limited-bandwidth mobile device while bored due to delays in mass-transit facilities (here, read: I'm fucking exhausted, and yes, I dropped the F bomb). In either case, it's not conducive to a new contributor to have to weed through vacation response messages each time he/she replies to the list. I agree here. I am on many lists and if I'm interested in something then I expect people to expect me to read the list for replies. But for noobs, the personal reply is quite good. I guess the rule should be public list - reply to poster, subscription list - reply to list. AFAIK Gmane etc. can be configured to obfuscate email addresses - certainly other lists I read through Gmane are... Col Well I think my only issue with it is that this is a group discussion list. We all ask for help, advice, suggestions or just bounce ideas off each other. When you hit that Reply button and it just goes to the person who made the post you're replying to it no long becomes a group discussion but a private one. The other issue is that during these private discussions the public version continues and if the solution is found in private the others don't know it and could actually spend time answering/helping with a problem that was fixed last Tuesday but no one knew because it was just a thread between two people. As for your rule, I think it's flawed. All lists, private or public, require you to subscribe in some way. They don't magically pick up that they should send email to a certain address, they have to be told. If the list is meant to be a discussion list then all the replies should go to the list by default. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizarre array create error
Ken Tozier wrote: Hi I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query with two dummy fields to be filled in later select *, 0 as dummy_1, 0 as dummy_2 from table Here's how I'm grabbing the query results $result= array(); while ($row = mysql_fetch_object($query_result)) { $result[]= $row; } Once that's done, I try to set two of the rows to arrays like this $result- dummy_1= array(1, 2, 3, 4); $result- dummy_2= array('a', 'b', 'c', 'd'); If I comment out either of the above lines, the script works but with both uncommented, it seems to drop dead. It doesn't even return an error. Is this all of your code? Do you have some sort of output display for your results? Does PHP generally return errors to the browser? When I tried your code above with a test table with four data fields I got this error: * Warning*: Attempt to assign property of non-object in */usr/local/apache/htdocs/test-script.php* on line *14 **Warning*: Attempt to assign property of non-object in */usr/local/apache/htdocs/test-script.php* on line *15 *Then I re-read your code and realized that you made $row an object not $result, it's just an array. Changing this: $result-dummy_1= array(1, 2, 3, 4); $result-dummy_2= array('a', 'b', 'c', 'd'); to this: $row-dummy_1= array(1, 2, 3, 4); $row-dummy_2= array('a', 'b', 'c', 'd'); Yielded no errors for me what so ever. However, since it's unclear on what you are doing with this data I can't vouch that it's actually what you need. Double check your display_errors setting in your php.ini and make sure it's set to On. Because you're either not giving us all the code to work with and something else is happening and that's why you don't get the error but not your desired result or you're not displaying the errors. I've been doing assignments like the above for 3 years and never had a problem and in fact the exact same function works perfectly in another script.This one has me utterly stumped. Does that script run on the same machine? If it's on another machine is that machine running the same version? I ran this on a server with Apache 2.2.4, PHP 5.2.3 and mySQL 5.0.18. Have you referenced that other script to make sure that it *is* exactly the same? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizarre array create error
Paul Novitski wrote: At 7/29/2007 09:59 PM, Ken Tozier wrote: /*--*/ /* Next two lines are where the problem starts */ /* If I comment either of them out the script runs */ /* but with both uncommented, it dies /*--*/ // create the rect and usable rect records $result-rect = array(0, 0, $result-page_width, $result- page_height); Does this typo exist in your script? $result- page_height with a space between - and ? Regards, Paul I thought the same thing but when I did the copy and paste no spaces where there. I think it's how the email clients display it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which PHP-Editor to use?
Merlin wrote: Hi there, I have worked now for several years happily with homesite 4.5, but now it looks like I have to switch to another system as homesite will not run without admin rights on a XP machine. What editors do you use? Do you have any recomendations on a special one? I have looked into eclipse, but I would hear from your experience which one would you recommend me to switch to? Thank you for any comment. Best regards, Merlin I either code in Dreamweaver or straight on the server via SecureCRT and use Pico. I really never could get into the other editor programs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
Stut wrote: blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Network Solutions are expensive, GoDaddy are cheap. That's all there is to it. In my experience customer service from both can be pretty shoddy or excellent depending on the day of the week and the phase of the moon. My advice is that if it's between the two, go with GoDaddy - you won't get any less for your money than you would with NetSol. -Stut But you might get more then with NetSol. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating watermarks
I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create security code images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added. How would one go about doing that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating watermarks
GP INTERACTIVE wrote: you can use also the following function : ?php // --- image play path $watermarkfile = 'images/play_small.png'; // as an example function getPictureMarked($sourcefile, $watermarkfile) { # # $sourcefile = Filename of the picture to be watermarked. # $watermarkfile = Filename of the 24-bit PNG watermark file. # //Get the resource ids of the pictures $watermarkfile_id = imagecreatefrompng($watermarkfi le); imageAlphaBlending($watermarkfile_id, false); imageSaveAlpha($watermarkfile_id, true); $fileType = strtolower(substr($sourcefile, strlen($sourcefile)-3)); switch($fileType) { case('gif'): $sourcefile_id = imagecreatefromgif($sourcefile); break; case('png'): $sourcefile_id = imagecreatefrompng($sourcefile); break; default: $sourcefile_id = imagecreatefromjpeg($sourcefile); } //Get the sizes of both pix $sourcefile_width=imageSX($sourcefile_id); $sourcefile_height=imageSY($sourcefile_id); $watermarkfile_width=imageSX($watermarkfile_id); $watermarkfile_height=imageSY($watermarkfile_id); $dest_x = ( $sourcefile_width / 2 ) - ( $watermarkfile_width / 2 ); $dest_y = ( $sourcefile_height / 2 ) - ( $watermarkfile_height / 2 ); // if a gif, we have to upsample it to a truecolor image if($fileType == 'gif') { // create an empty truecolor container $tempimage = imagecreatetruecolor($sourcefile_width, $sourcefile_height); // copy the 8-bit gif into the truecolor image imagecopy($tempimage, $sourcefile_id, 0, 0, 0, 0, $sourcefile_width, $sourcefile_height); // copy the source_id int $sourcefile_id = $tempimage; } imagecopy($sourcefile_id, $watermarkfile_id, $dest_x, $dest_y, 0, 0, $watermarkfile_width, $watermarkfile_height); //Create a jpeg out of the modified picture switch($fileType) { // remember we don't need gif any more, so we use only png or jpeg. // See the upsaple code immediately above to see how we handle gifs case('png'): header(Content-type: image/png); imagepng ($sourcefile_id); break; default: header(Content-type: image/jpg); imagejpeg ($sourcefile_id); } imagedestroy($sourcefile_id); imagedestroy($watermarkfile_id); } ? Regards, Greg http://www.psmdev.com http://www.psmdev.com/ On 8/4/07, *Tom Ray [Lists]* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create security code images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added. How would one go about doing that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php http://www.php.net/unsub.php I'll test this tonight...thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Open Source Job Wanted system
Joey wrote: Has anybody had any experience with any open source Job posting systems out there? Thanks! I've written one myself. It allows for job seekers to put up a profile, resumes, etc and for employers to post their jobs and search resumes. Full search ability on both sides. They can even opt for Hot Resumes or Hot Jobs for higher/preferred listings in the search. I'm not sure what else is really out there. I guess it will all depend on what you're looking to do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a variable for include statement
Jeff Benetti wrote: Sorry if this is a noob question, I have used PERL, TCL and VB but I am just getting into PHP. If there is a better place to ask noobie questions then let me know. I want to use the include statement but I want to pass the name of the file rather than hard code it. It seems that PHP needs the file to be in its defined PATH in order to do this (or am I wrong?). My code works OK if I use hard coding Example (works) include ('somefile.php') Example (doesn't work) $TheFile = somefile.php include ($TheFile) Am I trying to do something that is impossible? If it is a path problem then how do I get around this, I can control my local server config but I only have a local server for development. Thanks, Jeff Jeff, there are a couple ways you can do this. 1) include(/path/to/.$TheFile./); 2) include $TheFile; Notice the lack of brackets in the last one. Either way has worked for me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Public Announcement
Greg Donald wrote: On Tue, 11 Sep 2007, Stut wrote: You didn't say what you have against mod_rewrite. I'll bet you mod_rewrite can parse a request and send it to the right script faster than your PHP implementation. Has anyone tried Nginx? The rewrite rules are a bit more clear than those of the Apache mod_rewrite variety. http://wiki.codemongers.com/NginxHttpRewriteModule But is it the greatest weapon system of our time? If its not then it's nothing to me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compose MP3 from a php enabled flash page.
John Taylor-Johnston wrote: I have an educational web site. I want to create an interface where my students can record their voices client side and then save messages server side. I thought Odeo would solve my problems. (The have their own problems now.) Then I tried: MyChingo and Mobasoft. COme on $6,000 for a site licence. Are there any php alternatives? Or do you know an flash code I can find in sourceforge, that I might hack, or combine PHP Flash so they can record me messages in mp3 and submit them? John John- I guess my question is do you really need Flash for this? If they are uploading their recorded messages client side then they should be able to record/convert the audio files to .MP3 before even uploading them. If you just need the files somewhere online where you can download them for playback later (or even stream from the site) then really all you need is an Upload script that will take their audio files and upload them to the server to a specific location. Now if you want to offer a conversion of WAV to MP3 for them, I suggest FFMpeg, it's run on the server side. You can modify your upload script to not only upload the WAV file but then convert it out to MP3 to a specific location using FFMPeg commands then trash the WAV file. Do you have control over the server or are you just hosting your website there? You'll need to find out if the upload function is even turned on and what the max file size for upload is. Otherwise you'll just have to make a few minor adjustments to your php.ini to handle the larger file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Parse Issue
[EMAIL PROTECTED] wrote: I am having a issue parsing an html file. I want to pull all the data between two html tags. Problem I am having is that no matter what I try I can pull either tag or both but not the data in between. div class=record id=one div class=rideon h2 spanWelcome to Rideon/span /h2 /div /div /div class=record id=one function datamatch($document) { preg_match_all('/div class=record [^]*(.*)/\/div class=record [^]*/i',$document,$elements); $match = implode(\r\n,$elements[0]); return $match; } This should return the following div class=record id=one div class=rideon h2 spanWelcome to Rideon/span /h2 /div /div /div class=record id=one You may want to try escaping your quotations. That could cause some issues. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which PHP-Editor to use?
Stut wrote: Zoltán Németh wrote: 2007. 10. 16, kedd keltezéssel 04.59-kor mooor ezt írta: I recommed you Codelobster php edition. Very good free php editor. It reminds me a mix of Zend Studio and MS Visual Studio. If to the basic features they are: syntax highlighting, an intelligent outocomplete, step by step debugger, help on php, html, mysql; jump to funtion's or class's declaration in the project; search within the project; highlighting of paired tags and brackets; Calss View. I like that it has small size - only 5 mb. Free. I've downloaded from: http://www.codelobster.com Good luck! wow I haven't seen that thread for several weeks. this is really thread resurrection lol :) anyway, this thread has been talked to death a million times, so we could just let it drop finally (I thought we already did it...) ;) Nahh. I wanna hear more about the Drug and Drop function for loading a new file. Cause everyone knows that for best results you've gotta drug files before you drop them into an application. http://www.codelobster.com/details_phped.html (end of page) -Stut I thought it was you had to drug the programmers so they can handle the insanity of the clients that have no idea how anything works and expect you to deliver the world on a silver plater while never paying more then $99 for the project. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Max File Upload
Is there anyway to overwrite the max file upload in php.ini per instant? I'd like to have users controlled on a certain website to have more then average uploads but the site runs on a shared hosting environment. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script timing out.
I just installed PHP Open Chat and I'm getting an error when I log in about the script being unresponsive. Anyone ever run into this? Or could shed a light as to what causes this error? I've never seen it come up before.I'm running PHP 4.4.2/Apache 2.0.5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] User question for PHP
Is it possible to have a PHP script execute as the user of the domain instead of the webserver? So when I upload files through a PHP script they are owned by me and not wwwrun or nobody? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem compiling PHP 4.4.2 with mcrypt
I have to get a temporary server in place under a tight time frame and am using a pre-existing server that wasn't configured really for hosting websites. I've upgraded all the services on it like going from Apache 1.3.x to Apache 2.0.59 and PHP from it's old version to 4.4.2 however I need to have mcrypt compiled with PHP and I'm running into a problem. If I compile PHP without mcrypt I can install PHP without issue. However, when I try to compile PHP with --with-mcrypt=/usr/local/mcrypt I get the following error: main/internal_functions.lo -lcrypt -lcrypt -lmcrypt -lltdl -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [libphp4.la] Error 1 Now I went back and compiled without mcrypt and looked for that line and this is what was there: main/internal_functions.lo -lcrypt -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la I see that along with -lmcrypt not being there neither is -lltdl is there something I'm missing? Do I need to have something else installed on the box? Normally I haven't had this problem with this. But this is an old suse 8.x box that is being used due to time frame issues. Like I said I can compile PHP without mcrypt, but the project requires mcrypt so any help on this would be appreciated. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Probably a dumb question but...
I've just installed PHP 4.4.4 with CLI disabled and CGI enabled. With CLI I can find the PHP executable in $prefix/bin/php but with CGI I can't find it. I need the path to the PHP executable so I can install suPHP but $prefix/bin/php no longer exists and all I have in $prefix/bin is php-config and phpize if I want to replace a call to $prefix/bin/php with the CGI version what would the system path be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php cli and mysql
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200: On 11/14/06, James Tu [EMAIL PROTECTED] wrote: I'm running a php script from the command line (I'm on OS X) and I'm getting ... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) touch /var/mysql/mysql.sock chmod 777 /var/mysql/mysql.sock How could that possibly help? Because if the mysql.sock file is missing the mysql server won't start. If the mysql server isn't running the PHP script won't work. So I think it helps a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php cli and mysql
Chris wrote: Tom Ray [Lists] wrote: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200: On 11/14/06, James Tu [EMAIL PROTECTED] wrote: I'm running a php script from the command line (I'm on OS X) and I'm getting ... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) touch /var/mysql/mysql.sock chmod 777 /var/mysql/mysql.sock How could that possibly help? Because if the mysql.sock file is missing the mysql server won't start. If the mysql server isn't running the PHP script won't work. So I think it helps a lot. Actually the opposite - it becomes a lot harder to debug/diagnose. PHP uses the socket file to talk to mysql if you connect to 'localhost' rather than using a tcp/ip connection. If the socket file is invalid (as this would be), then mysql_connect fails, mysql_query fails and so on. The problem as it turns out was that php was looking in the wrong place, if this file was there and empty, then you'd get completely different errors which would make it harder to find the original problem. Well that's odd because on all my servers the mysql.sock is empty and if it's missing mysql tells me it can't find the sock file when it starts up. This wasn't an actual PHP problem, even trying to connect to the mysql server via /usr/local/mysql/bin/mysql -u user -p database would have produced that error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions Issue
We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
phpinfo() says that sessions are disabled. So, between that and the fact I get the undefined function errors when I try to use session_start() or other session commands, I'm under the strong impression that sessions are disabled. So this leads me back to my original questions, can I activate sessions without recompiling? And if I can't, how do I recompile since I used the SuSE cd's and YasT? John Nichel wrote: Tom Ray [Lists] wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! What does phpinfo() say? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
Yeah, I thought about that. But to be honest, I don't know how to recompile with builds from the CD/rpms. This is the first time I've ever done it this way. So if I get the latest RPM and install it it should activate session right? And then I just need to restart apache2 and I should be good? Burhan Khalid wrote: On Jul 29, 2005, at 8:07 PM, Tom Ray [Lists] wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 I don't *think* there is a separate module/rpm for sessions, so you are off to a recompile job. While you are it, upgrade your PHP to the latest stable version. 4.3.4 is quite old. Maybe there is a new package for SuSE that does it? (not really familiar with SuSE). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
Again, this won't affect anything since I installed from the CD's and I've always noticed that things installed via CD/rpm have different install paths then source. I'm worried it will look in the wrong spot for Apache...but that could be a un-needed worry. Rory Browne wrote: On 7/29/05, Tom Ray [Lists] [EMAIL PROTECTED] wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? Don't know - Don't have SuSE 2) If I can't, how do I recompile this since I used the SuSE cds? Head to www.php.net and hit the downloads section. unArchive the source, and type ./configure --help to get a list of the compilabel extensions. Once you're done, you can ./configure --with-this --without-that --enable this-thing --disable-that-thing The compile instructions(a file called INSTALL AFAIR) and the PHP manual are among the best docs I've ever seen. It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! 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
Re: [PHP] Message check then post
George- Without seeing your code it's hard to say what the problem is. There could be a typo, a missing quote or semi colon. The code snippet of the review page would be helpful. Now when you say it's entering blanks into the database, I'm assuming you have a messageID field in the db that auto increments in some way, and that you're seeing a new messageID generated and the remaining fields are blank? If that's the case perhaps you're delcaring those variables without data some where in your script. I would need to see your code in order to tell you better. Assuming everything is good, you need to pass your data from the check message page to your submit page by POST so hidden fields would be good. I'm also noticing that you're not escaping your data before you insert it into the database. This could be bad as quotations, apostrophes, and the such will cause your insert command to fail. Try this: $username=mysql_escape_string($username); $name=mysql_escape_string($name); $message=mysql_escape_string($message); mysql_query(INSERT INTO forum (user,name,message) VALUES ('$username', '$name', '$message')) or die(Insert Failed); You should have some debuging built into your script so you can see where it errors out. Have you watched your mysql log file to see what happens during your query? Do you actaully the query happen in the log file? Or do you not have access to it? Posting your code and any errors would help us figure out what the real problem is. George B wrote: I am coding a message board. I am about done. I have all the forms needed for the message. So it all works out. The user types in his name, message title, and the message itself. Then clicks submit. The Submit button takes him to the message check. The message check shows all the stuff the user entered. Then it has echo which says 'Is this correct'? And then there is a button. Yes When the user clicks yes it goes to another PHP file which runs the SQL query to put in the entereddata into the database $query = INSERT INTO forum (user,name,message) VALUES ('$username','$name','$message'); $result = mysql_query($query); But see, the problem is that it is entering blanks into the DB. I think that is because the $username $name and $message are in the other file? I have no idea how to by-pass this problem. What should I do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD
Beauford wrote: Hi, I am trying to get GD working so I can use a captcha script and not having much luck. I can get it to work in Windows, but not Linux. I have seen a few comments suggesting that PHP needs to be compiled with the GD switch. Is there another way to do this? I have PHP, MySQL and Apache installed and working great, I don't want to have to recompile PHP and have it screw up everything just for one program. Any help is appreciated. B I would say this is more a GD issue than a PHP issue. Can you get GD to run from the command line? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD
Beauford wrote: I'm using Slackware 10 and installed GD as an install package. I also changed some lines in the php.ini file for GD. Tom: I have no idea how this program works, all I know is that I need it for the captcha program to display the image. I wouldn't even bother otherwise. Thanks. B Well, do you know where it is installed? I have mine installed in /usr/local/gd so to test it I just ran gd2topng via /usr/local/gd/bin/gd2topng it will ask for image information etc. If it does that then you're golden. The downside is you will need to recompile PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie Question
I've run into something rather odd with cookies today. I'm working with this admin section on a site and I'm setting a cookie that is supposed to be good for one hour. So in the cookie I have time()+3600 and all was well or that was until someone fired up IE. It seems that IE refused to set the cookie. After much swearing at IE, I found that if I set it to time()+7200 the cookie would be set. Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie said it would expire at 8PM which is correct. However, when I logged in via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for those who don't know)...so my question is...why is this happening and why does IE do this? I checked in Opera, Mozilla and Netscape and they all work the same as Firefox. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_save_path() issue
Hey there- I went to install phpopenchat today and when I run the test.php script that comes with, I get this error: *Fatal error*: Call to undefined function: session_save_path() in */path/to/website/htdocs/phpopenchat/config.inc.php* on line *98 *I'm not sure why this is coming up since the session support is installed by default.. Can anyone enlighten me? I did an out of the box install of SuSE 9.1 with apache2.0 and php4.3, is there something I might have missed in the php.ini file I need to adjust? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Issues with exec()/system()
I'm having a bit of an issue using exec() and system(). Background: I have this script that installs forum software for a client, and that works like a champ. In it I use system() to copy the the default forum directory to the specified location the client sets, along with a unique directory name for the forum. The code looks like: $dir=unique_dir; system(cp -R forum /path/of/forum/location/of/forums/.escapeshellarg($dir)); The forum directory is located in the same directory as the script. Now, this is where I run into trouble. When they delete directories, I want to backup the directory before I delete it just in case they delete the wrong information. I just can't get it to work. I've tried exec() and system() to no avail. Of course, I'm under the impression I can use tar via exec(). Currently I have: $dir=unique_dir; $cmd=tar -cf /location/of/tar/files/$dir.tar /location/of/forum/diretory/*; exec($cmd); This should work shouldn't? Any thoughts, suggestions? Anyone else done something like this? TIA Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Automatic Headers and Footers
I would have to say yes it can be done. The way *I* would do it is like this: First, I would drop a .htaccess file that allows the HTML files to run through the PHP parser. Like this AddType application/x-httpd-php .php .html The in all of the HTML docs it would look like this: -HTML- -Head- -Title-This is a test-Title- -body- -h1-? include('header.inc'); ?-/h1- Well, did it work? -h3-? include('footer.inc'); ?-/h3- -/body- -/html- The next question that comes to mind is, are all the headers and footers static? Or will they rotate? You will have to have that php code in your HTML docs, otherwise they won't know how to add the header and footer. Wendell Brown wrote: Ok guys, I think I have a challenge for you (actually, I don't think this can be done, but I've been proven wrong every time I've made that assumption with php in the past, so I'll ask anyway). Here's the question: Is there a way to have php insert headers and/or footers into all of the html files in a given directory on the fly (not actually modifying the files)? And by this I mean take an existing valid HTML file and add headers and footers and end up with a valid HTML file. Now, before some of you get trigger happy and tell me to read the manual and point me to things like .htaccess, auto_prepend_file, google and the like, think about what I'm really asking It needs to insert the header after the -body- tag and put the footer in before the -/body- tag. It needs to do this without modifications to the HTML file. And yes, I understand that by default HTML files aren't going to be effected by the auto_prepend_file (since they aren't php files) - so it will require adding HTML to the list of php parsed file types. For instance, the goal would be to take the following code: -HTML- -Head- -Title-This is a test-Title- -body- Well, did it work? -/body- -/html- and convert it to this: -HTML- -Head- -Title-This is a test-Title- -body- -h1-This is a page header-/h1- Well, did it work? -h3-This is the footer-/h3- -/body- -/html- Can it be done? I don't think so, but I leave it up to your wiles to suggest a solution Thanks!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php