Re: [PHP] CheckBoxes....

2002-03-02 Thread Jeff Sheltren

As far as I know, you can't name different checkboxes with the same name 
(seems odd to me to do this anyway)  When you submit a form to a php 
page, the php page will have a variable for each input item in your 
form  So if you have checkbox items named, a, b, c, and d, and 
submit a form with a and c checked, then the values of $a and $c will 
be on, and $b and $d will have no values  It's sometimes good to use the 
isset() function on checkbox items  In this case, isset($a) would return 1 
and isset($b) would return 0  Hope that helps

Jeff

At 10:07 PM 3/2/2002 -0700, Ben Turner wrote:
Don't checkboxes, if you name them all the same name, produce a comma 
delimited string in php of the values selected???

such as for 15 checkboxes with numeric values would produce a string such 
as

,,,1314,,,18

when the form was submited??  This is the way it was handled in ASP is 
there something different for PHP?

thanks!
Ben



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Jeff Sheltren

How about just typing 'mysql'  (without the quotes) if it is on the 
system and in a directory which is in your path (it should be if your host 
knows what they're doing), then that will connect to mysql for you  If 
that doesn't work, then you can either try using 'find' (type 'man find') 
for more info, or you can email your host and just ask them :)

Jeff

At 10:27 AM 3/1/2002 -0700, you wrote:
Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] elseif without else

2002-02-28 Thread Jeff Sheltren

If you are setting a variable inside of the if statements, and then 
checking that variable later, then I would say you should either use an 
else statement to give that variable a default value, or you should set the 
variable to a default value before the if statements  Your code is 
legitimate, ie there is no reason you *have* to have an else statement

Jeff

At 07:32 PM 2/28/2002 -0500, Erik Price wrote:
For any of you PHP legal eagles:

I rtfm'd, but the elseif page doesn't say -- is it okay to have

if ($x) {
// do something
} elseif  ($y) {
// do something
} elseif ($z) {
// do something
}

without a final else?  My code works fine -- so I know that you -can- do 
this  What I was wondering is if this is something that is likely to get 
deprecated at some point in the future  IOW, is it legitimate, 
regardless of how it works?


Thanks,

Erik

PS: is it bad coding style to do the above?  I'd like comments on that too 
if applicable  My if statements check for conditions and then set a 
variable, and later in the script if that variable exists then something 
else happens  Is this sloppy?




-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] How to decompress .bz2 file

2002-02-28 Thread Jeff Sheltren

Search on google!  Here's the bzip2 homepage with links to download a 
windows executable:

http://wwwdigistarcom/bzip2/

Jeff

At 10:55 AM 3/1/2002 +0530, dharmavatar wrote:
Hi,
Can any one tell me how to decompress bz2 file,I am using WINDOWS-2000 so
what are the steps?
Thanks in advance
Regards
Dharmavatar


--
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] bbcode

2002-02-22 Thread Jeff Sheltren

Why not download a forum, such as phpbb (www.phpbb.com) and check out their 
code? =)

Jeff

At 03:41 PM 2/22/2002 -0500, Leif K-Brooks wrote:
I'm planning to make a forum built into my site.  I know all of the forums
have bbcode, and I doubt they all programmed it themselves.  Is there
somewhere I can get the code for bbcode?

--
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] fdisk?

2002-02-20 Thread Jeff Sheltren

I would say it stands for fixed disk - it really doesn't format anything 
anyway, it is for partitions.

A paste from the man page:

NAME
  fdisk - create or modify fixed disk partition table

Jeff

At 11:11 AM 2/20/2002 -0500, Brian V Bonini wrote:
Anyone know what fdisk stands for?

I've heard both fixed disk and format disk,
I always thought the later

Sorry for for the OT post.

-B

--
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] Class question

2002-02-20 Thread Jeff Sheltren

Well, I guess many things are accepted now, but here's my two cents:

I wouldn't access global variables, instead you should pass everything you 
need as parameters.  Using global variables can come back to bite you 
occasionally because you may think you are changing a local variable at one 
point, but you actually change a global variable, and then who knows what 
will happen when you try to access the global variable later in your code 
expecting an int, for example, and it is suddenly a string...

As for using other user defined functions from elsewhere in your code, I 
think it depends on the context...  But think about what if you want to use 
this class elsewhere, then you will always need to copy over whatever file 
contains your other functions.  In that case it would obviously make more 
sense to contain whatever functions are needed inside of the class.

Hope that gives you some ideas.

Jeff

At 02:58 PM 2/20/2002 -0600, Chris Boget wrote:
I'm still kind of new when it comes to dealing with classes.
I'm curious, is it accepted practice for member functions of
your class to:

* access global variables
* use non member, user defined functions

Chris


--
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] timestamp confusion

2002-02-20 Thread Jeff Sheltren

Well, what you are missing is that those are the number of seconds *on that 
machine* since 1970...  so actually, if both of your clocks were set 
correctly, you should be getting the *same* number returned by 
time().  Hope that clears it up a little.

Jeff

At 03:18 PM 2/21/2002 +1100, Justin French wrote:
It doesn't seem to me like this is an issue... isn't the timestamp just
the local unix time?  It is on my LAN server.

The issue I have is that

echo date('d M Y H:m:s','1014261839');
produces 21 Feb 2002 14:02:59 on my LOCAL machine

echo date('d M Y H:m:s','1014260440');
produces 20 Feb 2002 21:02:40 on my LIVE server.

this is a difference of around 17 hours (i ran both scripts within 5
seconds of each other)

however 1014261839 - 1014260440 = just 1399 seconds.


so where am I going wrong?

there's either an issue with:

a) time()
b) date()
c) the subtraction of one timestamp from another

that i'm not aware of.


justin



Billy S Halsey wrote:
 
  Justin,
 
  Take a look at the gettimeofday() function, which returns the timezone
  and daylight-savings-time values for the system.
 
  -bsh

--
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 binary file

2002-02-19 Thread Jeff Sheltren

Hi, mine is located here: /usr/bin/php
I don't recall telling it where to put the binary (if such an option 
exists) so I assume that is the default location.

Jeff

At 09:28 AM 2/19/2002 -0500, Hunter, Ray wrote:
Has anyone compiled php on linux and found the binary executable file?


Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS

Phone:  801 887-9888
Fax:801 972-5789
Email:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
www:www.enterasys.com http://www.enterasys.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Weather Scripts

2002-02-19 Thread Jeff Sheltren

Hi, it sounds like it shouldn't be too bad, but you didn't say where you 
plan on getting the information from...

At 11:43 AM 2/20/2002 +1030, Shannon Doyle wrote:

Hi People,

I have been looking around the web lately and have noted a number of
sites are running what appears to be php scripts that parse their local
weather information and display it on their wesite.

Well, I want to do the same, however I have been searching and found
nothing that does what I want it to do. The only ones that I can find
are either the output style of weather.com (ie all or nothing) or use
their own graphics etc to display the data.

All I want to be able to do is give the current conditions (ie partly
cloudy) and the current temperature. I haven't decided if I then want to
use this info to create an image or if I will display it as straight
text.

I was wondering if anyone on this list has ever used such a script and
if their outputs were similar to what I want, and of course possibly if
I could source that script for my own use?

Any help would be appreciated.

Regards,

Shannon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] What Do You Think?

2002-02-15 Thread Jeff Sheltren

Sign me up, too!  I'd love to help with any site that promotes good beer! =)

Perhaps we start a database of pubs/bars and they can be browsed from a 
map, or a user can search for bars by name/location/rating(maybe), and they 
can also search by beers on tap.  Sounds like quite a fun project to me!

Jeff

At 04:08 PM 2/15/2002 -0600, Gonzalez, Zara E wrote:
I'd love a site like this. Let's do it quick before I go off traveling in May
(so I can find some great pubs to visit ;)

Seriously though, I haven't done much with GD (nor do I have a great deal of
freetime) but I'd be willing to help out as much as I could on this project if
anyone is serious about it.

Zara

-Original Message-
From: hugh danaher [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:14 PM
To: php
Subject: Re: [PHP] What Do You Think?

I didn't intend to start a beer discussion, but last Friday Arik was asking
for a project to do, and I was just reminding him of my suggestion.
If I can work the bugs out of my image code, I might just put up a site
where php people can input their local brewery/pub/whatever and see the
results worldwide.  It would certainly show the scope and level of
penetration of php.  Anyone out there know much about the
imagecreatefromjpeg() function?
Hugh



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Novice: Problems getting data from forms to PHP scripts.

2002-02-14 Thread Jeff Sheltren

Hi, for starters, I think you need to change your html... it should read 
something like this:

Name: input type=text name=dateidbr

Jeff

At 03:50 PM 2/14/2002 +, Sean Connelly wrote:

Hi,

I've just started to learn php. I can't seem to get any data from an
HTML form to a php script. I've had a look at the manual and the various
on-line documentation and I think I'm doing things right but perhaps
someone can advice on the following :-


File: form.php

htmlheadtitleFORM/title/head
body

form method=post action=test.php 
 Name: input type=text date=dateidbr
 input type=submit
/form

/body/html



File: test.php

?php echo Hello World!
; foreach ($HTTP_POST_VARS as $var = $value) { echo $var = $value
\n; } foreach ($HTTP_GET_VARS as $var = $value) { echo $var = $value
\n; } var_dump($HTTP_POST_VARS); echo $dateid
; echo Hello World!; ?
**
Output:-

Hello World!
array(0) { }
Warning: Undefined variable: dateid in d:\Data\Web\test.php on line 19

Hello World!

***

Now I expect the warning for undefined dateid variable as this won't
work with register_globals enviornment variable set to off. But
according to the documentation the HTTP_POST_VARS should work. By the
way, I've tried using the GET method as well.

I'm running php 4.1.1, Apache 1.3.23 on NT4 SP6 using IE5.5 and Opera
6.0 Thinking it was my setup (which took a while to get working) I
uploaded the scripts to my ISP web server and got the same results!
(Linux, Apache 1.3.14, php 4.0.3pl1)

Any ideas as to what's happening ?

Also I'd like to display some times that are also hyperlinks such that
when clicked upon they call a php function passing in the time as
data/parameter. Can someone give me hints on the best way to do this. Do
these functions have to exist in a separate file, or can they reside in
the same file as the form/hyperlink data and just reference the function
name.

Many thanks for your help.

Sean.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Jeff Sheltren

A symbolic link is like a pointer to a file.  It is like a shortcut on 
windows OS's...

Jeff

At 03:44 PM 2/14/2002 -0700, Kevin Stone wrote:
I did a net wide search on Symbolic links to learn what they are and how
to use them.  Wouldn't you know everyone's talking about them but no one
explains what they are or how to use them.  So I'm forced to ask...

What are symbolic links?  Why are they useful?  And how do I use them?

--
Kevin [EMAIL PROTECTED]


  then do a symbolic link
 
  On Thursday 14 February 2002 22:34, Kevin Stone wrote:
   I'm glad you posted this.  It's great to know.  Unfortunately it's
not
   what I need to do.  I'm uploading and updating my scripts all the
time.
   So I need to offer code views of *active* scripts.  Changing the
file
   name to phps makes the scripts inactive.
  
   Any other ideas?
  
   -Kevin
  
-Original Message-
From: SHEETS,JASON (Non-HP-Boise,ex1)
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 1:38 PM
To: 'Kevin Stone'
Subject: RE: [PHP] Anyway to open a PHP file and view its code in
the
browser?
   
Rename the file you want to display as PHP code to .phps (php
source)
instead of .php.
This will also activate PHP's built in source code highlighting.
   
Jason
   
-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 1:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Anyway to open a PHP file and view its code in the
browser?
   
   
How can I open a local PHP script and view its code to the
browser?
  
   The
  
Readfile() method appears to parse and execute the code.  The
Fopen()
method appears to parse and then not execute the code, leaving a
blank
screen, or at the very least displaying any non-PHP text existing
in
  
   the
  
script.  This is obviously rare question because I can't find any
references on this list or on Usenet.  Is there a trick to this?
Or
  
   is
  
it simply not possible.
   
Much Thanks,
Kevin Stone [EMAIL PROTECTED]
 
  --
  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] mysql_select_db() problem

2002-02-09 Thread Jeff Sheltren

It may be having a problem because you are not specifying which connection 
to use.

perhaps try something like this:

if(!$db = @mysql_connect($dbhost, $dbuser, $dbpasswd))
 die(An Error Occured. Unable to connect to the database.);
if(!@mysql_select_db($dbname,$db))
 die(An Error Occured. Unable to find the database $dbname on the 
MySQL server.);

Hope that helps.

Jeff

At 09:24 PM 2/9/2002 +0100, Nick Wilson wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,
I just can't see what could possibly be wrong with my php here:

 $sel_db=mysql_select_db(mydb) or die
 (could not get the bugger);
 exit;

I can 'USE mydb' just fine from the command line so what's the problem?
 (returns the die statement)

Much thanks..
- --

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZYWRHpvrrTa6L5oRArthAJ9Vew5DIKSR7qzc4M2abhxJfpz5TwCfRmZJ
ZBn2oUXT4UgsH1hM/UyyNGs=
=ajT+
-END PGP SIGNATURE-

--
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] escaping ?

2002-02-08 Thread Jeff Sheltren

Hi, try this:

str_replace(?xml version=\1.0\?

Jeff

At 03:45 PM 2/8/2002 -0600, Steven Jarvis wrote:
I'm trying to do some string replaces on XML files to import them into a 
prprietary db that doesn't understand XML.

I need to strip the XML tags out of the file.

However, when I use this line:

$contents = str_replace('?xml version=1.0?', '', $contents);

The ? in the string ends my php block.


I know there's an easy answer to this, and I'm probably just suffering 
from Friday afternoon burnout, but can someone let me know how to escape 
those so that I can search for them in the string?

thanks,

Steven


--
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] Preventing Identical Form Fields

2002-02-07 Thread Jeff Sheltren

Hi, I think that you could still use Chris' method, you will just have to 
do it in a loop.  Create an array of all the form fields, and then have a 
nested for loop which just checks that none of the elements are equal.

$numelements = count($fieldarray);
for($i = 0; $i  $numelements; $i++) {
 for($j = 0; $j  $numelements; $j++) {
 if($j != $i) {
 if($fieldarray[$i] == $fieldarray[$j]) {
 sendbackwitherrors();
 }
 }
 }
}

Hope that helps.

Jeff

At 11:42 AM 2/7/2002 -0500, Dave Rosenberg wrote:
Thanks Chris, but I have about 10 different fields and want to make sure 
none of those are the same.

Dave

Chris Wright wrote:

With javascript onSubmit, but that ain't php, so with
if($form1==$form2){sendthembackwitherrors()}
---



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Checking for plus signs?

2002-02-07 Thread Jeff Sheltren

The plus is a special character for regular expressions.  You need to 
escape it in order to search for a literal +

Try this:

eregi(\\+, $variable)

Jeff

At 08:40 PM 2/7/2002 -0500, you wrote:
I'm trying if(eregi(+,$variable)){, but it gives me an error.  What do I
do?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] keyword search help

2002-02-07 Thread Jeff Sheltren

Not really a php question, is it?  But what I would do is have two tables, 
a cdrom table and a keyword table.  Each cd in the cd table would have a 
cd_id, and then the keyword table could have two attributes, cd_id (foriegn 
key from cdrom table) and keyword.  Make the primary key for the keyword 
table be both of the fields, and then you'll be able to have as many 
keywords for each cd as you like.

Next time maybe ask on a database list though...

Jeff

At 02:28 AM 2/8/2002 +, Arun K.V wrote:
hello sir,
   we are creating a cdrom database in
postgresql wherein we have cd rom titlename,author,year etc and keywords
as fields. we will store a set of keywords for each record. i want to know
how to enter those keywords in to database (whether to have comma between
keywords or plain) and code to search for keywords. i.e. if i enter a
keyword then it should search for that keyword in keyword field and
display result. keywords are strings an there will also be some
combinational search. i believe u will see to this and do the needful.
thanking you
with rgds
Arun


Get free e-mail and a permanent address at http://www.amexmail.com/?A=1

--
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] Re: Newbie: Question about filesize()

2002-02-06 Thread Jeff Sheltren

At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote:
You also seem to have an extra equals. Your loop should read:

while (false != ($file=readdir($handle))){

I think you could eliminate the false != in the while condition...

It should be just the same if you write
while (($file = readdir($handle)))

right?

-Jeff




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File Uploads

2002-02-06 Thread Jeff Sheltren

The username will be the same username that apache is running as, which you 
can specify in your httpd.conf file.

-Jeff

At 10:32 AM 2/6/2002 -0500, Ben Crawford wrote:
I apoligize if this question has already been asked but

I am looking to upload files to my server.  I use a form and can get the
files to upload as user nobody with a random file name on my Linux box.
That is the problem, the user is 'nobody'.  This is either an Apache
thing or a PHP thing and I haven't been able to figure it out.  Is there
some sort of login that I should be doing.  I have tried the basic login
just to check if that will work but it doesn't.

Ben



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Check if var is a domain name

2002-02-05 Thread Jeff Sheltren

Hi, I would use a regular expression to check it.  This is a pretty general 
one, but I think it should do the trick.  It searches for 1 or more upper 
or lowercase letters, followed by a literal dot, followed by 2 or 3 
lowercase letters.  Of course there are valid domains that would not match 
this (foobar.co.uk) for example, but it should work with the values you 
specified.

if (ereg(^[a-zA-Z]+\\.[a-z]{2,3}$, $var)) {
 // valid domain
}
else{
 // not valid
}

Jeff

At 07:59 AM 2/5/2002 -0800, Brandon Orther wrote:
Hello,

Does anyone know a function or how I could make a function to check a
variable for being a valid domain name without the www. http://www./
 In fron of it?

Ex. $var = mynewdomain.com   that would be TRUE

Ex2. $var = www.mynewdomain.com   that would be FALSE

Ex3. $var = My Great Domain   that would be FALSE

And so on.

Does anyone have a function that makes sure there are no illegal
characters and there is a period in the middle of the text?



Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Dynamic Dropdown menu question.

2002-02-05 Thread Jeff Sheltren

Hi, looking at your sql statement, it seems like you are always setting 
my_job_id and job_id to the same value for each row in the table.  select 
job_id AS my_job_id is just putting the value of job_id in a variable 
called my_job_id.  Could you tell us the structure of your mysql table please?

Jeff

At 05:23 PM 2/5/2002 -0700, Michael O'Neal wrote:
Hi.

I'm working on an edit page where the pull down menu is populated from a
database.  I can't figure out how to print selected when that particular
record is the one associated with the current ID.  Can anyone help?

Here's my current code:

!-- Dynamic Career Menu--

?php

include(common.inc);


$connection = @mysql_connect($db_host,$db_user,$db_pass) or
die(Couldn't Connect.);
$db = @mysql_select_db($db_name, $connection) or die(Couldn't select
database.);


$sql =SELECT job_id,category,description,job_id AS my_job_id FROM
$cat_table_name;
$result = @mysql_query($sql, $connection) or die(Error #. mysql_errno() .
:  . mysql_error());

while ($row = mysql_fetch_array($result)) {

$job_id=$row['job_id'];
$category=$row['category'];
$description=$row['description'];
$my_job_id=$row['my_job_id'];


echo option value=\$job_id\ ;

 if ($job_id == '$my_job_id') {

 echo  selected ;
 }

echo  $title/option;


}

$num = @mysql_num_rows($result);


?
!-- /Dynamic Career Menu--


This is about the 5th iteration of this menu I've been working on.  If
anyone has any ideas, please email me at [EMAIL PROTECTED] as I am on the
digest.

Thanks,

mto

--

Michael O'Neal
Web Producer
-
  M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507



--
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] Reading log files.

2002-02-04 Thread Jeff Sheltren

Well, the first thing that comes to mind would be using the UNIX tail 
command.  Of course, this does you no good if you're on windows, but I'm 
not sure if that is the case.

if $n is the number of lines specified by the user, then the code would be 
like:

System(tail -$n logfile);

Jeff

At 12:22 AM 2/5/2002 -0300, Jared wrote:
I am creating a script that reads Radius log files and prints them to
the browser.  I want the User to be able to specify the Number of lines
they want to see beginning at the end of the file and going up instead
of reading the lines at the beginning (Which I can do).
Does anyone have an idea on how to do this?

Thanks in Advanced  Jared



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem...header already sent by

2002-02-04 Thread Jeff Sheltren

You can't send anything before you send headers...  the html tag is 
messing you up I believe.

Jeff

At 08:24 PM 2/4/2002 -0800, Peter Run wrote:
Hi,
   I get the warning message (see below), whenever I try anything with
authentication/session with PHP.  This is tried under Windows (PHPTriad).  I
get the same message with my Linux drive as well.  I appreciate your help.
Please reply here and cc: to my personal email [EMAIL PROTECTED]

Thanks in advance,
-Peter
**
Warning: Cannot add header information - headers already sent by (output
started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
C:\apache\htdocs\proj\sports\phps\verify.php on line 26
***

1. html
2. ?php
 


  23.   if (!$auth) {
  24.  header(www-Authenticate: Basic realm='Private');
  25.  header(HTTP/1.0 401 Unauthrized);
...
?
/html






--
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] crypt/Password

2002-02-03 Thread Jeff Sheltren

What you could do is send a newly generated password to them, and then 
allow them to change the password on your site to something easier to 
remember...

Jeff

At 11:56 PM 2/3/2002 +0800, Phil wrote:
Hi there,
I'm creating a user/password table that will use either Mysql Password or
PHP Crypt function to encrypt the data. I know these functions are non
reversible for good reason, but how do I deal with a situation where I want
to email out a forgotton password? How can I get the passwrd back to a form
recognisable to the user?
Thanx in advance
Phil



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Displaying a please wait while doing a file upload?

2002-02-03 Thread Jeff Sheltren

Well, although this won't wait until exactly when the image creation is 
done, you could use a meta refresh tag to refresh to your new page after a 
certain number of seconds...

Create a php page with whatever code you need, and then have something like 
this:
html
head
meta http-equiv= refresh content=5;URL='targetpage.php'
titlePlease Wait/title
/head
body
Please wait...
/body
/html

This example would wait 5 seconds before loading targetpage.php.

Jeff

At 10:00 PM 2/3/2002 +0100, Andy wrote:
Hi guys,

I would like to display something like: please wait, uploading while I am
doing a image creation which takes a while.

After the work is done, it should redirect to another page displaying
something like upload ok.

As far as I know the HEADER location satement is only valid if there is no
output in front. So I can't just echo the sentence.

Does anybody know the trick?

Thanx for your help.

Cheers Andy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Adding 6 digits to a str?

2002-02-02 Thread Jeff Sheltren

Why is it that you want to represent an int with leading 0's?  Is it just 
to print it out that way?  If that is the case, then you can use the printf 
function for formatted printing.


Jeff

At 10:53 AM 2/2/2002 +0100, Andy wrote:
Hi guys,

I am trying to force a int to be 8 digits. If it is only 3 dig filling the
first ones with 0.

Anyhow I tryed it with type casting, but it does not matter what I try, I
always get an addition.

E.g:
   $member_id is: 136
should be: 0136

Here is the code, which is still returning 136:

for($i=0;$icount($member_id);$i++){
$length = strlen($member_id[$i]);

 settype ($member_id[$i], string);
 $zero = '0';
 settype ($zero, string);

 $member_id[$i] = $zero + $member_id[$i];
 echo $member_id[$i];
}

Does anybody know how to solve this thing??

Thanx Andy



-- 
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] Securite problem

2002-02-02 Thread Jeff Sheltren

I believe that require() and require_once() have a problem with relative paths.

See here for more info:
http://www.php.net/manual/en/function.require-once.php

Jeff

At 01:24 AM 2/3/2002 +0100, Roebie wrote:
Dear all,
I have a index.php3 file in a password protected directory (on Windows)
which calls two other files with
 require_once(../code/anolislib2.php3);
 require_once(../code/pageslib1.php3);
These two files are in another (not protected) directory. When I try to open
index.php3 with IE5.5 nothing happens. The files are not included, I get no
error message and no code at all is executed.
Why is this and what can I do about it ?
Thanks for any help.
Roebie



-- 
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] Upload script with user admin

2002-02-01 Thread Jeff Sheltren

You may want to check into some of these:
http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Systems/

Jeff

At 05:34 PM 2/1/2002 +0100, ArtistHotel wrote:
Hi,

I need an upload script that lets predefined users log in and upload files.
Does such a script exist?

Regards
JEns



-- 
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] ereg et all

2002-01-31 Thread Jeff Sheltren

I'm not sure why you wanted the last word tHis to be changed to That 
(with a capital)... can you explain further?

Jeff

At 10:52 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote:
that is not what I meant... I want the cases to remain...

- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 10:47 PM
Subject: RE: [PHP] ereg et all


  try:  eregi_replace(this,that,This equals this equals tHis);
 
 
  -Original Message-
  From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, January 31, 2002 3:40 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] ereg et all
 
 
  hi,
 
  is there a simple way to replace an occurence of a string, into another,
  maintaing capital positions...
 
  Like:
  $str = This equals this equals tHis;
 
  and I wanna replace all occurences of this in that, that the result
will
  be:
 
  $str = That equals that equals That;
 
  Edward
 
 



-- 
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] ereg et all

2002-01-31 Thread Jeff Sheltren

Ahhh, ok makes more sense now.  Although, I don't think that there is an 
easy way to do what you are asking.  I think that in order to accomplish 
that, you will have to specify all possible cases of a string, and have a 
ereg_replace() statement for each of them.

Jeff

At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote:
Oh, that was a typo... sorry...

it should be:

This equals this equals tHis - That equals that equals tHat

Edward

- Original Message -
From: Jeff Sheltren [EMAIL PROTECTED]
To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 10:56 PM
Subject: Re: [PHP] ereg et all


  I'm not sure why you wanted the last word tHis to be changed to That
  (with a capital)... can you explain further?
 
  Jeff



-- 
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] Accessing piped data in PHP shell script

2002-01-31 Thread Jeff Sheltren

Have you tried running the program from your php script?

Something like:

$stuff = System(cat foo.txt);

I have done something similar, but I don't recall exactly how I did it.

Jeff

At 04:30 PM 1/31/2002 -0800, David Yee wrote:
How can I access data/parameters piped into a PHP shell script?  E.g:

cat foo.txt | php -q myscript.php

In this example I want to take the contents of foo.txt and store it into a
variable/array in myscript.php.  I tried $argv[] but no go.  Thanks.

David


--
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]



-- 
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] mysql_pconnect mysql_connect

2002-01-30 Thread Jeff Sheltren

At 11:09 PM 1/2/2002 -0500, jtjohnston wrote:
What is the difference between:

$myconnection = mysql_connect($server,$user,$pass);
and
$myconnection = mysql_pconnect($server,$user,$pass);

I read the faq.

mysql_pconnect creates a persistent connection to the server... check here:
http://www.php.net/manual/en/function.mysql-pconnect.php

-Jeff



-- 
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] mysql_pconnect mysql_connect

2002-01-30 Thread Jeff Sheltren

At 11:40 PM 1/2/2002 -0500, jtjohnston wrote:
Jim,

Thanks. What I don't really get is what persistent means.

A problem I'm having with my mysql server is that it is a whole bunch of
messages with in the space of 5 minutes like:

020130 16:11:08  C:\PROGRA~1\EASYPHP\MySql\bin\mysqld.exe: Forcing close of
thread 3  user: 'root'

All I have to do is reload the same page a dozen times.

To test out the whole thing I'm replacing all my mysql_pconnect for
mysql_connect and adding mysql_close to force a closure of the connection.
Scripts just didn't seem to be closing. Hence the question. It's supposed 
to be
persistent only until the script finishes, but I can prove otherwise. A 
windows
thing? Who knows?

John

Actually, from what I understand, with the persistent connection, it is 
left open even after the script is finished - that's why it's called 
persistent.  Read this excerpt from the link I sent you:

mysql_pconnect() acts very much like mysql_connect() with two major 
differences.
First, when connecting, the function would first try to find a (persistent) 
link that's already open with the same host, username and password. If one 
is found, an identifier for it will be returned instead of opening a new 
connection.
Second, the connection to the SQL server will not be closed when the 
execution of the script ends. Instead, the link will remain open for future 
use (mysql_close() will not close links established by mysql_pconnect()).
This type of link is therefore called 'persistent'.
Note: Note, that these kind of links only work if you are using a module 
version of PHP. See the Persistent Database Connections section for more 
information.


-Jeff (not Jim)



-- 
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] Help with Logical 'OR'

2002-01-28 Thread Jeff Sheltren

With a logical OR statement, many languages will evaluate the first 
statement, and if the first condition is true, then it will not evaluate 
the second condition, because TRUE OR (anything) is TRUE.  This saves the 
program from executing any more code than it has to.  If the first 
condition is FALSE, then the second condition will be checked.

If you are wanting both $name and $text to be true in order for the first 
block of code to be executed, then you will want to use an AND () statement.

I hope that answers your question.

Jeff

At 02:04 PM 1/28/2002 -0600, jv wrote:
It seems that only the first condition is being evaluated.

I know that if  both of the following conditions are false then the second
set of statements should get read, and that's what happens, but when I set
$name to true and $text to false (true||false) then the first set gets read.

Shouldn't both conditions be true in order for the first set of statements
be read? Why would the first set of statements get read when the conditions
are (true||false)?

Thanks in advance for your help.
james


if ($name || $text)

 {

   $text = stripslashes($text);
   print Hello $name\nbr;
   print You said:\nbr $text\n;

 }else{

   print Sorry, but you seem to have left one or more entries blank.br\n;
   print Please return to a href=\/prac/form.html\form/a\n;
   print  and complete the inputbr\n;

}
**



-- 
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] Ouch that hurts

2002-01-27 Thread Jeff Sheltren

It seems that you are running the script on a windows machine... Yet, I 
think that your php.ini must be trying to store session files in /tmp 
(which does not exist on windows).  Perhaps if you change the session path 
in the php.ini file it will fix the problem...

Jeff

At 01:50 PM 1/28/2002 +1300, Philip J. Newman wrote:
Warning: open(/tmp\sess_00fe5002ea636ad76223e15f3841da02, O_RDWR) failed: 
m (2) in d:\website\index.php on line 2

What dose this mean?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012



-- 
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] One error after another.

2002-01-27 Thread Jeff Sheltren

Can you paste the code please?  You must send the cookie before you send 
anything else.

Jeff

At 02:20 PM 1/28/2002 +1300, Philip J. Newman wrote:
Warning: Cannot send session cookie - headers already sent by (output 
started at d:\website\myphp\fitness\index.php:7) in 
d:\website\myphp\fitness\config.php on line 3

Warning: Cannot send session cache limiter - headers already sent (output 
started at d:\website\myphp\fitness\index.php:7) in 
d:\website\myphp\fitness\config.php on line 3

A

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012



-- 
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: Calculate Directory Size

2002-01-26 Thread Jeff Sheltren

I'm sorry, but I won't be much help on the windows side of things, but for
UNIX, the job is already done for you!  There is a utility called 'du',
which will tell you the disk usage of a file (or a folder and its contents).
Specifically, you would want to use the -s flag to specify only to show the
grand total, and not the size of each file...  type 'du --help' or 'man du'
at the command line to find out more.  But an example:

du -s -m /path/to/users/home/dir/

that will tell you in MB how much disk space they are using.  Careful
though, this is checking all their files recursively, so this can get
cpu/hdd intense if you are using it for lots of users.  My advice would be
to run your script when there is a low load on the server.

I hope that helps get you started.

Jeff

 Simon H [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  On advice, I've moved this from the Pear list.  I have a
  problem...hopefully someone can help, because I've no idea where
  to even start!
 
  I have a user database, with a table called Users, and fields as so:
 
  (it would be cool if this would work on both Linux and Windows)
 
  -
  User DiskUsage (Mb) Quota (Mb) HomeDirectory
  -
  jim 50 100 F:\users\jim \\ In Windows
 
  jim 50 100 /users/jim \\ In Linux
  -
 
 
  The database wouldn't be shared between Windows and Linux, just 1 or the
  other.
 
  What I would like to be able to do is, press a button on a php page, and
  scan the (MySQL or ODBC through Pear DB) database, and for each user,
  calculate the size of their HomeDirectory, and Update the DiskUsage in
the
  DB accordingly.
 
  I'm wondering tho how this would work with say 1000's of users each with
  several hundred Mb's or even several Gb's each.  The users will have
  subfolders too, so the function would have to recurse the dirs, if
  possible.
 
  Is this even possible with PHP?
 
  I appreciate any help I can get on this, because its waay beyond me
  presently.
 
  Thanks
 
  Simon H
 



 --
 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]





-- 
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] Changeing Dates.

2002-01-26 Thread Jeff Sheltren

Hi, provided that your initial string will always be in the same format
(same # of numbers) I would use the substr function.  substr(string, start,
[length])
Ex:
$mystring = 20020124020555;
$year = substr($mystring,0,4);
$month = substr($mystring,4,2);
$day = substr($mystring,6,2);

etc...

Hope this helps.

Jeff

- Original Message -
From: Philip J. Newman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 26, 2002 8:35 AM
Subject: [PHP] Changeing Dates.


I have had no luck changing:

20020124020555

into

24 01 2002 @ 0205h 55s

Can anyone put some light on this, I'm going nuts

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012




-- 
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] PHP and XHTML

2002-01-26 Thread Jeff Sheltren

Hi.  Have you tried something like:

? echo(? xml version=\1.0\ ?\n); ?

I've not tried using xml  php, but that may work...

Jeff
- Original Message -
From: Frans Englich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 26, 2002 2:53 PM
Subject: [PHP] PHP and XHTML


When I have an ? xml version=1.0 ? inside my php script it wont work
since
php parses it as php code.

 Will short_open_tag = Off solve it? I would really like to use ? ? for
the
rest of my php code...there must be a better solution than Short_open_tag


 regards,
 Cyth





-- 
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] dynamic variables in sq?l

2002-01-25 Thread Jeff Sheltren

Can you show how your mysql table is set up?  Otherwise I am not quite sure
what you are trying to do with your SQL statement.

Jeff

 And then I am trying to get the price out of a table in my database with
 this code:


 $sql = mysql_query(SELECT '$car' FROM varetabell where carid='$carid' );
 $myrow= mysql_fetch_array($sql);
 $x = $myrow[$car];

 $price = $x * $number;




-- 
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] Problem in mysql connection

2002-01-25 Thread Jeff Sheltren

What was the error message given?  Are you sure that mysql is running and
working properly?

Jeff

 Hello,

 I have installed php4 rpm in my machine.while connecting php with
 mysql it is giving fatal error.I have given like this

 mysql_connect($servername,$username,$password);

 Why it is so ..

 Is there any other files i have to install to access the database??



-- 
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] Passing objects

2002-01-25 Thread Jeff Sheltren

Well, PHP has 'sessions' which allow you to do just what you are asking,
pass variables between multiple pages.  Sessions are somewhat like cookies,
but all data is stored on the server instead of the client, so you don't
have to rely on the user to accept your cookie.

Here's a short intro/tutorial that may help you out:
http://www.devshed.com/Server_Side/PHP/Sessions/page1.html

Jeff

 I'm pretty new to PHP.  If anyone can elaborate a little on this I would
 appreciate it greatly.

 Thanks





-- 
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] Help with regular expressions

2002-01-24 Thread Jeff Sheltren

I think your problem is you are not including whitespace.  Also, remember
that . (dot) means any character except newline, so why not try this as your
reg ex:

//.*

Hope that helps.

-Jeff
- Original Message -
From: José Daniel Ramos Wey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 24, 2002 5:00 PM
Subject: [PHP] Help with regular expressions


 Hi! I´m new to regular expressions, and it seems to be an art to make it
 work as expected.

 I´m trying to remove all single-line comments from an string - that´s
 everything after // to the end of a line. I expected that this would do
 the job: ereg_replace(//[[:alnum:]]*\n,,$string), but it didn´t work.

 Any tips?

 TIA,
 Daniel Wey


 --
 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]





-- 
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] Help with regular expressions

2002-01-24 Thread Jeff Sheltren

Sorry, I forgot the newline at the end... your reg ex should look like:

//.*\n

making your command be:

ereg_replace(//.*\n,,$string)

Try that ;)

Jeff


 I think your problem is you are not including whitespace.  Also, remember
 that . (dot) means any character except newline, so why not try this as
your
 reg ex:

 //.*

 Hope that helps.

 -Jeff
 - Original Message -
 From: José Daniel Ramos Wey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, January 24, 2002 5:00 PM
 Subject: [PHP] Help with regular expressions


  Hi! I´m new to regular expressions, and it seems to be an art to make it
  work as expected.
 
  I´m trying to remove all single-line comments from an string - that´s
  everything after // to the end of a line. I expected that this would
do
  the job: ereg_replace(//[[:alnum:]]*\n,,$string), but it didn´t
work.
 
  Any tips?
 
  TIA,
  Daniel Wey
 



-- 
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] Archive of this is. Is there a URL?

2002-01-24 Thread Jeff Sheltren

Yes there is.

http://marc.theaimsgroup.com/?l=php-general

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 24, 2002 6:38 PM
Subject: [PHP] Archive of this is. Is there a URL?


 Please advise. 
 
 Thanks, Robin
 
 
 -- 
 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]
 
 



-- 
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: Resalution Dection

2002-01-24 Thread Jeff Sheltren

Yes, you can use javascript to get the user's resolution:

screen.width
screen.colorDepth

are two variables that you can access through javascript, which you might
find helpful.

Jeff

 Try Javascript.  I dont recall offhand but there are some properties you
can
 use in Javascript to detect this sort of thing.  PHP is all done
server-side
 and can't collect system properties from the user.

 Mike Frazer



 Philip J. Newman [EMAIL PROTECTED] wrote in message
 00b201c1a549$39daf0d0$0401a8c0@philip">news:00b201c1a549$39daf0d0$0401a8c0@philip...
 I'm trying to display an image only if the user has a hi resolution? can
 anyone help?



-- 
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]




[PHP] More Fun With Sessions!

2002-01-23 Thread Jeff Sheltren

Well, I was having problems getting sessions working at all on my FreeBSD
box, but they are now working...
But that leads me to more problems...

For any others that might have a problem w/ FreeBSD, try setting the
referer_check to 0
'session.referer_check = 0'

Once I changed that things seem to be working, ie. I can get a simple count
script to run with no probs, but here is where I come across a new problem.
This script works fine (it counts as I reload it):
?php
session_start();
session_register('counter');
$counter++;
echo(You have visited this page $counter times.);
?

What I am wanting to run on the site is a shopping cart app (along with some
other scripts that utilize sessions) that I wrote myself.  Everything works
fine on my home linux box, but doesn't seem to be working on the FreeBSD
box.  Maybe I am just not using sessions properly, but it is bugging me
because it works on the linux box...  Here's an example:

test.php:
?php
session_start();
session_register('counter');
$counter++;
echo(You have visited this page $counter times.\n);
?
a href=test2.phpclick here/a

test2.php:
?php
session_start();
session_register('counter');
$counter++;
echo(You have visited this page $counter times.\n);
?
a href=test.phpclick here/a

Shouldn't this hold the same counter variable for both pages?  It works fine
on my linux box, but on the FreeBSD box, $counter is always 1.  I think that
if I could get something like this script working, then the shopping cart
would also work.  Sorry for the long message!  Any help would be greatly
appreciated.

Jeff



-- 
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] More Fun With Sessions!

2002-01-23 Thread Jeff Sheltren

Thanks, everyone for responding... after much headache I seem to have got it
working.  (not fixed, but working.)  I was running php 4.0.6 on linux where
the code worked.  I just installed php 4.0.4pl1 on the freebsd box and now
everything works great.  It was probably not the best solution, but it
works... and after this project php/apache will not be used on that server
anyway, so I guess that having an older version is not the worst thing to do
=)

-Jeff

 Your code works fine on my FreeBSD box running php 4.0.4pl1 but not one
running php 4.0.6 ...  May explain your linux issues? i.e. versions of php
...



-- 
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]