try this
preg_match(/[a-zA-Z]+/i, $str);
and if you want to go the other route.
do this
preg_match(/[^0-9\(\)\-\.\ ]+/i, $str);
this will return true if it is anything other then what is listed.
numbers 0-9
(
)
-
.
Jim Lucas
- Original Message -
From: Gary [EMAIL PROTECTED]
To:
as long as you are only inserting information into the mysql db on each page
load, then you shouldn't have a problem. make sure you keep you indecies
down to a minimum.
Jim Lucas
- Original Message -
From: Craig Westerman [EMAIL PROTECTED]
To: php-general-list [EMAIL PROTECTED]
Sent:
I can make this just a little easier.. try this
$query = SELECT * FROM mytable WHERE t_state_id_state in (' .join(', ',
$state). ');
if $state happens to be the name of the array that is passed from the
multi-select
Jim Lucas
www.bend.com
- Original Message -
From: Rick Emery [EMAIL
I think to get the results you are wanting, you might try this.
input type='text' name='address[]' value=''
the address[] tells the form that this element is an array and when
submitted, will be converted into an indexed array on the process page.
so you take this new array on the process page
what are you trying to do?
Jim Lucas
www.bend.com
- Original Message -
From: John Fishworld [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 23, 2002 4:33 PM
Subject: [PHP] Still REG EX
I'm still playing about trying to validate an url
www(dot)something(dot)something !
how about giving an example of the error message(s)...
- Original Message -
From: Chris [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 22, 2002 12:59 PM
Subject: [PHP] included files not reread by php when i edit the files
While editing pages, for some reason (default
Plus, depending on how you are calling the file. Meaning if the file name
that you are calling is a static file name or dynamic file name
require() and require_once() will include a file before the php parser
starts its job, but this will only happen if the name isn't dynamic.
meaning that if
I must ask first, why don't you just use the session_destroy() function?
it will kill all related sessions variables and reset the PHPSESSID (if
that's you have it named)
Jim Lucas
www.bend.com
- Original Message -
From: SpamSucks86 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent:
you could referance the element id of the form
something like
if(window.document.form.element[1].value = )
{
do_something();
}
not sure of the exact js construct, but you get my idea.
Jim Lucas
www.bend.com
- Original Message -
From: Rodrigo Peres [EMAIL PROTECTED]
To: PHP
if you are on a unix system running with apache, you could modify the
virtual host block and have apache run as your user name and then change the
permissions of the docroot so you are the owner and group.
Jim Lucas
www.bend.com
- Original Message -
From: Mika Lindqvist [EMAIL PROTECTED]
question, is this on a process page or on a page that renders text?
Jim Lucas
- Original Message -
From: Michael P. Carel [EMAIL PROTECTED]
To: george Pitcher [EMAIL PROTECTED]
Cc: php [EMAIL PROTECTED]
Sent: Monday, February 25, 2002 5:44 PM
Subject: Re: [PHP] header problem
Thank
try nl2br()
it converts \n into br
Jim
- Original Message -
From: eoghan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 26, 2002 2:23 AM
Subject: [PHP] format text
hello
i am looking for a way of formatting my text
when i select it from mysql, looking for a
there is always a way.
$IP = $GLOBALS['SERVER_ADDR'];
$IP = $GLOBLAS['HTTP_HOST'];
$IP = $GLOBALS[HTTP_SERVER_VARS][HTTP_HOST];
do a print_r() on $HTTP_SERVER_VARS and see what you get or use this
function
?
function list_array ($array)
{
foreach($array AS $key = $value)
{
echo
I should mention that if you HTTP_HOST resolves to a DNS entry, that is what
gets displayed in the HTTP_HOST
Jim
- Original Message -
From: Dominique van der Wal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 26, 2002 6:38 AM
Subject: [PHP] Damned HTTP_HOST
Hi,
I'm
http://php.blue-box.net/manual/en/function.pg-result.php
http://php.blue-box.net/manual/en/function.pg-fetch-row.php
http://php.blue-box.net/manual/en/function.pg-fetch-array.php
This should tell you all you need to know.
Jim Lucas
- Original Message -
From: * nea * [EMAIL PROTECTED]
about the only way I could think of doing something like this, is to create
a unique value for each link on a page and take on to the end of each link
for each page. then do a select to find out if that unique value has been
entered already. if you use an MD5 hashing method and combine that with
I think you are looking for the function called array_key()
http://www.php.net/manual/en/function.array-keys.php
Jim Lucas
- Original Message -
From: Tomek Golembiewski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 14, 2002 6:20 AM
Subject: [PHP] array variable name
Try closing all your { }. count them up, you are missing the closing
bracket on your while statment..
Jim Lucas
- Original Message -
From: Matthew Darcy [EMAIL PROTECTED]
To: hugh danaher [EMAIL PROTECTED]; php
[EMAIL PROTECTED]
Sent: Tuesday, February 12, 2002 10:25 AM
Subject: RE:
forgive me, I did count wrong, the problem happens to be that you are using
an ELSE on the end of a while loop. :P
Jim Lucas
- Original Message -
From: Matthew Darcy [EMAIL PROTECTED]
To: Jim Lucas [php] [EMAIL PROTECTED]; hugh danaher
[EMAIL PROTECTED]; php [EMAIL PROTECTED]
Sent
well, from what you show here you are trying to use a MYSQL timestamp format
string in a UNIX Timestamp String.
what you need to do is add add this to your select statement.
SELECT UNIX_TIMESTAMP(replace with column name) From Table;
you want to convert the MYSQL timestamp into a UNIX
you might want to check your coding, but that is a parse error waiting to
happen.
Jim Lucas
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'Nathan Cassano' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 1:54 PM
Subject: RE: [PHP] Quote in input tag
try this
if(eregi(/\+/,$variable))
Jim Lucas
- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 5:40 PM
Subject: [PHP] Checking for plus signs?
I'm trying if(eregi(+,$variable)){, but it gives me an error. What do
I
sounds like it might have something to do with leap year.
Jim Lucas
- Original Message -
From: toni baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 12:03 PM
Subject: [PHP] date problems
$date1 = 12/12/2001;
$date1 = date(D M j Y, strtotime($date1));
nope, should work.
what, if any, error messages are you getting?
Jim Lucas
- Original Message -
From: swade [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 01, 2002 12:20 PM
Subject: [PHP] php and sym links
hi,
Is there something about php that would prevent me from
if you name the checkbox fields with all the same names that look like this
( MyFormElement[] ) then it will act as an array.
then on the next page. find out if the array count is greater then zero, if
so, generate hidden elements with the value of the MyFormElement[] in a
name/value manner.
try puting an exit(); after the header().
?
header(location: someplace.html);
exit();
?
Jim Lucas
- Original Message -
From: Ben Turner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:47 AM
Subject: [PHP] Redirect problem UGH!!
I am trying to put
my question to you is, why do you want to put them into another variable?
the $row[field_name]; is already a variable. why not just use that
instead?
Jim Lucas
- Original Message -
From: Bryan Gintz [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:48
oh and mysql_fetch_object is a little slower then mysql_fetch_array()
Jim Lucas
- Original Message -
From: Bryan Gintz [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 10:48 AM
Subject: [PHP] MySQL Fetch_Array VS. Fetch_Object
Does anyone know what
how you suggest the solution is what I use all the time.
But I thought you wanted to work with is as a string.
sorry for the confusion.
Jim Lucas
- Original Message -
From: Kevin Stone [EMAIL PROTECTED]
To: 'Jim Lucas [php]' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January
yes, there is a way out, you can use readfile().
capture the output using ob_*() functions and then parse/eval that string
listed here are the functions you'll need.
http://www.php.net/manual/en/function.readfile.php
http://www.php.net/manual/en/function.ob-start.php
you must make sure that the version of PHP that is being used was built with
mysql support and/or that the drivers are being loaded for mysql.
Jim Lucas
- Original Message -
From: Uma Shankari T. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 29, 2002 6:24 PM
Subject:
?
function MyFunc($item, $args=)
{
extract((isset($args)?$args:array()));
return($item, $first_arg$second_arg$third_arg);
}
//call MyFunc()
echo MyFunc(hi there, array(
first_arg = my name ,
what OS are you running them on?
if it is linux with apache, you can override most of the php.ini settings in
the httpd.conf file
http://www.php.net/manual/en/configuration.php#AEN2200
this will show you how to override. it doesn't show it here, but this will
also work in the virtual host
would be great.
Jim Lucas
--
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]
one problem, the ftp functions that you are trying to use are on the server.
therefor you are trying to connect one server to another server. you
are not connecting from your workstation to the remote server. for what you
are attempting to do, ftp will not work.
Jim Lucas
- Original
the copy() function is subject to the same problem that the ftp functions
are. you are trying to call a function that is on the remote server and you
want it to do things to the local machine. unfortunatly you cannot do this.
through a web browser you have no direct access to the local client
Try this:
?
$maildb = file(mailaddr.txt);
foreach ($maildb as $address)
{
mail($address, This is the subject., This is the message, From:
\Jose Pablo\ [EMAIL PROTECTED] \nTo: \To Name\ $address);
}
?
Jim Lucas
bend.com
- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: Josepablo
where ever you are going to referance $HTTP_POST_VARS use
$GLOBALS[HTTP_POST_VARS] and then use that inside your function.
function myFunc()
{
foreach($GLOBALS[HTTP_POST_VARS] AS $k = $i)
{
$GLOBALS[HTTP_POST_VARS][$k] = stripslashes($i);
$GLOBALS[HTTP_POST_VARS][$k] =
$result = mysql_query( SELECT pkgid FROM plans);
while($row = mysql_fetch_assoc($result))
{
$package = mysql_fetch_assoc(mysql_query( SELECT * FROM plans WHERE
pkgid='$row[pkgid]'));
}
obviously this will have
$package = array(key = value, ...);
are you wanting to have the above be
make sure you increase your script timeout limit.
Jim Lucas
- Original Message -
From: Ronald Tezuka [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 21, 2002 2:50 PM
Subject: [PHP] Uploads
If anyone can help me out, that'd be greatly appreciated. I'm trying to
create an
function Build_Array($mysql_result_pointer)
{
if(mysql_num_rows($mysql_result_pointer))
{
$res[] = mysql_field_name($mysql_result_pointer);
while($row = mysql_fetch_array($mysql_result_pointer))
{
$res[] = row;
}
}
return($res);
}
Jim
I have seen this question reposted for the past week. now why don't you
just work with the entire thing.
get the body ...
now once you have that, do this
$str = preg_replace(body, , $str)
$str = preg_replace(, , $str)
now your $str var will only have the properties.
Jim
- Original
$GLOBALS['HTTP_REFERER']
Jim
- Original Message -
From: Kelly Meeks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 02, 2002 10:15 AM
Subject: [PHP] easy quickie..
Happy New Year,
Does php set a variable that tells you the url of the page that a user has
just come
check and make sure the you have the correct opening and closing form tags.
NS 4.x will choke if you don't have an opening and closing tag. While IE
5, 5.5 and 6 will work fine.
Jim
- Original Message -
From: Edwin Boersma [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December
when you say that nothing changed, does that include permissions on the tmp
session directory, the httpd.conf file or any related configurations?
Jim
- Original Message -
From: Phillip M.(Mike) Bishop [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 31, 2001 2:58 AM
Well, I just finished a ftp program that originally used php to catch the
uploaded file, but soon realized the it did load it into memory then dump it
into a file. I finally ended up using perl running with xinetd to capture
the uploaded file and drop it into a file. then let php play with it
take a look at this little function.. :) you might like it
http://www.php.net/manual/en/function.function-exists.php
- Original Message -
From: Andrey Hristov [EMAIL PROTECTED]
To: Paul Roberts [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, December 28, 2001 7:35 AM
Subject: Re:
I was just reading the other day the php has imap function that give you the
ability to get only the body of the message. have your cron job get that
and then strip HTML tags on that. Don't see why that wouldn't work.
http://www.php.net/manual/en/function.imap-body.php
Jim
- Original
and this
http://www.php.net/manual/en/function.imap-fetchstructure.php
- Original Message -
From: David Bouw [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 27, 2001 11:44 AM
Subject: [PHP] Translating email to (real) plain text...
Hi there,
I
I don't believe that the system variables are available to php. I work on
*nix mostly, but I have a windows machine at home running php and I can't
access any of my system var's.
- Original Message -
From: charlesk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 27,
where is the escaping happening first off?
- Original Message -
From: phantom [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 26, 2001 2:02 PM
Subject: [PHP] mysql_escape_string
How do I remove the slashes from mysql_escape_string when I pull the
string back
take the closing php tag from the end of the first line plus the openning
tag from the begining of the second line. that is sending a line feed to
the browser.
Jim
- Original Message -
From: David Jackson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 26, 2001 5:54 PM
$delimiter = \t;
$file = path/to/file/name.ext;
if($file = fopen($file, r))
{
$file_array = file($file);
foreach($file_array AS $str)
{
$new_array[] = explode($delimiter, $file_array);
}
}
now when you are done you will have an indexed array called new_array that
what does the $from var look like?
- Original Message -
From: Thomas Edison Jr. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 24, 2001 10:35 AM
Subject: [PHP] Changing From Info in eMail!
Hi,
I'm using the mail() function to send email. However,
when the reciever
hylafax
I am working on a project right now to set this up on a linux box. Should
work great.
Jim
- Original Message -
From: LDL Enterprise [EMAIL PROTECTED]
To: *PHP-General mail list [EMAIL PROTECTED]
Sent: Monday, December 24, 2001 12:15 PM
Subject: [PHP] faxing in PHP
Hi,
Is
55 matches
Mail list logo