Re: [PHP] PHP not reporting errors, but hangs!!

2002-12-03 Thread tech
On Wednesday 04 December 2002 11:55 am, Siva Kumar wrote: > About 3 months back I posted the following message to the list: > > On Saturday 12 October 2002 12:11 pm, Siva Kumar wrote: > > I am running Apache/PHP with Postgresql. For the past one day, whenever > > there is an error in the php script

[PHP] [Newbie Guide] For the benefits of new members

2003-08-14 Thread tech
I have been following this list for the past 1 year. I find it very useful. Just by following the discussions for a couple of months one can understand a great deal about PHP. What I proposed to do is to send this mail to the list every week. Those who do not want to be bothered just filter ou

[PHP] [Newbie Guide] For the benefit of new members

2003-08-25 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

Re: [PHP] can i ask?

2003-03-26 Thread tech
On Wednesday 26 March 2003 06:19 am, M.N. Ikhwan S. wrote: > ScriptAlias /php/ "c:/php/" > AddType application/x-httpd-php .php > Action application/x-httpd-php "/php/php.exe" > > i'm using apache 2.0 as my web server. and i'm about to ask these > question, where am i going to put these three l

[PHP] checkdate function

2003-03-31 Thread tech
checkdate function verifies whether the date is valid or not by taking month, day and year as arguments. The problem is when someone enters a three digit year by mistake (200 instead of 2003), this function does not catch it. We are separating the year part from the string and validating sep

Re: [PHP] checkdate function

2003-04-02 Thread tech
On Tuesday 01 April 2003 02:47 pm, Jon Haworth wrote: > Hi Siva, > > > checkdate function verifies whether the date is valid or > > not by taking month, day and year as arguments. > > The problem is when someone enters a three digit year by > > mistake (200 instead of 2003), this function does not

[PHP] [Newbie Guide] For the benefit of new members

2003-09-05 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-09-15 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-09-19 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-09-24 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-09-30 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-10-07 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-10-09 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-10-15 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-10-27 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. ===

[PHP] [Newbie Guide] For the benefit of new members

2003-11-03 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try

[PHP] [Newbie Guide] For the benefit of new members

2003-11-06 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try

[PHP] [Newbie Guide] For the benefit of new members

2003-11-10 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try

[PHP] [Newbie Guide] For the benefit of new members

2003-11-16 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. == 1. If you have any queries/problems about PHP try

[PHP] [Newbie Guide] For the benefit of new members

2004-10-24 Thread tech
1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php for answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.co

Re: [PHP] How do you make a directory

2002-07-23 Thread Tech Support
How about a trailing slash after the directory name ;-) like this: $dirpath = "/home/sites/home/users/demodocs/web/userforum/" . $username; you had: $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; which would try to create a new directory inside the web directory. die("$

Re: [PHP] Trouble with \

2002-07-24 Thread Tech Support
If the "\" are showing up in form posted data just do this: $newtext = stripslashes($oldtext); The slashes are put before any single or double quote by a nifty little php feature called "magic quotes". By escaping quotes in form posted data you greatly reduce the risk of sql injections and other

Re: [PHP] web page function

2002-07-24 Thread Tech Support
Hi Steve, try this: if (basename($SCRIPT_NAME) == "index.php") print "some silly message"; Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Steve Minter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 24, 2002 9:50 PM Subjec

Re: [PHP] preg_match() occurence position

2002-07-25 Thread Tech Support
How about this: $text = "this is test"; preg_match can return the first match in an optional array I'll call $matches http://www.php.net/manual/en/function.preg-match.php preg_match('/test/', $text, $matches); strpos returns the numeric position of the first occurrence http://www.php.net/manua

Re: [PHP] Sessions, how they exist and die

2002-07-25 Thread Tech Support
Hi Matt, The user's browser will retain the session cookie as long as it is open unless "session.cookie_lifetime" is set to something other than zero in the php.ini or you can also set it in your script like this: // set session cookie to expire in 30 minutes. ini_set("session.cookie_lifetime","

Re: [PHP] String Manipulation

2002-07-25 Thread Tech Support
I tested this out with success. $string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string); ### // Here is actual working code $string1 = "(Something) - is wrong with me"; $string2 = "something - (is wrong with me)"; $string3 = "something - (is wrong with me"; $string4 = "[somet

Re: [PHP] pulling records from mysql

2002-07-25 Thread Tech Support
This query will return only the 16th row SELECT firstname FROM table_name LIMIT 16, 1 This query will give you all rows up to 15 SELECT firstname FROM table_name LIMIT 1, 15 Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Tyler Durdin" <[EMAIL P

Re: [PHP] String Manipulation

2002-07-25 Thread Tech Support
ad. Sorry if I threw you off. You can just do it like this: $text_out = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $text_in); Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Mike" <[EMAIL PROTECTED]> To: "'Tech Support'"

Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble

2002-07-25 Thread Tech Support
4.2.2 will not work with apache 2.X from what I've read. However, I have heard that if you get the latest CVS of both php and apache it will work. I have not, and probably will not, go down that road just yet :-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message -

Re: [PHP] an array_key_exists() substitute for php 4.0> <4.1 ?

2002-07-25 Thread Tech Support
http://www.php.net/manual/en/function.array-key-exists.php The name of this function is key_exists() in PHP version 4.0.6. Damn those elusive manual pages :-/ Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "David D" <[EMAIL PROTECTED]> To: <[EMAIL

Re: [PHP] mySQL Queries using PHP's SESSION variables

2002-07-25 Thread Tech Support
well, you could simply loop through the session vars and build the query as you go. $query = "SELECT * FROM Inventory WHERE"; // I'm assuming you keep your item numbers in a "items" or something similar foreach ($HTTP_SESSION_VARS['items'] as $pid) $subquery .= " ItemNumber = '$pid' OR "; //

Re: [PHP] GD Library

2002-07-25 Thread Tech Support
I'm not a windoze user but if that line has a ";" at the beginning of it like you have it in your message then it is commented out! LOL. :-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Ryan Moore" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent

Re: [PHP] Help: header function

2002-07-26 Thread Tech Support
the query string to keep the session without the need for a session cookie. Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "k a m e s h" <[EMAIL PROTECTED]> To: "Tech Support" <[EMAIL PROTECTED]> Cc: "Matt" &

Re: [PHP] Installed PHP on home Win98se, now how can I get browser to see it?

2002-07-26 Thread Tech Support
You need a web server like M$ IIS or Apache. I would rather chew tin foil than run an IIS server even if it was on a win machine. You can install the win version of the Apache web server and then just browse to http://localhost/ to view your work. Jim Grill Support Web-1 Hosting http://www.web-1

Re: [PHP] High Resolution Images

2002-07-26 Thread Tech Support
This may sound silly, but you are uploading in binary mode right? Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 26, 2002 5:24 PM Subject: [PHP] High Resolution Images > Hello, > > I a

Re: [PHP] php redirect

2002-07-26 Thread Tech Support
I know what you mean about everything being M$. I'm a die hard GNU fan and therefore hate everything M$, but I can think of more than one occasion where that attitude cost me some money. I somehow still believe that if I stick to my beliefs and maybe try to convert some M$ people to host their si

Re: [PHP] PHP UPGRADE on LINUX

2002-07-26 Thread Tech Support
It really depends on what version you have now. I'd say the biggest thing to look out for is the register_globals, which is now defaulted to "Off". This will break lots of sites!!! Turn it on unless you want your phone to ring for days. Users should, however, be urged to get used to coding with i

Re: [PHP] Help: header function

2002-07-26 Thread Tech Support
nal Message - From: "Matt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, July 26, 2002 11:27 AM Subject: Re: [PHP] Help: header function > >From: "Tech Support" <[EMAIL PROTECTED]> > > To: "k a m

Re: [PHP] Help: header function

2002-07-26 Thread Tech Support
Try just header("Location: $PHP_SELF"); or header("Location: $SCRIPT_NAME") ...leave out http:// ...and your quotes are in the wrong place too. Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "k a m e s h" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: [PHP] mysql question

2002-07-26 Thread Tech Support
Congrats! Good choice! Take a look here: http://www.convert-in.com/acc2sql.htm or here: http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=convert+access+databa se+to+mysql Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Christian Calloway" <[E

Re: [PHP] sessions

2002-07-26 Thread Tech Support
okay... if register_globals is off then your session handling is going to change dramatically. You can read more on it here: http://www.php.net/manual/en/ref.session.php Basically, You still use session_start(); at the top of your page, but you never use session_register, session_is_registered,

Re: [PHP] failure notice (fwd)

2002-07-27 Thread Tech Support
That's what happens when ISP's aren't careful about what happens on their network. Getting your IP's on the black list is probably one of the worst things you can let happen as an ISP. They warn you and give you time to rectify the situation (cancel accounts/access of offenders) before they actual

Re: [PHP] CURL & SSL

2002-07-27 Thread Tech Support
cURL needs to be compiled with SSL support. ./configure --with-ssl=SSLPATH where SSLPATH is the actual path to where openssl can be found. ./configure --with-ssl=/usr works for me. Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Oscar F" <[EMAIL P

Re: [PHP] Help reg. create user and allocate space

2002-07-28 Thread Tech Support
Are you asking us how to write an entire online community program??? Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "umesh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 28, 2002 6:40 AM Subject: [PHP] Help reg. create user and alloc

Re: [PHP] php 'mail()' security

2002-07-28 Thread Tech Support
There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validR

Re: [PHP] PHP/MySQL Search Engine Query Question

2002-07-28 Thread Tech Support
Here is an idea using this method "car" would match "car", "carwash", "scar", "scarred", etc. Since this result will contain the entire boy of text you could some more matching or scoring for relevancy I had that code from a previous working project. I copied it and changed some var names to

Re: [PHP] php 'mail()' security

2002-07-28 Thread Tech Support
eb-1 Hosting http://www.web-1hosting.net - Original Message - From: "Bob Lockie" <[EMAIL PROTECTED]> To: "Dennis Gearon" <[EMAIL PROTECTED]>; "Tech Support" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, July 28, 2002 1:19 PM Subject:

Re: [PHP] PHP5?

2002-07-29 Thread Tech Support
You could join the developer's list and just read. I joined just to keep up with what's coming in future releases and it's also pretty interesting. They are constantly talking about what features/bugs need work and when they want to do a release and who will be on vacation and can't help and blah

Re: [PHP] Public Scripts in a commercial product

2002-07-29 Thread Tech Support
There are many types of licensing and it really depends on what the author licensed it under. Most are GPL. Normally the first few lines of the LICENSE file typically included with the dist will explain the details of the license. If there is not one always assume that if you use any part of it in

Re: [PHP] Public Scripts in a commercial product

2002-07-29 Thread Tech Support
Uhhh but you really should ask the author too. ;-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Tech Support" <[EMAIL PROTECTED]> To: "Chris Boget" <[EMAIL PROTECTED]>; "PHP General" <[EMAIL PR

Re: [PHP] Credit Card Validation With Expiration Date

2002-07-30 Thread Tech Support
That is correct. As long as the expiration date is past present it's fine. I used to work for another hosting company who would just "guess" new expiration dates for monthly recurring customers who had not submitted a cancellation request but who's cards had expired. As long as the date was past p

Re: [PHP] searching an array for words starting with 'p'

2002-07-30 Thread Tech Support
try preg_grep() http://www.php.net/manual/en/function.preg-grep.php example: Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 10:36 AM Subject: [PHP] searching an arra

Re: [PHP] Re: A somewhat unusual session question...

2002-07-30 Thread Tech Support
That last statement was not entirely true. The server does not have to know when someone leaves to clean up. You are right about session.gc_maxlifetime and session.gc_probability. if the maxlifetime is set to 1200 (20 minutes) and the probability is set to 1 that means that one percent of the t

Re: [PHP] mcrypt

2002-07-30 Thread Tech Support
osting.net - Original Message - From: "Purushotham Komaravolu" <[EMAIL PROTECTED]> To: "Tech Support" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 1:44 PM Subject: Re: [PHP] mcrypt > Hi, > Thanks

[PHP] Spiders, Sessions, trans SID, and mod_rewrite

2002-10-09 Thread Tech Support
Hello I'm preparing to start an ecommerce project that will require the use of sessions throughout the entire site for referrer and affiliate tracking purposes. I also plan to use mod_rewrite to make links to dynamic content search spider friendly. example: instead of /somescript.php?var1=valu

[PHP] php4 on RedHat 7.1

2001-04-26 Thread j2n tech
I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19. I downloaded php-4.0.4pl and configured and installed it. Now when I try to bring up a php page it trys to download it instead of execute. I added the "AddType" line for php4 in my httpd.conf but it made no difference.

Re: [PHP] php4 on RedHat 7.1

2001-04-27 Thread j2n tech
""Peter H. Lemieux"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Take a look at /var/log/httpd/error_log. Is there an entry for the very > first time the server was run (before you installed PHP 4.04pl)? Does > it list PHP/4.0 as installed? The initial e

[PHP] undefined symbol: SSL_CTX_set_rsa_callback

2001-04-27 Thread j2n tech
After compiling php404pl1 and Apache 1.3.12: [root@ conf]# ../bin/apachectl restart ../bin/apachectl restart: httpd not running, trying to start Syntax error on line 207 of /var/www/conf/httpd.conf: Cannot load /var/www/libexec/libphp4.so into server: /var/www/libexec/libphp4.so: undefined symbol

[PHP] How do I make an 'email this page' feature?

2004-09-29 Thread PHP Tech
Hi. I am on a tight deadline here- I am trying to get a feature on a website I am creating where you click a link on a page which says 'email this page' and it takes you to a new page with a form asking you to enter your name, email and an email address and name of a person you would like to email

RE: [PHP] How do I make an 'email this page' feature?

2004-09-30 Thread PHP Tech
r 2004 23:20 To: PHP List Subject: Re: [PHP] How do I make an 'email this page' feature? On Wed, 29 Sep 2004 22:03:07 +0100, PHP Tech <[EMAIL PROTECTED]> wrote: > > I thought by clicking the link this would be a form sending the url of the > page to the next page and so

[PHP] Can't execute external program

2005-11-20 Thread Voip tech
Hello, I cannot get exec(), system() or passthru() to run an extenal program. >From the command line it runs perfectly: [EMAIL PROTECTED] html]# /var/www/html/myprog -E 123456789098.dat sample1.txt sample1.new (no output, it just creates the file .new) Here is the php I've created, fairly simple:

RE: [PHP] looking for a PHP editor

2001-01-10 Thread Webintellects Tech Support
Ultraedit is great. To make UltraEdit "php friendly", if you goto: Advanced->toolconfiguration set: Command line to: c:\php\php -e -f %F (assumes php installed at c:\php\) Working dir: c:\php (whatever, that's just what I use) Menu Item Name : Php (ditto) che

[PHP] session question

2001-06-21 Thread Moax Tech List
I am setting up a website with a need to use some sort of session management for a large amount of users. I cannot use typical file based session managment because at any given time there could be up to a million users logged in at once. (It is a LAMP linux/apache/php4/mysql system). I am a

Re: [PHP] session question

2001-06-22 Thread Moax Tech List
st > of your system can handle that many concurrent users, then I doubt PHP > sessions will be much more of a strain on your system... unless you're > storing some huge amount of data in each session. > > Pete. > > > ""Moax Tech List"" <[EMAIL PRO

Re: [PHP] mysql_insert_id. need help!

2001-08-29 Thread Moax Tech List
post your code. - Original Message - From: "lizlynch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 29, 2001 4:32 AM Subject: [PHP] mysql_insert_id. need help! hi, i have three tables: customer username classification the user will enter my web site enter the rel

[PHP] Mining protection / security code confirmation

2004-12-02 Thread Ho!Tech Guy
I have a classified ad section on my site which uses a privacy mail function so users don't have to make their email address public. Recently though, the site has been mined (I assume) and spam is being sent. I was thinking that a "security code confirmation" type script would be good where the

[PHP] Dear Friends & Future Millionaire:

2001-02-06 Thread Hi Tech Services
AS SEEN ON NATIONAL TV: Making over half million dollars every 4 to 5 months from your home for an investment of only $25 U.S. Dollars expense one time THANK'S TO THE COMPUTER AGE AND THE INTERNET ! == BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR

[PHP] Classes Question

2001-11-09 Thread Paul - Zenith Tech Inc
I'm hoping somebody has the answer to this! I have 3 pages, one a normal PHP page, and 2 which are classes. One class, is a MySQL class I have written to connect/update users, etc And the other is the manage users on the system. Is there a way I can get the "users" class to talk to the "mysql"

Re: [PHP] Classes Question

2001-11-12 Thread Paul - Zenith Tech Inc
y("SELECT user FROM banned_users"); > } > } // end class > > hope it help, > py > > > - Original Message - > From: "Paul - Zenith Tech Inc" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, November 09, 2001 11:26 AM > Subje

Re: [PHP] Classes Question

2001-11-12 Thread Paul - Zenith Tech Inc
I did have a look in the manual, but I got lost half way through! I always think it's a good idea to describe the problem well :) Thanks, Paul "Andreas Landmark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Sun, Nov 11, 2001 at 06:09:40PM -, PaulC wrote: > > I'm hopin

Re: [PHP] Classes Question

2001-11-12 Thread Paul - Zenith Tech Inc
Thanks Andrew... I basically tried that, but without the ampersand symbols. I'll give that a try Many thanks, Paul "Andrew Kirilenko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > Hello! > > Try to declare CheckBannedUser as "function CheckBannedUser ($foo, &$db)" > and call i

[PHP] Problem with "<"

2001-11-14 Thread Paul - Zenith Tech Inc
Hi, I have a text file, which is acting as a template for apache config. I open the file, and read it in using this bit of code: $filename = DIR_TEMPLATES."/apache/subdom.txt"; $fd = fopen ($filename, "r"); $template = fread ($fd, filesize ($filename)); fclose ($fd); However, the fi

[PHP] HTTP Headers

2001-11-21 Thread Paul - Zenith Tech Inc
Using phpinfo() I can see that the header "Last-Modified" exists. How do I go about accessing the header?? Thanks, Paul -- 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 administr

RE: [PHP] changing a variable according to the input in a checkbox

2001-11-27 Thread Yoan Bosch [VDB TECH SUPPORT & DEVEL]
Hi I think if you want the user to type in a number, rather use a textbox, not a checkbox ;-)) Then call the textbox "phone" in the form you want the user to fill in, and when submitted, the variable $phone will contain the number he typed in. Then use: $prefix = substr($phone, 0, 3); if (($