[PHP] Re: mailto function to attach a photo

2001-08-28 Thread _lallous

Mail+Attach issue has been answered lots of times.
You might want to check www.phpbuilder.com you must be able to find a topic
there.

"Mark Lo" <[EMAIL PROTECTED]> wrote in message
000701c13042$9d0352a0$7c7ba8c0@mark">news:000701c13042$9d0352a0$7c7ba8c0@mark...
> Hi,
>
>   I would like to know how to use the mailto function to attach a
> specific file.
>
> Thank you
>
> Mark
>



-- 
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] Re: haX0Ring exercise :)

2001-08-28 Thread _lallous

You have to write your own function for this.

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I want a function or macro to return executable code yielding syntax
> preprocessing of binary trees. Because the Macro Processor seems to be
> somewhat messy I though a regular function might be capable of doing the
job.
>
>   e.g.
>
>btree ('(("a", "b")("c", "d"))')
>
>should be expanded to
>
>array (array ("a", "b")
>   array ("c", "d")
>
>
>   How can I archieve this?
>
>   D. Alvarez Arribas <[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]




[PHP] Re: How do I read the first n lines from a file?

2001-08-28 Thread _lallous

Fast and dirty:

function readnlines($filename, $count)
{
  return array_slice(file($filename), 0, $count);
}

//elias

"Tauntz" <[EMAIL PROTECTED]> wrote in message
003801c12fb2$685b90c0$0f00a8c0@tauntz">news:003801c12fb2$685b90c0$0f00a8c0@tauntz...
hi !

I have a simmple question :)..

Lets say that I have a file called:
list.txt
and I want to take the first 10 lines from it & echo it to the browser ?

thank you
[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]




[PHP] Suse Apache

2001-08-28 Thread Keith

would like to build/compile php as a dso !
Linux version is Suse 7.2
apache is version 1.3.19 already compiled with mod.so.c
but I don't seem to have an apache/bin and I can't find apxs which should be
there ???

Is this a Suse problem or what ??
do I have to de-install apache and re-install a normal version ??

or how do I use dso's in this one ??
cause when i try "apxs -i -a -c mod_foo.c" i just get command not found !


-- 
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] virtual() call to CGI script

2001-08-28 Thread Egan

On Wed, 29 Aug 2001 02:14:10 +1000, "Jason Brooke" <[EMAIL PROTECTED]> wrote:

>Another way you might be able to do it is find an environment variable that
>is only present when the cgi's are executed by the virtual() call,

Could not find any ...


>use the apache SetEnvIf directive combined with 

But that gave me an idea for a solution with .htaccess control, and
after some testing, I was able to work it out:


My document root .htaccess file includes:

  SetEnvIf Request_URI "the_cgi_caller\.php$" CGI_REFERER=local


And my /cgi subdirectory .htaccess file includes:

  Order Allow,Deny
  Allow from env=CGI_REFERER


The environment variable CGI_REFERER does not exist unless Apache is
processing a request for "the_cgi_caller.php" in document root, and
thus requesting any file in the /cgi subdirectory via its URL results
in a HTTP Error 403 - Forbidden.

And since PHP virtual() causes Apache to execute a sub-request, the
environment variable CGI_REFERER *does* exist while the CGI is being
called via virtual() from "the_cgi_caller.php"

It will be simple to add SetEnvIf lines to .htaccess in document root,
one for each .php file which needs to call a CGI with virtual().

This is the solution I was looking for.  Thanks for the ideas!


Egan



-- 
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] Dc /Ac motor sale

2001-08-28 Thread [EMAIL PROTECTED]

Hing Lung Motor Mfy,   New Offer   Aug-2001
http://www.hinglungmotor.com.hk [EMAIL PROTECTED] [EMAIL PROTECTED] 
Fax: 852-24817148
NO: HL101-D-D8xH6 VIBRATER MOTOR
SIZE:  20 x 15.5 x H25 MM
PRICE:  US$ 0.13/PCNO: HL307 MOTOR
SIZE: D12 x 19.5 MM
PRICE: US$ 0.38/PC
NO: HL1011-DC  SCOOTER MOTOR
SIZE: D100 x H70 MM
OUTPUT: 95 W
PRICE: US$ 13.50/PCNO: HL200 GENERATOR MOTOR
SIZE: D30.5 x H13 MM
PRICE: US$ 2.3

WE PRODUCE MORE THAN 50 DIFFERENT DESIGN
AND SIZE OF AC/DC MOTORS, THEY ARE SUITABLE
FOR OPERATION TOYS, HOUSEHOLD APPLIANCES,
RECORDS, SCOOTER, VIBRATOR, GENERATOR ETC.
¡@
 -ANY ENQUIRY ARE WELCOME-
¡@
¡@




[PHP] I beleive I have found a bug.....

2001-08-28 Thread Brian White

... I just thought I would see if anyone else can reproduce it!

Ok. The problem is in the following snippet of code. ( Note : this exmaple
is extremely contrived, and is the essence of a much more complicated
situation involving a function call from a class method... )

 "AA" , "B" => "BB", "C"=> "CC", "D"=> "DD", "E" 
=> "EE" );

 print "\n";
 foreach ( $data as $key1=>$val1 )
 {
//foreach ( $data as $key2=>$val2 )
 foreach ( array_keys($data) as $key2 )   // <= PROBLEM IS HERE
 {
 if ( $key1 == $key2 )
 print "$key2";
 else
 print $key2;

 print "  ";
 }
 print "\n";
 }

 print "";
?>

I beleive it should generate

A  B  C  D  E
A  B  C  D  E
A  B  C  D  E
A  B  C  D  E
A  B  C  D  E


Instead it generates

A  B  C  D  E


If I replace the problem line
 foreach ( array_keys($data) as $key2 )

with the alternate
 foreach ( $data as $key2=>$val2 )

then it works fine.

I am using PHP 4.0.4pl1.


Regs

Brian White

-
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901
Web:   http://www.steptwo.com.au/
Email: [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] mailto function to attach a photo

2001-08-28 Thread Jason Murray

I could never get MIME classes and the like to work, so I rolled 
my own, so to speak. It was posted here a while ago, but I have
a copy on my web server @ home:

http://planetkiller.shadow.net.au/mime-php.txt

--
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
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] mailto function to attach a photo

2001-08-28 Thread Lawrence . Sheed

You're probably going to need a mime class - Manuel Lemos makes a good one,
then send as a mime attachment.

http://freshmeat.net/projects/mimemessageclass/

Some sample code below that I use (and a mime class).

Example.php
from = "$emailfrom"; 
$mymessage->to = "$emailto"; 
$mymessage->subject = "$emailfromname sent a picture to you from
shanghaiguide.com"; 
$mymessage->headers["Reply-To"] = "$emailfrom"; 
$mymessage->headers["X-Extra-Header"] = "Pointless Header v3.0"; 
$mymessage->body = "$emailfromname sent you a picture from the
ShanghaiGuide.com site\n" . 
"\n".
"http://www.Shanghaiguide.com\n\n";.
"The Shanghai Guide - The real guide to Shanghai
Life\n\nLive Chat, Thousands of Pictures, Classifieds, Message Forum and
more...";
$mymessage->attachments[0] = $DOCUMENT_ROOT.$pic; 
$mymessage->Send();

?>



mimeclass.php
http://www.sequoiasoft.com 
Feel free to contact [EMAIL PROTECTED] and tell us how you like it! 
(Or to complain bitterly, report bugs, or suggest new features.) 

Known shortcomings/bugs: 
o guessMIMEType()only knows about a few MIME types. You can expand this as  
  you need. 
o $mime_boundary in the Send() method should be randomly generated, but it  
  isn't likely to ever hurt anything in its current form 

Example: 
 require("Mail.phtml"); 
 $mymessage = new Mail(); 
 $mymessage->from = "[EMAIL PROTECTED]"; 
 $mymessage->to = "[EMAIL PROTECTED]"; 
 $mymessage->subject = "This is your lucky day"; 
 $mymessage->headers["Reply-To"] = "[EMAIL PROTECTED]"; 
 $mymessage->headers["X-Extra-Header"] = "Pointless Header v3.0"; 
 $mymessage->body = "Doesn't it feel good to get mail?\nEspecially with
files  
 attached!\n"; 
 $mymessage->attachments[0] = "tarball.tar.gz"; 
 $mymessage->attachments[1] = "images/smiling_countenance.gif"; 
 $mymessage->attachments[2] = "/usr/share/reference/jargondict.html"; 
 $mymessage->attachments[3] = "./core"; 
 $mymessage->attachments[4] = "/etc/passwd";  //naughty naughty!! 
 $mymessage->ZipAttachments("your_files.zip"); //uncomment this to zip all  
   //the attachments into one
big  
   //attachment. 
 $mymessage->Send(); 
*/ 
class Mail { 
var $from; //The sender 
var $to; //The recipient 
var $subject; //The subject line 
var $headers; //A hash of additional headers (headername => headervalue)

var $zipname; //The name of the file the attachments are zipped into 
  //($zipname == false if attachments are to be sent  
  //individually) 
var $attachments; //An array of files to attach 
var $body; //The body text of the message 
 
//Mail constructor: initializes vars to default values. 'Nuff said. 
function Mail() { 
$this->from = ""; 
$this->to = ""; 
$this->subject = ""; 
$this->headers = array(); 
$this->zipname = false; 
$this->attachments = array(); 
$this->body = ""; 
} 
 
//Auxiliary method, used to guess a file's MIME type 
//based on its extension. Doesn't know about too many 
//extensions right now 
function guessMIMEType($filename) { 
//GUESS MIME TYPE 
$filename = basename($filename); 
if(strrchr($filename,".") == false) { 
return("application/octet-stream"); 
} 
 
$ext = strrchr($filename,"."); 
switch($ext) { 
case ".gif": 
return "image/gif"; 
break; 
case ".gz": 
return "application/x-gzip"; 
case ".htm": 
case ".html": 
return "text/html"; 
break; 
case ".jpg": 
return "image/jpeg"; 
break; 
case ".tar": 
return "application/x-tar"; 
break; 
case ".txt": 
return "text/plain"; 
break; 
case ".zip": 
return "application/zip"; 
break; 
default: 
return "application/octet-stream"; 
break; 
} 
} 

//Cute little convenience method. Supply it with a filename to  
//zip attachments to, or supply it with false if attachments are 
//sent individually 
function ZipAttachments($name) { 
$this->zipname = $name; 
} 

//The workhorse method, does the actually sending of the mail. 
//Doesn't check for errors so be careful! 
function Send($sendmail = "/usr/lib/sendmail") { 

if($this->from == "") { 
$fp = popen($sendmail . " -i " . $this->to, "w"); 
}
else { 
$fp = popen($sendmail . " -i -f\"" . $this->from . "\"  " .
$this->to, "w"); 
}

$mime_boundary = "-1747901728-14

RE: [PHP] Pulling webpages - may be a weird question :)

2001-08-28 Thread Lawrence . Sheed

Some of us live in countries where these proxy servers are banned.
I cannot access anonymiser, safesurf or any of the other open proxies.

sometimes accessing cnn is useful, so I wrote some quick and very nasty code
to retrieve and view webpages - also encrypts the url as well - China
sometimes bans via url contents, so www.someserver.com/proxy/www.cnn.com
would be banned as well.

(Chinese Government went through a phase a few weeks ago where even google
was banned, that was terrible, I rely on google every day!).

See code below (it's not good, but it works - text only)

I use it on my Shanghai site www.shanghaiguide.com in the proxy page -
www.shanghaiguide.com/proxy








No Graphics will be displayed, only a href style links are processed, proxy
is alpha version, but hey its better than nothing
http://".$URL;
}


if (isset($URLPATH)){
if (strpos ($URLPATH,"p://")) {
$URL="";
//New Site = strip out the http:// and replace
//To Do
if (substr($URLPATH,-3)=='gif') {
Header("Content-type: image/gif"); 
}
if (substr($URLPATH,-3)=='jpg') {
Header("Content-type: image/jpg"); 
}
}

//If url ends in / and urlpath starts in / strip url
trailing slash.
if ((substr($URL,-1) =="/" ) && (substr($URLPATH,0,1)=="/"))
{
$URL=substr ($URL,0,strlen($URL)-1);
}
}
else {
$URLPATH="";
if (substr($URL,-1) !="/"){
$URL.="/";
}
}


//$URL =ROT($URL,1);
//print "Encrypted URL=". $URL;
if (!$NOHDR) {

print "URL =".$URL;
//Show Browse Form Again
?>






http://";, "href=" $scriptpath "?url="$url,
$pagedata); 

$results = eregi_replace ("href=\"" ,
"href=\"$PHP_SELF?ENC=1&URL=$URL&URLPATH=",$results);
$results = eregi_replace
("src=\"","src=\"blank.gif?$PHP_SELF?ENC=1&NOHDR=1&URL=$URL&URLPATH=",$resul
ts);
print $results;

}
?>

There are better ways to do this, James Marshall wrote CGIProxy, but this is
the only one I know that also encrypts urls.


-Original Message-
From: Dan Harrington [mailto:[EMAIL PROTECTED]]
Sent: August 29, 2001 8:52 AM
To: daniel james; Jeff Lewis; [EMAIL PROTECTED]
Subject: RE: [PHP] Pulling webpages - may be a weird question :)


http://www.anonymiser.com


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 12:23 PM
> To: Jeff Lewis; [EMAIL PROTECTED]
> Subject: Re: [PHP] Pulling webpages - may be a weird question :)
> 
> 
> try readfile('http://www.somesite.com/');
> 
> it creates a mirror; it might bypass the firewall,
> depending on how the blocking software is keyed to
> activate.
> 
> -dj
> --- Jeff Lewis <[EMAIL PROTECTED]> wrote:
> > I was sitting here at work (working of course!)
> > thinking about how some sites are blocked etc from
> > viewing...  Is it possible with PHP to do something
> > like this:
> > 
> > Have a page where I can create kind of a middle man.
> >  I mean the PHP can be hosted on my server, it goes
> > to the site I'd want to view (lets say www.php.net).
> >  It then relays it to my browser but as if it is
> > coming from my server.  So can it grab the pages,
> > temp write them and server them over to me?
> > 
> > I know it seems kind of strange but I am curious
> > about it
> > 
> > Jeff
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> 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]

-- 
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] The future of PHP

2001-08-28 Thread mike cullerton

--On Tuesday, August 28, 2001 11:42 PM -0300 Manuel Lemos <[EMAIL PROTECTED]> 
wrote:

> These guys resort to these marketing tricks to promote Python as hell,
> and the PHP people just sits and waits doing almost nothing in
> comparision to promote PHP as hard as they can even when they lives
> depend on the acceptance of PHP as a wide spread language!

dear mr lemos,

 your ongoing participation in this thread has opened my eyes to views i 
had not considered before and caused me to revisit mine. however, the above 
is representative of where i think you and i disagree.

[please note that my thoughts here are really in response to the overall 
impression i received from reading all of your posts in this thread and i 
only include the above quote for my convenience. even though i'll mostly 
mention where you and i disagree, it doesn't mean i disagree with all that 
you say. indeed, i find your enthusiasm contagious and offer encouragement 
to you in your effort]

 one assumption you seem to have is the ongoing viability of php (if not 
the very livelihood of we the developers using php) is somehow a function 
of the number of folks who know what php is. that somehow the more folks 
know about php, the better php gets. it also seems that you feel 'the PHP 
people' are not putting forth enough effort to further php's acceptance and 
viability.

 from my point of view as a developer using php, recognition of php in the 
corporate world is not as important as how good php is. i prefer to see 
efforts focused on developing the best darn HTML-embedded scripting 
language this side of the railroad tracks. whether or not php gets talked 
about on the evening news doesn't really matter. what matters is whether 
php helps me as a programmer. i don't care how many folks recognize the 
power of php. i care about the power of php. the number of folks using php 
is a function of whether or not 'the PHP people' can continue to produce 
such rockin' code over the next few years. not the other way around.

 i imagine you have a unique perspective on the effort it takes to promote 
php. but, i'm guessing that 'the PHP people' probably do as well. i myself 
am unduly grateful for the effort that they put forth, not only in 
producing the rockin'st language anyone could have hoped for when learning 
to program, but in promoting php as well. when i saw php was featured at 
the open source convention in san jose, i knew things were moving along 
just fine. that's the kind of promotion i want to see. i believe 'the PHP 
people' should be allowed to promote php in a manner they are comfortable 
with. after all, it's their itch.

 ya know, making the best HTML-embedded scripting language seems a pretty 
noble goal to me.

> Regards,
> Manuel Lemos

have a good one,
mike

 -- mike cullerton

-- 
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] The future of PHP

2001-08-28 Thread Rasmus Lerdorf

> These guys resort to these marketing tricks to promote Python as hell,
> and the PHP people just sits and waits doing almost nothing in
> comparision to promote PHP as hard as they can even when they lives
> depend on the acceptance of PHP as a wide spread language!

Manuel, please, give this tirade a rest.  Nobody associated with Python
development was involved in this "amazing" marketing trick you are
referring to.  Somebody just decided to do this on their own.  And now you
are criticizing the PHP developers for not having the same foresight as
the Python developers?

It says so right in their FAQ
(http://software-carpentry.codesourcery.com/faq.html)

"And in answer to some of the more virulent postings on Usenet and in
 other venues, neither Guido van Rossum nor anyone else associated with
 Python development was involved in setting up this project, choosing the
 language, or defining the terms of the competition. Guido was only asked
 to be a judge after the decision to use Python had been made. If we
 had decided to use Perl or Tcl, we would obviously have invited Larry
 Wall or John Ousterhout to join the panel."

If somebody wants to put up $100,000 for a PHP software contest, perfect,
great, we will be every bit as cooperative as the Python developers.

-Rasmus


-- 
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] mailto function to attach a photo

2001-08-28 Thread Mark Lo

Hi,

  I would like to know how to use the mailto function to attach a
specific file.

Thank you

Mark


-- 
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] Writing to file with user as owner

2001-08-28 Thread Anton Stroganov

Hello

A quick question here: is it possible to have your script write to file with
the user's as owner and not as 'nobody' or 'www' as owner (which is what it
usually does). For example in perl one can use cgiwrap to write to file as
the user to whom the script belongs. Any way of doing this in php? Any
advice will be greatly appreciated.

Anton Stroganov
webmaster
www.artwithin.com


-- 
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] cant connect to mysql

2001-08-28 Thread Peter Houchin Sun Rentals STR Manager

Is mysql on the remote server? if so then i doubt very much that they would let 
you have root access to the DB... so you need to change your connect line to 
resemble the remote server and if it's a web hosting company that your using as 
a remote server ask for a user name you can use

>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>list-help: 
>list-unsubscribe: 
>list-post: 
>Delivered-To: mailing list [EMAIL PROTECTED]
>X-Apparently-From: <[EMAIL PROTECTED]>
>From: "Sagar N Chand" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Date: Wed, 29 Aug 2001 08:04:40 +0530
>MIME-Version: 1.0
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
>Subject: [PHP] cant connect to mysql
>X-Mozilla-Status: 
>X-Mozilla-Status2: 
>X-UIDL: 6badc33ff2c371e368ef53f676502437
>
>Hi geeks,
>
>I have a strage problem over here. I developed a site which runs fine at my 
home.
>When i hosted it on to the remote server it is giving an error saying cant 
connect
>to mysql. the error is like this
> 
>Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' 
(111) in /home/httpd/html/procbit/login.php on line 17
>
>the line 17 in my code is as follows:
>$db=mysql_connect("localhost","root","password");
>
>please help me out of this problem.
>Please reply me at [EMAIL PROTECTED] 
>
>thank you all
>sagar
>
>


--
Peter Houchin
Sun Rentals STR Manager
Phone: 03 9329 1455
Fax:   03 9329 6755
[EMAIL PROTECTED]
http://www.sun.com.au/rentals
=
 _  __   /\
/_/_/_\/  |_/  \
   /_/_/___  __  __   __  / \
   \_/_/_\  /_/ /_/ /_/  /_/  \   _ /
 ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/v
    
/_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ __  __   __  /_/   __ __
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\/_//_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/
=
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
* We rent the dot in .COM!  **


-- 
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] Re: Database Preference?

2001-08-28 Thread Manuel Lemos

Hello,

James wrote:
> 
> We have several GUI applications that we are preparing to convert to
> web-based applications, based primarily on PHP.  The applications are based
> on Informix On-Line (on a SCO Unix server) and MS SQL (on NT).  Since we
> will be doing a port, in any case, I am wondering your thoughts on whether
> MySQL may be a better database solution.  This is particularly important
> from a price-performance point of view since the other two databases are
> quite pricy on a per-seat basis.

If you don't know yet, you'd better try different database to see which
is capable of doing what you need.

On solution that would not be compromising because it would let you
change you minds later is to use a database abstraction package that
would let you write applications that are portable between databases.
That way you may try different databases with the same code and make up
your minds when you feel ready.

You may want to try Metabase which is a PHP database abstraction package
that lets you write portable applications and among other databases
supports those that you meantioned.

Metabase is freely available from here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Regards,
Manuel Lemos

-- 
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] The future of PHP

2001-08-28 Thread Manuel Lemos

Hello,

Julio Nobrega Trabalhando wrote:
> 
>   Hi Manuel,
> 
>   Great post. I enjoyed the part where you said it would be a good idea to
> do some 'competition' with php programmers, sponsored by some company.

Actually, what I was suggested was not invented. It seems some body with
great interest to promote Python invented this "Open Source Software
contest" offering $100.000 in prizes. It is funny that they call it
"Open Source software contest" but the rules explicitly said that only
Python entries would be accepted. The contest was to develop software
development tools that would probably would cost that much if they
contracted qualified developers to write them on demand.

This way, not only they got the tools that they wanted all in Python,
developed by the best contenders, and even managed to promote Python as
if it is the big language of the century so that it would be the only
right choice for developing those tools! Yeah right! :-)

These guys resort to these marketing tricks to promote Python as hell,
and the PHP people just sits and waits doing almost nothing in
comparision to promote PHP as hard as they can even when they lives
depend on the acceptance of PHP as a wide spread language!

Look here to see the trick:

http://software-carpentry.codesourcery.com/contest-rules.html

Regards,
Manuel Lemos

-- 
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] cant connect to mysql

2001-08-28 Thread Sagar N Chand

Hi geeks,

I have a strage problem over here. I developed a site which runs fine at my home.
When i hosted it on to the remote server it is giving an error saying cant connect
to mysql. the error is like this
 
Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in 
/home/httpd/html/procbit/login.php on line 17

the line 17 in my code is as follows:
$db=mysql_connect("localhost","root","password");

please help me out of this problem.
Please reply me at [EMAIL PROTECTED] 

thank you all
sagar





Re: [PHP] The future of PHP

2001-08-28 Thread Manuel Lemos

Hello Zeev,

Zeev Suraski wrote:
> 
> At 23:02 26-08-01, Manuel Lemos wrote:
> >I don't think we have the same understanding of what is marketing. For
> >me, marketing is being proactive in terms of promoting something before
> >the potential market. Seeing people advocating PHP or analysts covering
> >PHP here and there is not proactive at all. It is a result of the
> >evolution of PHP capabilities, but it was not something that was
> >especifically planned.
> 
> Well, that's not quite true.  The analysts that are beginning to show
> interest are a result of efforts being made in certain companies.  As for
> advocating, I specifically mentioned companies and not people, which is
> what makes it pro-active.  I think our definitions for marketing are quite
> similar :)

If when you mean pro-active you mean that's intentional and is all part
of a plan,
then  we agree. If you acted somehow to promote PHP and got some
unexpected results
(good or bad) that is still marketing although not pro-active.

 
> > > At any rate, suggestions will be welcome.  I've seen the Web Developer Ring
> > > you suggested, and I think it's worth thinking (the reason I'm not going
> > > wild with enthusiasm is that I think it also has drawbacks, not only
> > > advantages).
> >
> >I don't know what drawbacks do you see, but let's discuss it openly.
> 
> Well, not all of the sites are of the same quality and enjoy the same
> maintenance level.  Such sites may have a good audience and may be a good
> service, but they won't necessarily do a good job at presenting PHP.  They
> may (will) also overlap in content, which would also not look very
> professional either.

If you are going to descriminate sites based on subjective criteria,
like matters of taste or points of view that vary greatly from person to
person, that is bad because you will certainly leave out contributions
that could help greatly PHP and in the end yourself.

It would certainly would make you look arrogant if you get to be picky
as if including some sites and not others you would be doing somebody
else a favor when the promotion that PHP gets from the sites will always
benefit you direct or indirectly.

If I were you I certainly would not rule out sites with content that
overlaps others. Why not accept all sites that provide PHP articles? One
site may not be as good or as complete as other today, but they may
improve over time enough to be technically better than others that you
picked before. What would you do then? Accept what you refused before
and then discard what you accepted before? Doesn't seem to be a good
idea.

Anyway, in a Web ring banner you only promote a site at each banner
view. I don't see the problem of rotating banners of overlapped content.


> Things like that are usually not that simple, or in other words, they're
> easier said than done.  If done sloppily, they can have a negative
> effect.  And doing them correctly requires substantial efforts.

You sound bureacratic. You should feel honoured by the extra promotion
that all the PHP content sites give you because your business depends on
PHP acceptance in the market. Why make it hard for sites that are
willing to help you in the end?

I think it is fair enough to make some base rules like "don't be too
lame" (define "too lame"), but almost everybody should be accepted.


 
> >Ok, it is not fading out, but it is fading, meaning it is no longer the
> >exciting thing that it seemed to be and was attracting some many people
> >from everywhere.
> 
> I disagree even with the toned-down version :)  I think that the Web as a
> medium is one of the most promising infrastructures around.  True, the hype
> is gone, but that's a good thing.  I don't think the hype moved anywhere
> else, it's just gone (for now :)

I guess you just say that because you were simply not affected by the
major Internet layoffs that happened in the latest months, so you don't
seem to have a great idea how bad this has been for so many people.

Of course the Internet is not gone. It just happens that the number of
companies with business depending on it was drastically reduced. So,
there aren't so much employment and business opportinities as before.
That's what I mean.

 
> >It is not a matter of loosing that focus, but rather enlarge the focus
> >of PHP that is adverstised for things that some people are already using
> >it seriously.
> 
> By definition of the word focus (well, almost), there's no real way to
> 'enlarge' it without losing it.  We can play with words forever, though :)

Ok, I meant enlarging the focus area, but I agree, there's no point in
carrying on with playing with how each other expresses in English. :-)

 
> >Anyway, lets just concentrate on the Web development focus. Web
> >development is not just Web scripts that are served by the Web server.
> >Web development is also, installing and maitaining applications and also
> >run processes that run separately from the Web server.
> >
> >You know you can run P

[PHP] perl-esque data parsing for hex post variables

2001-08-28 Thread Jason Mercer

I can't get the php to convert audio data to nicely formed binary wav
format. For instance, in perl you simply do a

$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

and you're done with it.

In php, there are two problems:

1. no existence of a handy builtin hex2bin() function (though many have been
written, such as

function hex2bin($hex_str)


for ($i = 0; $i < strlen($hex_str); $i += 2)


$bin_str .= chr(hexdec(substr($hex_str, $i, 2)));

}

return $bin_str;

}

which seems to get the case done,

2. But the real problem is that doing a straight hex2bin conversion is not
what that beautiful little perl script does. The part that confuses me is
the hash oriented piece /%([a-fA-F0-9][a-fA-F0-9])/ -- what exactly is it
doing? Is it just stepping through the string two characters at a time and
comparing them? Or is it doing something more ambitious and arcane that I'm
not really grasping. I tried to emulate it with the following php
workaround, but come up short...

for ($i = 0; $i < strlen($hex_str); $i += 2)


$newdata =.
preg_replace("/[a-fA-F0-9][a-fA-F0-9]/",pack("C",hexdec(substr($hex_str, $i,
2))),$hex_str);

}

Any 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] Database Preference?

2001-08-28 Thread james

We have several GUI applications that we are preparing to convert to
web-based applications, based primarily on PHP.  The applications are based
on Informix On-Line (on a SCO Unix server) and MS SQL (on NT).  Since we
will be doing a port, in any case, I am wondering your thoughts on whether
MySQL may be a better database solution.  This is particularly important
from a price-performance point of view since the other two databases are
quite pricy on a per-seat basis.

TIA,
James



-- 
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] wrapping blobbed fields

2001-08-28 Thread David Robley

On Wed, 29 Aug 2001 08:07, freshNet wrote:
> I am trying to send data from a textarea into a blob and then when
> retrieving the data populating a row in a html table with the text
> wrapping as per the wrap in the textarea.
>
> I keep getting the record in one long line of text that goes off the
> screen (ie the horizontal scrollbars show).
>
> Any help would be appreciated.
>
> Will.

nl2br() assuming that you have WRAP set in your TEXTAREA

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   NEWS! Survivor of siamese twins joins parents

-- 
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] Pulling webpages - may be a weird question :)

2001-08-28 Thread Dan Harrington

http://www.anonymiser.com


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 12:23 PM
> To: Jeff Lewis; [EMAIL PROTECTED]
> Subject: Re: [PHP] Pulling webpages - may be a weird question :)
> 
> 
> try readfile('http://www.somesite.com/');
> 
> it creates a mirror; it might bypass the firewall,
> depending on how the blocking software is keyed to
> activate.
> 
> -dj
> --- Jeff Lewis <[EMAIL PROTECTED]> wrote:
> > I was sitting here at work (working of course!)
> > thinking about how some sites are blocked etc from
> > viewing...  Is it possible with PHP to do something
> > like this:
> > 
> > Have a page where I can create kind of a middle man.
> >  I mean the PHP can be hosted on my server, it goes
> > to the site I'd want to view (lets say www.php.net).
> >  It then relays it to my browser but as if it is
> > coming from my server.  So can it grab the pages,
> > temp write them and server them over to me?
> > 
> > I know it seems kind of strange but I am curious
> > about it
> > 
> > Jeff
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> 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] Check if a word is in my string.

2001-08-28 Thread Jason Murray

> use:
> preg_match('/\Wgood\W/',$var);
> or
> preg_match('/\bgood\b/',$var);

Or, you could just try strstr($haystack, $needle) ...

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
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] is_numeric for php3

2001-08-28 Thread Steve Edberg

At 03:41 PM 8/28/01 , scott [gts] wrote:
>my understanding is that numeric is a broad term for
>number values (any value with only numbers and a
>decimal point) like 1, 5.6, 332, 0.5532, for example.
>
>integers are a sub-set of numerics, so any integer is
>a numeric value, but any numeric value is not
>necessarily an integer.
>
>$num=123 is an integer *and* numeric value.
>
>$num='123' might not be an integer, but it is
>a numeric.
>
>now the problem of how to devise a proper test for
>numeric values (without using regexps) is what i'd
>like to see.


function is_numeric($Something) { return (string)(1.0*$Something) == 
$Something; }

should work.

 -steve


++
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED] (530)754-9127 |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- Gort, Klaatu barada nikto! --+



Re: [PHP] Check if a word is in my string.

2001-08-28 Thread Papp Gyozo

Hi,

use:
preg_match('/\Wgood\W/',$var);
or
preg_match('/\bgood\b/',$var);

I don't know exactly.

- Original Message -
From: Brandon Orther <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Wednesday, August 29, 2001 12:02 AM
Subject: [PHP] Check if a word is in my string.


> Hello,
>
> I have a variable with a string in it.  I want to check if in that
> string a certain word is in it.  Example
>
> $var = "This is a good sentence";
>
> $check = look("good", $var);
>
>
> and $check would equal 1 since "good" is in that string
>
>
>
>
> does anyone know how to do this?
>



-- 
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] Re: subscription

2001-08-28 Thread Chris Fry

UNSUBSCRIBE



-- 
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] is_numeric for php3

2001-08-28 Thread Seb Frost

if (($var!=0) && ($var*1!=0) && is_int($var*1))
{
echo "is int";
$var=$var*1;
}
else
{
echo "is not int";
$var=1;
}

Works for me because I need an integer greater than 0.  Try it out and let
me know any problems with it.

- seb

-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 22:44
To: [EMAIL PROTECTED]
Subject: [PHP] is_numeric for php3


hi friends,

Can someone post here "the" most efficient method to validate a variable
as numeric?  I see a ton of hacks/ways in the manual user comments under
is_int, is_integer and is_numeric and would like to see just one or two
good solid ones.  And please, no regular expressions :)

Regards,
Philip




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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001


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

2001-08-28 Thread Glyndower

I have a medium sized db... with about 300 feilds and 15k rows.

I need to create a search that will submit user input to seach the db from
about 30 different feilds with some of those wildcards.

i.e bedrooms, bathrooms, price, pool, city, etc

Would using an array for the results page be the best way to approach this
in 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]




Re: [PHP] htaccess and $PHP_AUTH_USER

2001-08-28 Thread Papp Gyozo

Hi,

There is a few scripts on Zend pages.

I'm sure, this one of them will be very helpful:
http://www.zend.com/zend/tut/authentication.php

- Original Message -
From: Rene Fournier <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 9:24 PM
Subject: [PHP] htaccess and $PHP_AUTH_USER


> Please, someone, help me...
>
> What I want to do:  Have a user prompted for an ID/password, both of which
> (if valid), get passed to a PHP script, which then uses the ID/password to
> selectively display certain fields of a table.  (For example, if the user
> logs in as "Sales", he would only see the sales-related fields of the
> tables.  Whereas, if the user logs in as "Production", she would see the
> production-related fields.  Pretty simple.)
>
> I've read the PHP docs on $PHP_AUTH_USER.  One stupid question:  Must I
use
> the htaccess directory-protection feature of Apache in order for this to
> work (or is$PHP_AUTH_USER not dependent on Apache (or any web server) at
> all)?  I mean, from reading the docs, it seems as if the value stored in
> $PHP_AUTH_USER comes what the user types into the Apache-spawned dialog
box
> (when the user types the URL containing that password-protected
> directory.)??  The thing is, when I turn password protection on for the
> directory in question, and add the users and passwords to the htaccess
file,
> then go to the URL in the browser, I get prompted several times for a user
> and password--first, it seems, by Apache, then by the PHP code I copied
from
> the docs.
>
> If anyone can help, I'd greatly appreciate it.  Best would be some real
code
> running in a similar server environment.  (The site in question is running
> on www.fatcow.com servers--they're running PHP3 (shouldn't matter, right)
> and Apache.)
>
> MUCH thanks in advance...
>
> ...Rene
>
> ---
> Rene Fournier,
> [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]
>



-- 
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] How do I read the first n lines from a file?

2001-08-28 Thread Hugh Danaher

If the lines terminate in "\n", I'd use fgets($fp,1000) in a loop, and loop
as many times as needed.

$fp=fopen("filename","r") or die ("couldn't open filename");
for ($count=1;$count<=10,$count++)
{
$line=fgets($fp,1000);   // the 1000 represents the number of bytes to
go to unless it finds "\n" sooner.
print "$line";
}
I'm prety sure the above will work.
Hugh
- Original Message -
From: Jon Farmer <[EMAIL PROTECTED]>
To: Tauntz <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 6:40 AM
Subject: RE: [PHP] How do I read the first n lines from a file?


> If you are on a unix box you might want to use the tail command... if you
> use exec() the output will be in an array...
>
> --
> Jon Farmer  Õ?Õ?
> Systems Programmer, Entanet www.enta.net
> Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
> PGP Key available, send blank email to [EMAIL PROTECTED]
>
> -Original Message-
> From: Tauntz [mailto:[EMAIL PROTECTED]]
> Sent: 28 August 2001 12:13
> To: [EMAIL PROTECTED]
> Subject: [PHP] How do I read the first n lines from a file?
>
>
> hi !
>
> I have a simmple question :)..
>
> Lets say that I have a file called:
> list.txt
> and I want to take the first 10 lines from it & echo it to the browser ?
>
> thank you
> [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]
>


-- 
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] Re: Need help on putting variable into

2001-08-28 Thread Hugh Danaher

Wow, I'll try it!  I don't think someone will put extra info into the cell,
but you never know.
Thanks,
Hugh
- Original Message -
From: James Holloway <[EMAIL PROTECTED]>
To: Hugh Danaher <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 7:11 AM
Subject: Re: Need help on putting variable into 


> Hi Hugh,
>
> Most of your questions have been answered, but I thought you might also
like
> to consider this:
>
> htmlentities() and htmlspecialchars()
>
> If someone uses " or > in your variable, it might mess your form up:
>
> print " name=\"comp_name\" value=\"$comp_name\">";
>
> If they type ABC Company "The Best"
>
> it becomes:
> print " name=\"comp_name\" value=\"ABC Company \"The Best\"\">";
>
> ^^
>
> The form interprets the " before "The Best" as the end of the value for
that
> field.
>
> Using
> print " name=\"comp_name\" value=\"" . htmlentities($comp_name) . "\">";
>
> will cure any woes ;)
>
> http://www.php.net/manual/en/function.htmlspecialchars.php
> http://www.php.net/manual/en/function.htmlentities.php
>
> James
>
> - Original Message -
> From: "Hugh Danaher" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: "Php-General" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 28, 2001 4:27 AM
> Subject: Need help on putting variable into 
>
>
> Help.  I have a page with a form with lots of text boxes which can be
filled
> with data from a text file.  the fopen() and fgets() works, and the text
> boxes which require numbers have no problems.  But, I have text boxes
which
> require several words of text and they refuse to work right.  The first
word
> makes it in the box, but the rest of the words are lost.
>
> As an example, the data file contains:  ABC Company, Inc. in the spot for
> $comp_name.  If I call for this variable elsewhere outside of a text box,
it
> prints in full, but when used by the following, it prints only: ABC
>
> print "";
>
> There must be something blindingly obvious that I'm missing.  Please help.
> Thanks, Hugh
>
>
>
>


-- 
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] Putting variables in a string

2001-08-28 Thread Papp Gyozo

Hi,

try to change the line in that loop to this one:
$sql .= $key.' = '.$$key.', ';

- Original Message -
From: P.Agenbag <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 7:54 PM
Subject: [PHP] Putting variables in a string


> I am trying to make a string that will contain variables.
>
> The resulting string will be a sql query string and must look something
> like
>
> " update $table_name set  key='$key' , next='$next' where id = $id"
>
> Since the variable name is the same as the key name, I tried to generate
> this string with a foreach statement looking something like this:
>
> foreach( $myrow as $key=>$val) {
> $sql .= "$key = ' \$$key ' ,";
> }
>
> This then makes the string look as follow:
>
> key='$key',next='$next', and I just add the rest of the string to the
> front and back, yet, when I now try to use this string in the
> mysql_query() function, it does not recognise the '$key' and '$next' as
> variables and add them into the db as $key and $next. I need to know how
> I am going to make this string "recognise" the variables in them.
>
>
>
> --
> 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] is_numeric for php3

2001-08-28 Thread Prottoss

You can use sprintf() to determine if a number is numeric or not.
/*
Return TRUE if numeric and FALSE if not.
*/
function is_numeric_php3($var)
{
if( !isset($var) ) 
return FALSE;

if( $var==0 ) 
return TRUE;

if( sprintf("%f", $var) ) 
return TRUE;
else
return FALSE:
}

This code seems to work and runs faster then a regex.

On Tuesday 28 August 2001 18:42, daniel james wrote:
> Ahhh, in that context, with is_integer(), i think
> you're partially right.  however, i looked it up, and
> is_numeric() will work fine.
>
> http://www.php.net/manual/en/function.is-numeric.php
>
> btw-- as for the regexps, none for me, thanks ;)
> those things give me the heebie-jeebies.
>
> --- "scott [gts]" <[EMAIL PROTECTED]> wrote:
> > i think he's asking for a numeric test, not an
> > integer test.
> >
> > your example looks like it should fail "3.50" (for
> > example),
> > even though "3.50" is a perfectly valid numeric
> > value.
> >
> > personally, i think you should just use regexps. ;-)
> >
> > i tried to write a little is_num() type function,
> > but i kept
> > getting caught on split();  it seems that split()
> > converts
> > everything to string, no matter what.  so if you try
> > to split
> > on the decimal point of 45.67 ... you get two
> > strings, "45" and "67"
> > not 45 and 67, so subsequent is_integer() calls fail
> >
> > (since is_integer() checks the *type* of the
> > variable,
> > not the *value* -- very important to keep in mind)
> >
> > here's what i came up with... perhaps it will be of
> > some
> > help to you (even though it doesnt work)
> >
> >
> > function is_num($number) {
> >
> >   // $x contains number, $y contains any decimal
> > value
> >   list ($x, $y) = split("\.", $number);
> >
> >   // if there's no decimal value
> >   if ( empty($y) ) {
> > return is_int($x);
> >   }
> >   else {
> > return ( is_int($x) && is_int($y) );
> >   }
> >
> > }
> >
> > > -Original Message-
> > > From: daniel james [mailto:[EMAIL PROTECTED]]
> > > Subject: Re: [PHP] is_numeric for php3
> > >
> > > do you mean, as in,
> > >
> > > if !is_integer($var) {
> > > print("$var is not an integer");
> > > }
> >
> > --
> > 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]
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/

-- 
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] LONGINT... ? to be or not to be?...

2001-08-28 Thread Papp Gyozo

Hello,

you should check the latest version of the manual:
http://www.php.net/manual/en/language.types.integer.php

more precisely and specifically the "integer overflow" section.

I think, you should use the arbitrary precision integer extension.
http://www.php.net/manual/en/ref.gmp.php

hth

- Original Message -
From: Alexey Prohorenko <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 8:47 PM
Subject: [PHP] LONGINT... ? to be or not to be?...


> Hello,
>
> I have one question. How can PHP work with longint (in C we call
> them "unsigned long") variables?
> F.e., I want to do next thing:
>
> 65536 & 4096 = 0 (this is right)
> 65536 & 65536 = 65536 (again, everything is okay)
> 196608 & 65536 = 65536 (perfect, it works great)
>
> but,
>
> 3221225472 & 1073741824 = 0 (this is wrong, right answer isn't 0
>  but 2147483648)
>
> So, can anybody help me with this? Any suggestions?
>
> Thanks, anyway. Looking forward your answers.
> Will check my mailbox every 5 minutes. :-)
>
> --
> green
> [http://www.extrasy.net]
> [http://www.unix-how-to.net]
>
> --
> 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: The future of PHP - accessory libraries

2001-08-28 Thread Rasmus Lerdorf

> > Exactly.  When you do ./configure --with-foo=shared; make
> > then modules/foo.so will appear magically and you can dl() that or load it
> > using "extension=foo.so" in your php.ini.  You don't have to recompile
> > PHP.
> >
> > -Rasmus
>
> I am afraid that is only theory. I tried that for the snmp module and all I get
>
> is a linker error about unreferenced symbols, when I try to load it.

Which symbols?

-Rasmus



-- 
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] double check query statement??

2001-08-28 Thread Gerard Samuel

Gentlemen, thank you for correcting me with the space ont the end.  Ill 
try and make it a habit to echo out the query.

All is well in the land of PHP, till next time.



-- 
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] Exclamation point appearing from nowhere

2001-08-28 Thread Saul Ishida

Hey, please, I'm using the function mail() in one of
my scripts, but when I use it, one exclamation point
appears from nowhere in the email body. And it appears
in different places, it moves around in the email
body. It is very strange. And everytime, every email I
send, it appears, no exception.

If you could help me, I would be very gratefull!

thanks!

Saul

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] double check query statement??

2001-08-28 Thread ERISEN, Mehmet Kamil

Hi it may sound funny, but you may want to add a space at
the end of lines before ".
I mean
$query = "SELECT mpn_job.ID, job, assigned_to, status_date,
category ";
  $query .= "FROM mpn_job, mpn_job_category WHERE CID =
mpn_job_category.ID ";
  $query .= "AND category = '$category'";

also 
echo $query; 
before you run the php page to see the sql. I think your
$query is like

SELECT mpn_job.ID, job, assigned_to, status_date,
categoryFROM mpn_job, mpn_job_category WHERE CID =
mpn_job_category.IDND category
= '$category'
now, and it willl not run! 

/mehmet/
--- Gerard Samuel <[EMAIL PROTECTED]> wrote:
>   $query = "SELECT mpn_job.ID, job, assigned_to,
> status_date, category";
>   $query .= "FROM mpn_job, mpn_job_category WHERE CID =
> mpn_job_category.ID";
>   $query .= "AND category = '$category'";
>   $result = mysql_query($query);
>   $row = mysql_fetch_row($result);
>   foreach ($row as $data) {
>  echo "$data[0]";
>   }
> 
> I tried the SELECT statement from mysql command line
> (less $category, I 
> used an actual category name) and it works there.  I try
> it out in php, 
> and I get nothing.  (I echoed $category before this and
> it works 
> correctly)  Do you guys see anything in there that may
> need correcting? 
>   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]
> 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] Re: double check query statement??

2001-08-28 Thread Hugh Bothwell


"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>   $query = "SELECT mpn_job.ID, job, assigned_to, status_date, category";
>   $query .= "FROM mpn_job, mpn_job_category WHERE CID =
> mpn_job_category.ID";
>   $query .= "AND category = '$category'";
>   $result = mysql_query($query);
>   $row = mysql_fetch_row($result);
>   foreach ($row as $data) {
>  echo "$data[0]";
>   }
>
> I tried the SELECT statement from mysql command line (less $category, I
> used an actual category name) and it works there.  I try it out in php,
> and I get nothing.  (I echoed $category before this and it works
> correctly)  Do you guys see anything in there that may need correcting?

Sure - you need to have an extra space at the
end of each line... right now, it comes out like
... status_date, categoryFROM mpn_job ...
 ... mpn_job_category.IDAND category ...

I often find it useful to echo the query statement
just before using it... it makes mistakes like this
kind of obvious.

Also, if you used
$result = @mysql_query($query)
or die("Error querying: ".mysql_error());
you should get more-useful error messages.



-- 
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] is_numeric for php3

2001-08-28 Thread scott [gts]

my understanding is that numeric is a broad term for 
number values (any value with only numbers and a 
decimal point) like 1, 5.6, 332, 0.5532, for example.

integers are a sub-set of numerics, so any integer is
a numeric value, but any numeric value is not
necessarily an integer.

$num=123 is an integer *and* numeric value.

$num='123' might not be an integer, but it is
a numeric.

now the problem of how to devise a proper test for
numeric values (without using regexps) is what i'd
like to see.


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] is_numeric for php3
> 
> Hi Philip,
> 
> By definition, any string that does not contain
> alpha-characters is numeric.  I mean, '123' is an
> integer, if only because it isn't 'onetwothree', you
> know?


-- 
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] is_numeric for php3

2001-08-28 Thread scott [gts]

well.  sure, is_numeric() will work, but the point of the
exercise is to try and determine if a number is numeric
without actually calling is_numeric() or regexps.

personally, i think that regexps are swiss-army knives,
they can do almost anything -- i use them all the time,
although it took me a few months to fully understand them
and get over regexp-heebie-jeebies of my own.

> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:42 PM
> To: scott [gts]; php
> Subject: RE: [PHP] is_numeric for php3
> 
> 
> Ahhh, in that context, with is_integer(), i think
> you're partially right.  however, i looked it up, and
> is_numeric() will work fine.
> 
> http://www.php.net/manual/en/function.is-numeric.php
> 
> btw-- as for the regexps, none for me, thanks ;) 
> those things give me the heebie-jeebies.
> 
> --- "scott [gts]" <[EMAIL PROTECTED]> wrote:
> > i think he's asking for a numeric test, not an
> > integer test.
> > 
> > your example looks like it should fail "3.50" (for
> > example),
> > even though "3.50" is a perfectly valid numeric
> > value.
> > 
> > personally, i think you should just use regexps. ;-)
> > 
> > i tried to write a little is_num() type function,
> > but i kept
> > getting caught on split();  it seems that split()
> > converts
> > everything to string, no matter what.  so if you try
> > to split
> > on the decimal point of 45.67 ... you get two
> > strings, "45" and "67"
> > not 45 and 67, so subsequent is_integer() calls fail
> > 
> > (since is_integer() checks the *type* of the
> > variable,
> > not the *value* -- very important to keep in mind)
> > 
> > here's what i came up with... perhaps it will be of
> > some
> > help to you (even though it doesnt work)
> > 
> > 
> > function is_num($number) {
> > 
> >   // $x contains number, $y contains any decimal
> > value
> >   list ($x, $y) = split("\.", $number);
> > 
> >   // if there's no decimal value
> >   if ( empty($y) ) {
> > return is_int($x);
> >   }
> >   else {
> > return ( is_int($x) && is_int($y) );
> >   }
> > 
> > }
> > 
> > 
> > > -Original Message-
> > > From: daniel james [mailto:[EMAIL PROTECTED]]
> > > Subject: Re: [PHP] is_numeric for php3
> > > 
> > > do you mean, as in,
> > > 
> > > if !is_integer($var) {
> > > print("$var is not an integer");
> > > }
> > > 
> > 
> > -- 
> > 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]
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 

-- 
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] Re: Developer

2001-08-28 Thread Hugh Bothwell


"Vincent - D. Ertner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi phpers,
>
> I'm looking for a PHP Developer ... what is probably the
> best way to go for it?

General procedure is to give a rough sketch of what you want to accomplish,
what development tools you are using, how long it will take, and a request
for either quotes or resumes (depending on whether it's permanent or not).



-- 
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] is_numeric for php3

2001-08-28 Thread daniel james

Ahhh, in that context, with is_integer(), i think
you're partially right.  however, i looked it up, and
is_numeric() will work fine.

http://www.php.net/manual/en/function.is-numeric.php

btw-- as for the regexps, none for me, thanks ;) 
those things give me the heebie-jeebies.

--- "scott [gts]" <[EMAIL PROTECTED]> wrote:
> i think he's asking for a numeric test, not an
> integer test.
> 
> your example looks like it should fail "3.50" (for
> example),
> even though "3.50" is a perfectly valid numeric
> value.
> 
> personally, i think you should just use regexps. ;-)
> 
> i tried to write a little is_num() type function,
> but i kept
> getting caught on split();  it seems that split()
> converts
> everything to string, no matter what.  so if you try
> to split
> on the decimal point of 45.67 ... you get two
> strings, "45" and "67"
> not 45 and 67, so subsequent is_integer() calls fail
> 
> (since is_integer() checks the *type* of the
> variable,
> not the *value* -- very important to keep in mind)
> 
> here's what i came up with... perhaps it will be of
> some
> help to you (even though it doesnt work)
> 
> 
> function is_num($number) {
> 
>   // $x contains number, $y contains any decimal
> value
>   list ($x, $y) = split("\.", $number);
> 
>   // if there's no decimal value
>   if ( empty($y) ) {
>   return is_int($x);
>   }
>   else {
>   return ( is_int($x) && is_int($y) );
>   }
> 
> }
> 
> 
> > -Original Message-
> > From: daniel james [mailto:[EMAIL PROTECTED]]
> > Subject: Re: [PHP] is_numeric for php3
> > 
> > do you mean, as in,
> > 
> > if !is_integer($var) {
> > print("$var is not an integer");
> > }
> > 
> 
> -- 
> 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]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] Check if a word is in my string.

2001-08-28 Thread scott [gts]

use regexps.  that's what their specialty is ;-)

// case insensitive
if ( preg_match("/$text/i", $string) ) {
print "$text is in $string";
}

// case sensitive
if ( preg_match("/$text/", $string) ) {
print "$text is in $string";
}

> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:11 PM
> To: Brandon Orther; PHP User Group
> Subject: Re: [PHP] Check if a word is in my string.
> 
> 
> if you're just looking for the 1st occurrence of the
> string, it's--
> 
> $check = "good";
> $var = "This is a good...";
> 
> if (!strstr($var, $check)) {
> print("$check not found");
> }
> 
> also, i think strstr() is case-insensitive, so it
> won't be able to differentiate between 'Good' and
> 'good', and will NOT return FALSE if 'Good' precedes
> 'good' in the string...
> 
> -dj
> 
> 
> --- Brandon Orther <[EMAIL PROTECTED]> wrote:
> > Hello,
> >  
> > I have a variable with a string in it.  I want to
> > check if in that
> > string a certain word is in it.  Example
> >  
> > $var = "This is a good sentence";
> >  
> > $check = look("good", $var);
> >  
> >  
> > and $check would equal 1 since "good" is in that
> > string
> >  
> >  
> >  
> >  
> > does anyone know how to do this?
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> 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]




[PHP] Developer

2001-08-28 Thread Vincent - D. Ertner

Hi phpers,

I'm looking for a PHP Developer ... what is probably the
best way to go for it?

Cheers,

Vince

 '''
 ô¿ô
  -


-- 
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] double check query statement??

2001-08-28 Thread Gerard Samuel

  $query = "SELECT mpn_job.ID, job, assigned_to, status_date, category";
  $query .= "FROM mpn_job, mpn_job_category WHERE CID =
mpn_job_category.ID";
  $query .= "AND category = '$category'";
  $result = mysql_query($query);
  $row = mysql_fetch_row($result);
  foreach ($row as $data) {
 echo "$data[0]";
  }

I tried the SELECT statement from mysql command line (less $category, I 
used an actual category name) and it works there.  I try it out in php, 
and I get nothing.  (I echoed $category before this and it works 
correctly)  Do you guys see anything in there that may need correcting? 
  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] Link Checker

2001-08-28 Thread scott [gts]

although it's a bit klunky (and not entirely correct) to do
things this way, but a simple fopen(); will tell you if
the URL is retrievable or not.

(although i dont think that fopen() handles redirects or any
of those esoteric HTTP features)

but if you want to make sure that a link is there, with
no SSL, redirects, or any other stuff, fopen() should
be more than sufficient.

> -Original Message-
> From: Adam Plocher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 6:09 PM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] Link Checker
> 
> 
> Is there any function that will allow me to check to see if a link is valid?
> 

-- 
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] wrapping blobbed fields

2001-08-28 Thread freshNet

I am trying to send data from a textarea into a blob and then when
retrieving the data populating a row in a html table with the text wrapping
as per the wrap in the textarea.

I keep getting the record in one long line of text that goes off the screen
(ie the horizontal scrollbars show).

Any help would be appreciated.

Will.



-- 
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] is_numeric for php3

2001-08-28 Thread scott [gts]

i think he's asking for a numeric test, not an integer test.

your example looks like it should fail "3.50" (for example),
even though "3.50" is a perfectly valid numeric value.

personally, i think you should just use regexps. ;-)

i tried to write a little is_num() type function, but i kept
getting caught on split();  it seems that split() converts
everything to string, no matter what.  so if you try to split
on the decimal point of 45.67 ... you get two strings, "45" and "67"
not 45 and 67, so subsequent is_integer() calls fail 
(since is_integer() checks the *type* of the variable,
not the *value* -- very important to keep in mind)

here's what i came up with... perhaps it will be of some
help to you (even though it doesnt work)


function is_num($number) {

  // $x contains number, $y contains any decimal value
  list ($x, $y) = split("\.", $number);

  // if there's no decimal value
  if ( empty($y) ) {
return is_int($x);
  }
  else {
return ( is_int($x) && is_int($y) );
  }

}


> -Original Message-
> From: daniel james [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] is_numeric for php3
> 
> do you mean, as in,
> 
> if !is_integer($var) {
> print("$var is not an integer");
> }
> 

-- 
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] Re: exec() major probs

2001-08-28 Thread Dell Coleman

Hi
try shell_exec() --- it seems to work better for some things

HTH

Terry Reynolds wrote:

> Hi
>
> I am having major probs trying to exec a command in PHP.
> All i want to do is fill a table from a tab delimited file from within PHP.
> I have set up a file called fillit which consists of:
> mysqlimport -u user -ppassword database list.txt
> This works from the command line perfectly.
> I made this executable & it runs perfectly with .fillit
> It will not run with exec, system or passthru.
> I have tried nearly all possible combinations with and without backticks, single, 
>double and no quotes.
> I have rw access to the dir I am running from and have read the manual until I'm 
>blue in the face!
> Has anyone out there used the xece command successfully??
> Ps if I exec("ls -l"), it works fine !
>
> Linux box Using PHP 4.0.??. latest version MySql, Apache Slackware
> TIA
> Terry

--
Dell Coleman, Principal
PICO Technology Corp.
Victoria, BC
Email [EMAIL PROTECTED]
Web http://members.home.com/pico/



-- 
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] is_numeric for php3

2001-08-28 Thread daniel james

Hi Philip,

By definition, any string that does not contain
alpha-characters is numeric.  I mean, '123' is an
integer, if only because it isn't 'onetwothree', you
know?

Because if I do this:

$num1 = '123';
$num2 = '456';
$total = $num1 + $num2;
print($total);

the total is going to be 579.  You know?

I guess I'm not following you.  Maybe if you give me
the problem in context I can help.

-dj
--- Philip Olson <[EMAIL PROTECTED]> wrote:
> 
> Hi Daniel,
> 
> No, I mean if it's numeric, not neccesarily an
> integer.  As the following
> is numeric and not an integer but rather, a string :
> 
> 
>   $num = '123';
> 
> Anyone have an authoritative answer on this?  Like,
> something that would
> go in the manual as the official php3 is_numeric
> check?
> 
> Regards,
> Philip
> 
> 
> On Tue, 28 Aug 2001, daniel james wrote:
> 
> > do you mean, as in,
> > 
> > if !is_integer($var) {
> > print("$var is not an integer");
> > }
> > 
> > --- Philip Olson <[EMAIL PROTECTED]> wrote:
> > > hi friends,
> > > 
> > > Can someone post here "the" most efficient
> method to
> > > validate a variable
> > > as numeric?  I see a ton of hacks/ways in the
> manual
> > > user comments under
> > > is_int, is_integer and is_numeric and would like
> to
> > > see just one or two
> > > good solid ones.  And please, no regular
> expressions
> > > :)
> > > 
> > > Regards,
> > > Philip
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > 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]
> > > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> > 
> 
> 
> -- 
> 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]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] What does PHP stand for?

2001-08-28 Thread Adam Plocher

>From what I heard, the acronym originally stood for Personal Home Page, but
it kind of changed (unofficially?) to Hypertext Preprocessor.

I could be wrong

-Original Message-
From: Martín Marqués [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 28, 2001 3:08 PM
To: John Meyer; [EMAIL PROTECTED]
Subject: Re: [PHP] What does PHP stand for?


On Mar 28 Ago 2001 19:52, John Meyer wrote:
> At 05:15 PM 8/28/01 +0228, you wrote:
> >It's actually a recursive acronym, like GNU:
> >
> > From the manual:
> >
> >"PHP, which stands for 'PHP: Hypertext Preprocessor', is an 
> >HTML-embedded scripting language."
> >
> >J
>
> Am I making things up, or Did it stand for Perl Hypertext Preprocessor 
> at one time?

I always thought it meant Personal Home Page (isn't this right?)

Saludos :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
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] What does PHP stand for?

2001-08-28 Thread Rob Hardowa

I believe that it was called Personal Home Page during version 2, and if I'm 
not mistaken, there was a contest (sorta) around the time 3 was released to 
find a new name.

On Tuesday 28 August 2001 03:08 pm, you wrote:
> On Mar 28 Ago 2001 19:52, John Meyer wrote:
> > At 05:15 PM 8/28/01 +0228, you wrote:
> > >It's actually a recursive acronym, like GNU:
> > >
> > > From the manual:
> > >
> > >"PHP, which stands for 'PHP: Hypertext Preprocessor', is an
> > > HTML-embedded scripting language."
> > >
> > >J
> >
> > Am I making things up, or Did it stand for Perl Hypertext Preprocessor at
> > one time?
>
> I always thought it meant Personal Home Page (isn't this right?)
>
> Saludos :-)

-- 
Lactomangulation, n.:
Manhandling the "open here" spout on a milk carton so badly
that one has to resort to using the "illegal" side.
-- Rich Hall, "Sniglets"

-- 
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] is_numeric for php3

2001-08-28 Thread Philip Olson


Hi Daniel,

No, I mean if it's numeric, not neccesarily an integer.  As the following
is numeric and not an integer but rather, a string : 

  $num = '123';

Anyone have an authoritative answer on this?  Like, something that would
go in the manual as the official php3 is_numeric check?

Regards,
Philip


On Tue, 28 Aug 2001, daniel james wrote:

> do you mean, as in,
> 
> if !is_integer($var) {
> print("$var is not an integer");
> }
> 
> --- Philip Olson <[EMAIL PROTECTED]> wrote:
> > hi friends,
> > 
> > Can someone post here "the" most efficient method to
> > validate a variable
> > as numeric?  I see a ton of hacks/ways in the manual
> > user comments under
> > is_int, is_integer and is_numeric and would like to
> > see just one or two
> > good solid ones.  And please, no regular expressions
> > :)
> > 
> > Regards,
> > Philip
> > 
> > 
> > 
> > 
> > -- 
> > 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]
> > 
> 
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 


-- 
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] Check if a word is in my string.

2001-08-28 Thread daniel james

if you're just looking for the 1st occurrence of the
string, it's--

$check = "good";
$var = "This is a good...";

if (!strstr($var, $check)) {
print("$check not found");
}

also, i think strstr() is case-insensitive, so it
won't be able to differentiate between 'Good' and
'good', and will NOT return FALSE if 'Good' precedes
'good' in the string...

-dj


--- Brandon Orther <[EMAIL PROTECTED]> wrote:
> Hello,
>  
> I have a variable with a string in it.  I want to
> check if in that
> string a certain word is in it.  Example
>  
> $var = "This is a good sentence";
>  
> $check = look("good", $var);
>  
>  
> and $check would equal 1 since "good" is in that
> string
>  
>  
>  
>  
> does anyone know how to do this?
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] What does PHP stand for?

2001-08-28 Thread Martín Marqués

On Mar 28 Ago 2001 19:52, John Meyer wrote:
> At 05:15 PM 8/28/01 +0228, you wrote:
> >It's actually a recursive acronym, like GNU:
> >
> > From the manual:
> >
> >"PHP, which stands for 'PHP: Hypertext Preprocessor', is an HTML-embedded
> >scripting language."
> >
> >J
>
> Am I making things up, or Did it stand for Perl Hypertext Preprocessor at
> one time?

I always thought it meant Personal Home Page (isn't this right?)

Saludos :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
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] two dimensional array or two arrays?

2001-08-28 Thread Philip Olson


Your $categoryarry is a 2d array, try :

  print_r($categoryarry);

But, I think you want to do :

  $categories = array('Sasheen','Tom','Fred');

Now, if you do this :

  while(list($key,$value) = each($categories)) {
  
print "$key : $value\n";
  }

You'll get :

  0 : Sasheen
  1 : Tom
  2 : Fred

Could also define your array like so :

  $categories = array('a' => 'foo', 'b' => 'bar');

Which, if run through our loop above, will give us :

  a : foo
  b : bar

See?  Play with it a bit, it'll start to make more and more sense.

Regards,
Philip


On Tue, 28 Aug 2001, Tom Beidler wrote:

> I have some code I use to create pulldown menus. It's as follows;
> 
> $categoryarry = array("","1","2","3","4","5");
> while (list($key,$value) = each($categoryarry)) {
>   if ($value == $srch_cat) {
> $cat_option .= "$value\n";
>   } else {
> $cat_option .= "$value\n";
>   }
> }
> 
> It works fine when the pulldown value and displayed text are the same, ie.
> 
> John
> 
> But now I would like to change so the value is different then what's
> displayed in the menu, ie.
> 
> John
> 
> I've never used two dimensional arrays but I thought it might be what I need
> to look into. Or should I have to arrays and use one for the value and the
> other for the item displayed in the pulldown menu.
> 
> Any help appreciated.
> 
> Thanks,
> Tom
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 



-- 
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] Check if a word is in my string.

2001-08-28 Thread Philip Olson

see :

  http://www.php.net/strstr
  http://www.php.net/stristr

Regards,
Philip


On Tue, 28 Aug 2001, Brandon Orther wrote:

> Hello,
>  
> I have a variable with a string in it.  I want to check if in that
> string a certain word is in it.  Example
>  
> $var = "This is a good sentence";
>  
> $check = look("good", $var);
>  
>  
> and $check would equal 1 since "good" is in that string
>  
>  
>  
>  
> does anyone know how to do this?
> 


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

2001-08-28 Thread Adam Plocher

Is there any function that will allow me to check to see if a link is valid?



RE: [PHP] Last Modified question..

2001-08-28 Thread scott [gts]

did you try stat()'ing the file?

as long as you have read permission to the file,
you should be able to run a stat() on the file
with no problems

> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Last Modified question..
> 
> I have a problem... I want to check the last modified time that a file was
> changed/updated.  Actually, it's an employee database that I'm working on
> and I thought about just checking the last modified date on the file that
> the information was stored on.  However, I get a permission denied error and
> I don't want to change the permissions of the file.  Is there an easy way to
> check to see when the last time anyone logged in and updated their
> 'employee' information?
> 
> Thanks,
> jay


-- 
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] is_numeric for php3

2001-08-28 Thread daniel james

do you mean, as in,

if !is_integer($var) {
print("$var is not an integer");
}

--- Philip Olson <[EMAIL PROTECTED]> wrote:
> hi friends,
> 
> Can someone post here "the" most efficient method to
> validate a variable
> as numeric?  I see a ton of hacks/ways in the manual
> user comments under
> is_int, is_integer and is_numeric and would like to
> see just one or two
> good solid ones.  And please, no regular expressions
> :)
> 
> Regards,
> Philip
> 
> 
> 
> 
> -- 
> 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]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] Check if a word is in my string.

2001-08-28 Thread Brandon Orther

Hello,
 
I have a variable with a string in it.  I want to check if in that
string a certain word is in it.  Example
 
$var = "This is a good sentence";
 
$check = look("good", $var);
 
 
and $check would equal 1 since "good" is in that string
 
 
 
 
does anyone know how to do this?



[PHP] Re: Last Modified question..

2001-08-28 Thread Julio Nobrega Trabalhando

  Well, you could change just to look at this.

  Use php's functions to change, check the last modified, and change it
back. Should take a few micro-seconds  ;-) and it only uses php.

--

Julio Nobrega

A hora está chegando:
http://toca.sourceforge.net
"Jay Paulson" <[EMAIL PROTECTED]> wrote in message
008001c13008$5c766860$3c00a8c0@webdesign">news:008001c13008$5c766860$3c00a8c0@webdesign...
> I have a problem... I want to check the last modified time that a file was
> changed/updated.  Actually, it's an employee database that I'm working on
> and I thought about just checking the last modified date on the file that
> the information was stored on.  However, I get a permission denied error
and
> I don't want to change the permissions of the file.  Is there an easy way
to
> check to see when the last time anyone logged in and updated their
> 'employee' information?
>
> Thanks,
> jay
>



-- 
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] What does PHP stand for?

2001-08-28 Thread John Meyer

At 05:15 PM 8/28/01 +0228, you wrote:
>It's actually a recursive acronym, like GNU:
>
> From the manual:
>
>"PHP, which stands for 'PHP: Hypertext Preprocessor', is an HTML-embedded
>scripting language."
>
>J


Am I making things up, or Did it stand for Perl Hypertext Preprocessor at 
one time?


-- 
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] is_numeric for php3

2001-08-28 Thread Philip Olson

hi friends,

Can someone post here "the" most efficient method to validate a variable
as numeric?  I see a ton of hacks/ways in the manual user comments under
is_int, is_integer and is_numeric and would like to see just one or two
good solid ones.  And please, no regular expressions :)

Regards,
Philip




-- 
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] PHP cURL problem

2001-08-28 Thread SDowell

I am using PHP 4.0.6 and when I run the following code I get nothing back
except the error code 27 and a message saying 
SSL: couldn't create a context
I can run the same thing from the command line and it works perfectly
does anyone have any ideas on this?
Thanks in advance for any help,
Steve Dowell
 
$q_auth = $login.":".$pw;
$fp = fopen("c:Scan_files/test_10.xml","w");
$ch = curl_init("https://www.foo.com/msp/some_report_list.php";);
curl_setopt($ch, CURLOPT_USERPWD,$q_auth); 
curl_setopt($ch, CURLOPT_FAILONERROR, 0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
curl_setopt($ch, CURLOPT_FILE,$fp); 
curl_setopt($ch, CURLOPT_NOPROGRESS,0);
curl_setopt($ch, CURLOPT_VERBOSE,1);  
$result=curl_exec ($ch); 
echo curl_errno($ch)."";
echo curl_error($ch);
curl_close ($ch); 
echo "result=".$result; 
$fp = fclose;

-- 
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] Last Modified question..

2001-08-28 Thread Jay Paulson

I have a problem... I want to check the last modified time that a file was
changed/updated.  Actually, it's an employee database that I'm working on
and I thought about just checking the last modified date on the file that
the information was stored on.  However, I get a permission denied error and
I don't want to change the permissions of the file.  Is there an easy way to
check to see when the last time anyone logged in and updated their
'employee' information?

Thanks,
jay


-- 
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] Data duplication in databases

2001-08-28 Thread Julian Wood


Hi,

Don't know if this is the best place to ask, but I thought I would give 
it a try.

I was just wondering if anyone knows of any databases which deal with 
data duplication (at a low level). Say I have two (or ten) identical 
records, does anyone know of any databases which would only keep one 
copy of the data and use references for the other records? Does this 
work if 7 out of the 8 columns (for instance) are identical (ie the 
primary key is different but everything else is identical). Do such db's 
exist? Or do they all do this? Or am I just dreaming?

J
--
Julian Wood

Programmer/Analyst
University of Calgary

-- 
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] What does PHP stand for?

2001-08-28 Thread J Smith

It's actually a recursive acronym, like GNU:

>From the manual:

"PHP, which stands for 'PHP: Hypertext Preprocessor', is an HTML-embedded 
scripting language."

J

Jon wrote:

> Hmm although the answer was "Personal Home Page Tools" and is now
> "Hypertext Preprocessor" when people ask me, I say "Pre-Hypertext
> Processor"
> 
> Its the same meaning, and puts the letters in the correct order, so as not
> to confuse people.


-- 
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] fix my query please

2001-08-28 Thread Sam Masiello


It has outer joins:

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#JOI
N

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
[EMAIL PROTECTED]

 -Original Message-
From:   Martín Marqués [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, August 28, 2001 4:35 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:Re: [PHP] fix my query please

On Mar 28 Ago 2001 17:29, Jeremy Morano wrote:
> an somebody please fix up my query.
>
>
>
>
> $connection = @mysql_connect("l", "c", "c") or die("Couldn't connect.");
>
> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
> database.");
>
>
>
> $sql = "SELECT distinct users.uid , users.username
>   FROM users LEFT OUTER JOIN picks using(id)

Am I an ignorant, or MySQL doesn't have OUTER JOINs

>   Where  users.uid <> picks.user_id
>   ";
[snip]

Saludos... :-)

--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

--
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: The future of PHP - accessory libraries

2001-08-28 Thread Heiko Maiwald

Rasmus Lerdorf wrote:

> > That's not allowing me to simply dl() an SO file, because I don't have the
> > SO file to start with - that's what I was trying to get at.  If I have
> > to reconfigure
> > everything, there's not much point, I don't think.  Unless I'm missing
> > something
> > obvious.  I'd like to be able to simply have an SO file I can dl()
> > without recompiling.
> > Or are you saying that that configure statement WILL create an SO file
> > that can
> > be dl()ed later, without recompiling PHP?
>
> Exactly.  When you do ./configure --with-foo=shared; make
> then modules/foo.so will appear magically and you can dl() that or load it
> using "extension=foo.so" in your php.ini.  You don't have to recompile
> PHP.
>
> -Rasmus

I am afraid that is only theory. I tried that for the snmp module and all I get

is a linker error about unreferenced symbols, when I try to load it.

Heiko


-- 
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] fix my query please

2001-08-28 Thread Martín Marqués

On Mar 28 Ago 2001 17:29, Jeremy Morano wrote:
> an somebody please fix up my query.
>
>
>
>
> $connection = @mysql_connect("l", "c", "c") or die("Couldn't connect.");
>
> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
> database.");
>
>
>
> $sql = "SELECT distinct users.uid , users.username
>   FROM users LEFT OUTER JOIN picks using(id)

Am I an ignorant, or MySQL doesn't have OUTER JOINs

>   Where  users.uid <> picks.user_id
>   ";
[snip]

Saludos... :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
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] ODBC32.DLL

2001-08-28 Thread Daniel Janzen

Prezados,

Estou recebendo mensagem de erro ODBC32.DLL

O que está errado ?

Obrigado...



[PHP] fix my query please

2001-08-28 Thread Jeremy Morano

an somebody please fix up my query.




$connection = @mysql_connect("l", "c", "c") or die("Couldn't connect.");

$db = @mysql_select_db($db_name, $connection) or die("Couldn't select
database.");



$sql = "SELECT distinct users.uid , users.username
FROM users LEFT OUTER JOIN picks using(id)
Where  users.uid <> picks.user_id
";



$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");


while ($row = mysql_fetch_array($result)) {
$usersleft = $row['username'];
$uid = $row['uid'];

$my_string="$usersleft";

echo $my_string;
}


-- 
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 MySQL auth?

2001-08-28 Thread B. van Ouwerkerk


>Case 2. Without any form of auth, I read the text file and do
>mysql_connect($the_db_host,$the_db_username,$the_db_pass);
> mysql_select_db($the_db_name);
> mysql_query("select * from table");
>
>and the server response is:
>Error 2002: Can't connect to local MySQL server through socket
>'/var/lib/mysql/mysql.sock; (111)

This really is a faq.

Mysql.sock normally lives in /tmp think RH puts it in /var/lib PHP can't 
find it. Might be php.ini looks in /var/lib change it there to match the 
location of you mysql.sock .. also .. check if mysql is running (ps ax | 
grep mysql). If it isn't you can't connect to it.

Bye,



B.


-- 
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] LONGINT... ? to be or not to be?...

2001-08-28 Thread Sheridan Saint-Michel

A couple of points here...  First, 0 is obviously wrong for
3221225472 & 1073741824
But I don't know how you got 2147483648 either.
I get 1073741824 as 
3221225472 = 1100
1073741824 = 0100

1100 & 
0100 =
0100

right?

Anyways, to your question  =P

First, if you check here: 
http://www.php.net/manual/en/language.types.integer.php

you will see that int's in PHP are always signed and that if
they exceed the max size for an int they are converted to a 
float.

Try running this on your server

";
echo "y = ";
var_dump($y);
?>

I would be willing to bet that $x is a float and $y is an int, so
the bitwise operator can't compare them.  The only 
workaround I can offer you is this



It's a bit kludgy but it forces both $x and $y to be compared
as binary numbers, which is what you want  =)

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


- Original Message - 
From: "Alexey Prohorenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 1:47 PM
Subject: [PHP] LONGINT... ? to be or not to be?...


> Hello,
> 
> I have one question. How can PHP work with longint (in C we call
> them "unsigned long") variables?
> F.e., I want to do next thing:
> 
> 65536 & 4096 = 0 (this is right)
> 65536 & 65536 = 65536 (again, everything is okay)
> 196608 & 65536 = 65536 (perfect, it works great)
> 
> but,
> 
> 3221225472 & 1073741824 = 0 (this is wrong, right answer isn't 0
>  but 2147483648)
> 
> So, can anybody help me with this? Any suggestions? 
> 
> Thanks, anyway. Looking forward your answers.
> Will check my mailbox every 5 minutes. :-)
> 
> -- 
> green
> [http://www.extrasy.net] 
> [http://www.unix-how-to.net]
> 
> -- 
> 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] two dimensional array or two arrays?

2001-08-28 Thread Anton Stroganov

this should do it for you.

$categoryarry = array(array("","none"),array("1","John"),array("2","Jim"));
foreach($categoryarray as $value) {
  if($value[0] == $srch_cat) {
$cat_option .= "$value[1]\n";
  } else {
$cat_option .= "$value[1]\n";
  }
}

- Original Message -
From: Tom Beidler <[EMAIL PROTECTED]>
To: php list <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 12:23
Subject: [PHP] two dimensional array or two arrays?


> I have some code I use to create pulldown menus. It's as follows;
>
> $categoryarry = array("","1","2","3","4","5");
> while (list($key,$value) = each($categoryarry)) {
>   if ($value == $srch_cat) {
> $cat_option .= "$value\n";
>   } else {
> $cat_option .= "$value\n";
>   }
> }
>
> It works fine when the pulldown value and displayed text are the same, ie.
>
> John
>
> But now I would like to change so the value is different then what's
> displayed in the menu, ie.
>
> John
>
> I've never used two dimensional arrays but I thought it might be what I
need
> to look into. Or should I have to arrays and use one for the value and the
> other for the item displayed in the pulldown menu.
>
> Any help appreciated.
>
> Thanks,
> Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
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] two dimensional array or two arrays?

2001-08-28 Thread Tom Beidler

I have some code I use to create pulldown menus. It's as follows;

$categoryarry = array("","1","2","3","4","5");
while (list($key,$value) = each($categoryarry)) {
  if ($value == $srch_cat) {
$cat_option .= "$value\n";
  } else {
$cat_option .= "$value\n";
  }
}

It works fine when the pulldown value and displayed text are the same, ie.

John

But now I would like to change so the value is different then what's
displayed in the menu, ie.

John

I've never used two dimensional arrays but I thought it might be what I need
to look into. Or should I have to arrays and use one for the value and the
other for the item displayed in the pulldown menu.

Any help appreciated.

Thanks,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] htaccess and $PHP_AUTH_USER

2001-08-28 Thread Rene Fournier

Please, someone, help me...

What I want to do:  Have a user prompted for an ID/password, both of which
(if valid), get passed to a PHP script, which then uses the ID/password to
selectively display certain fields of a table.  (For example, if the user
logs in as "Sales", he would only see the sales-related fields of the
tables.  Whereas, if the user logs in as "Production", she would see the
production-related fields.  Pretty simple.)

I've read the PHP docs on $PHP_AUTH_USER.  One stupid question:  Must I use
the htaccess directory-protection feature of Apache in order for this to
work (or is$PHP_AUTH_USER not dependent on Apache (or any web server) at
all)?  I mean, from reading the docs, it seems as if the value stored in
$PHP_AUTH_USER comes what the user types into the Apache-spawned dialog box
(when the user types the URL containing that password-protected
directory.)??  The thing is, when I turn password protection on for the
directory in question, and add the users and passwords to the htaccess file,
then go to the URL in the browser, I get prompted several times for a user
and password--first, it seems, by Apache, then by the PHP code I copied from
the docs.

If anyone can help, I'd greatly appreciate it.  Best would be some real code
running in a similar server environment.  (The site in question is running
on www.fatcow.com servers--they're running PHP3 (shouldn't matter, right)
and Apache.)

MUCH thanks in advance...

...Rene

---
Rene Fournier,
[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] instalando o php

2001-08-28 Thread Nuno Silva


Viva,

no ficheiro INSTALL da distribuição do php tens instruções 
passo-a-passo. Basta segui-las, mas para quem não tem prática pode 
parecer estranho. Aconselho a ler o ficheiro várias vezes ;)

http://php.net/manual/pt_BR/installation.php

é outra hipotese.. nem tudo está em português.

Boa sorte,
Nuno Silva


Daniel Janzen wrote:
> Instalei o servidor apache e agora estou configurando o php alguém sabe de algum 
>lugar que tenha a instalação passo-a-passo?
> 
> Obrigado...
> 
> 



--
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] PHP and MySQL auth?

2001-08-28 Thread Alex Sofronie

Hello, all.
What is the difference between:
Case 1: I auth with header('WWW-Auth...') and validate the user from a
plain file. Next, i do something like
mysql_connect($the_db_host,$the_db_username,$the_db_pass);
mysql_select_db($the_db_name);
mysql_query("select * from table");
- and it works fine.

Case 2. Without any form of auth, I read the text file and do
   mysql_connect($the_db_host,$the_db_username,$the_db_pass);
mysql_select_db($the_db_name);
mysql_query("select * from table");

and the server response is:
Error 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock; (111)

What does this auth do with the rights on mysql?
Thanks.

Alex Sofronie
[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]




[PHP] mkdir failed

2001-08-28 Thread Christian Darsow

hi everybody!

i have an account at strato (german provider) who
hosts my php-scripts.
now i want to make a dir with mkdir("../tmp/$id", 0777)
it doesn't work at all eventhough the rights of tmp are set
to 777.
the script also doesn't alert anything, not a failed or anything..

does anybody know where the problem may be

thank you so much.

christian



-- 
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] instalando o php

2001-08-28 Thread Daniel Janzen

Instalei o servidor apache e agora estou configurando o php alguém sabe de algum lugar 
que tenha a instalação passo-a-passo?

Obrigado...



[PHP] exec() major probs

2001-08-28 Thread Terry Reynolds

Hi

I am having major probs trying to exec a command in PHP.
All i want to do is fill a table from a tab delimited file from within PHP.
I have set up a file called fillit which consists of:
mysqlimport -u user -ppassword database list.txt
This works from the command line perfectly.
I made this executable & it runs perfectly with .fillit
It will not run with exec, system or passthru.
I have tried nearly all possible combinations with and without backticks, single, 
double and no quotes.
I have rw access to the dir I am running from and have read the manual until I'm blue 
in the face!
Has anyone out there used the xece command successfully??
Ps if I exec("ls -l"), it works fine !

Linux box Using PHP 4.0.??. latest version MySql, Apache Slackware
TIA
Terry



[PHP] LONGINT... ? to be or not to be?...

2001-08-28 Thread Alexey Prohorenko

Hello,

I have one question. How can PHP work with longint (in C we call
them "unsigned long") variables?
F.e., I want to do next thing:

65536 & 4096 = 0 (this is right)
65536 & 65536 = 65536 (again, everything is okay)
196608 & 65536 = 65536 (perfect, it works great)

but,

3221225472 & 1073741824 = 0 (this is wrong, right answer isn't 0
 but 2147483648)

So, can anybody help me with this? Any suggestions? 

Thanks, anyway. Looking forward your answers.
Will check my mailbox every 5 minutes. :-)

-- 
green
[http://www.extrasy.net] 
[http://www.unix-how-to.net]

-- 
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] POST problem (thanks)

2001-08-28 Thread Mashrab Kuvatov

--- Steve Edberg <[EMAIL PROTECTED]> wrote:
> My guess is that your register_globals config option
> is off:

Your are quite right it is off. Right at the bebinning
of php.ini it says so. Blame on me i missed it.

> You should be able to access the values you want via
> 
>  $HTTP_POST_VARS['name']
> and
>  $HTTP_POST_VARS['age']

And this also works.

Thanks Steve.

Regards,
Mashrab.


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] Pulling webpages - may be a weird question :)

2001-08-28 Thread daniel james

try readfile('http://www.somesite.com/');

it creates a mirror; it might bypass the firewall,
depending on how the blocking software is keyed to
activate.

-dj
--- Jeff Lewis <[EMAIL PROTECTED]> wrote:
> I was sitting here at work (working of course!)
> thinking about how some sites are blocked etc from
> viewing...  Is it possible with PHP to do something
> like this:
> 
> Have a page where I can create kind of a middle man.
>  I mean the PHP can be hosted on my server, it goes
> to the site I'd want to view (lets say www.php.net).
>  It then relays it to my browser but as if it is
> coming from my server.  So can it grab the pages,
> temp write them and server them over to me?
> 
> I know it seems kind of strange but I am curious
> about it
> 
> Jeff
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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: The future of PHP - accessory libraries

2001-08-28 Thread Christopher CM Allen

> Exactly.  When you do ./configure --with-foo=shared; make
> then modules/foo.so will appear magically and you can dl() that or load it
> using "extension=foo.so" in your php.ini.  You don't have to recompile

This is very good news! I must have mis-rad the manual on this part!! Is
there any way to make these extensions with out making it all?
Such as a "make extensions  ---extension=foo.so" , Is there any plan for
this?

Thanks,

CCMA


-- 
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] Pulling webpages - may be a weird question :)

2001-08-28 Thread Jeff Lewis

I was sitting here at work (working of course!) thinking about how some sites are 
blocked etc from viewing...  Is it possible with PHP to do something like this:

Have a page where I can create kind of a middle man.  I mean the PHP can be hosted on 
my server, it goes to the site I'd want to view (lets say www.php.net).  It then 
relays it to my browser but as if it is coming from my server.  So can it grab the 
pages, temp write them and server them over to me?

I know it seems kind of strange but I am curious about it

Jeff



Re: [PHP] POST problem

2001-08-28 Thread Steve Edberg

My guess is that your register_globals config option is off:

http://php.he.net/manual/en/configuration.php#ini.register-globals

(I believe that recent versions of PHP have it off by default). You 
should be able to access the values you want via

$HTTP_POST_VARS['name']
and
$HTTP_POST_VARS['age']

-steve



At 10:39 AM -0700 8/28/01, Mashrab Kuvatov wrote:
>Hi everybody,
>i'm a newie in php, but i have a general understanding
>of it.
>
>Recently, i've installed PHP as a static module on my
>Apache-1.3.19 and tried an example i read in PHP
>tutorial.
>
>Assume you have a page with a form like this on it:
>
>
>Your name: 
>You age: 
>
>
>
>and action.php like this
>
>Hi .
>You are  years old.
>
>This action.php is supposed to print out values one
>enters to the form fields. Right?
>
>So, my problem is that it doesn't. Instead, it prints
>Hi.You are years old.
>
>Can anyone help me to figure it out or to point me to
>the right direction so in future i won't annoy you
>with my silly questions.
>
>Thanks in advance,
>Mashrab.
>

-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

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

2001-08-28 Thread B. van Ouwerkerk


>Hi .
>You are  years old.
>
>This action.php is supposed to print out values one
>enters to the form fields. Right?
>
>So, my problem is that it doesn't. Instead, it prints
>Hi.You are years old.

Try:



Have fun,



B.


-- 
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] Sessions and Cookies on Macs

2001-08-28 Thread Richard Baskett

I just used the url to pass it since no matter what I did I couldn¹t seem to
get it to work when cookies were turned off on my mac.  I've read the
session url on the php site from top to bottom and the transparent sessions
are even enabled on the server, but yet to no avail on the mac :(

> on 8/27/01 10:31 AM, Richard Baskett at [EMAIL PROTECTED] wrote:
> 
>> Ok on a pc when I have cookies turned off I am still able to access my
>> session variables, but on a mac I can not.  Is there a difference between
>> the way session variables are stored on each platform?  And if a session is
>> indeed a cookie, then why does the session still work on pc's with cookies
>> disabled?
>> 
>> Rick
>> 
> 
> check out http://www.php.net/manual/en/ref.session.php as a place to start.
> if cookies are turned off, the session is maintained in the url.
> 
> have you figured out your mac session problem? i use a mac to develop my
> sites, and many of them use sessions without a problem. when i turn off
> cookies in the browser (usually the latest version of ie) php handles it
> smoothly.
> 
> let me know if you have any questions,
> mike
> 
> 
> -- mike cullerton


--
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: The future of PHP - accessory libraries

2001-08-28 Thread Rasmus Lerdorf

> That's not allowing me to simply dl() an SO file, because I don't have the
> SO file to start with - that's what I was trying to get at.  If I have
> to reconfigure
> everything, there's not much point, I don't think.  Unless I'm missing
> something
> obvious.  I'd like to be able to simply have an SO file I can dl()
> without recompiling.
> Or are you saying that that configure statement WILL create an SO file
> that can
> be dl()ed later, without recompiling PHP?

Exactly.  When you do ./configure --with-foo=shared; make
then modules/foo.so will appear magically and you can dl() that or load it
using "extension=foo.so" in your php.ini.  You don't have to recompile
PHP.

-Rasmus


-- 
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] Putting variables in a string

2001-08-28 Thread P.Agenbag

I am trying to make a string that will contain variables.

The resulting string will be a sql query string and must look something
like

" update $table_name set  key='$key' , next='$next' where id = $id"

Since the variable name is the same as the key name, I tried to generate
this string with a foreach statement looking something like this:

foreach( $myrow as $key=>$val) {
$sql .= "$key = ' \$$key ' ,";
}

This then makes the string look as follow:

key='$key',next='$next', and I just add the rest of the string to the
front and back, yet, when I now try to use this string in the
mysql_query() function, it does not recognise the '$key' and '$next' as
variables and add them into the db as $key and $next. I need to know how
I am going to make this string "recognise" the variables in them.



-- 
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] Sessions and Cookies on Macs

2001-08-28 Thread mike cullerton

on 8/27/01 10:31 AM, Richard Baskett at [EMAIL PROTECTED] wrote:

> Ok on a pc when I have cookies turned off I am still able to access my
> session variables, but on a mac I can not.  Is there a difference between
> the way session variables are stored on each platform?  And if a session is
> indeed a cookie, then why does the session still work on pc's with cookies
> disabled?
> 
> Rick
> 

check out http://www.php.net/manual/en/ref.session.php as a place to start.
if cookies are turned off, the session is maintained in the url.

have you figured out your mac session problem? i use a mac to develop my
sites, and many of them use sessions without a problem. when i turn off
cookies in the browser (usually the latest version of ie) php handles it
smoothly.

let me know if you have any questions,
mike


-- mike cullerton



-- 
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] str_replace() function help

2001-08-28 Thread Navid Yar

But that's not the problem. I know str_replace can handle what you just
wrote. My problem is replacing TWO  tags at the same time. Take a look
at my script and you'll know what I mean. Can anyone help me with this?

-Original Message-
From: J Friesen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 11:07 AM
To: Navid Yar
Cc: Php-General@Lists. Php. Net
Subject: RE: [PHP] str_replace() function help


This is the code I use for articles that are taken out of a database and the
\n need to be changed to paragraphs

$art = htmlspecialchars($art);
$art = nl2br($art);
$art = str_replace("", "", $art);
echo "" . $art . "";

-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 4:08 AM
To: Php-General
Subject: [PHP] str_replace() function help


Hello,

I am creating an online text editor for a magazine site and I want to be
able to apply some CSS formatting into it. The following is the script that
adds the  tags where necessary, then it strips the  tags by
replacing them with some  tags with CSS formatting. The problem I'm
having is that it will not pick up on those  tags (2 at a time). I
think it has something to do with the newline (\n) and return (\r) escape
characters not capturing the  tags. Maybe I didn't set it up
correctly. Below the code is the input (exactly as typed in the online text
editor), the undesired output I'm getting when I run the article through the
script, and the desired output that I want.

Please Note that I am trying to comply with the XHTML standards and will be
converting these into XHTML, therefore all tags must be closed ( example:
 ), and all empty tags must be closed in this way:  ( example:
 ). Also note that I am trying to stay away from other pattern
matching and replacing functions. The reason is that str_replace() seems
much faster than the rest. If it is possible, I would like to stick with
str_replace(). But if this turns out to be too complex for str_replace to
handle, then I will consider other options. I am on a Win2000 platform
running PHP 4.0.6 (which may or may not be relevant). Thanks in advance this
anyone who helps me out with this, I would really appreciate it.


THE SCRIPT
__


str_replace


\n" . $article . "\n\n";
   $article = str_replace("\r\n","\n\n",$article);
   echo "$article";
} else {
echo "Please include an article before sending.";
}

?>






INPUT
___

There are numerous definitions for the word hero. I would like to define
heroes as individuals who inspire us to emulate their level of perseverance
and success. Simply put, heroes are people we look up to.

Life is full of celebrated heroes: sports figures, individuals from all
walks of the entertainment industry, famous and infamous politicians, and
distinguished individuals from the business and science arenas, just to name
a few. But for every celebrated hero, there is at least one unsung hero.
This "Spotlight" segment is dedicated to the unsung heroes of our time.

Recently, I have been corresponding via email with three very dedicated and
talented students from the University of Toronto whom I consider real life
heroes. Once you read about their accomplishments as well as their trials
and tribulations in life and the positive example they intend to set for the
Afghan youths everywhere, I am sure you will agree with my assessment.



THE UNDESIRED OUTPUT
__


str_replace



There are numerous definitions for the word hero. I would like to define
heroes as individuals who inspire us to emulate their level of perseverance
and success. Simply put, heroes are people we look up to.



Life is full of celebrated heroes: sports figures, individuals from all
walks of the entertainment industry, famous and infamous politicians, and
distinguished individuals from the business and science arenas, just to name
a few. But for every celebrated hero, there is at least one unsung hero.
This "Spotlight" segment is dedicated to the unsung heroes of our
time.



Recently, I have been corresponding via email with three very dedicated and
talented students from the University of Toronto whom I consider real life
heroes. Once you read about their accomplishments as well as their trials
and tribulations in life and the positive example they intend to set for the
Afghan youths everywhere, I am sure you will agree with my assessment.






DESIRED OUTPUT
__


str_replace



There are numerous definitions for the word hero. I would like to define
heroes as individuals who inspire us to emulate their level of perseverance
and success. Simply put, heroes are people we look up to.



Life is full of celebrated heroes: sports figures, individuals from all
walks of the entertainment industry, famous and infamous politicians, and
distinguished individuals from the business and science arenas, just to name
a few. But for every celebrated hero, there is at least one unsung hero.
This "Spotlight" segment is ded

Re: [PHP] Best Way?

2001-08-28 Thread Mark Maggelet

On Tue, 28 Aug 2001 11:35:33 -0400, Michael Kimsal
([EMAIL PROTECTED]) wrote:
>So require them to have cookies turned on.  If it's YOUR system, you
>can require whatever you want.  If this is something for your
>company,
>presumably
>it's a business tool of some sort, and you can then require them to
>do
>whatever
>you need to go get the job done.

Yeah, you can't do much with cookies turned off these days anyway.
Another way to do it is to use $PHP_AUTH_USER, it's easier (but not
as pretty) and you won't have to worry about cookies.


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

2001-08-28 Thread Mashrab Kuvatov

Hi everybody,
i'm a newie in php, but i have a general understanding
of it.

Recently, i've installed PHP as a static module on my
Apache-1.3.19 and tried an example i read in PHP
tutorial.

Assume you have a page with a form like this on it:


Your name: 
You age: 



and action.php like this

Hi .
You are  years old.

This action.php is supposed to print out values one
enters to the form fields. Right?

So, my problem is that it doesn't. Instead, it prints
Hi.You are years old.

Can anyone help me to figure it out or to point me to
the right direction so in future i won't annoy you
with my silly questions.

Thanks in advance,
Mashrab.

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
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] unset() in a class

2001-08-28 Thread daniel james

If that's the code you're running, it's got several
problems--

1st, the function is mysql_query()
2nd, the query is built like this:

$connection = mysql_connect('host', 'user', 'pass');
$db = mysql_select_db('db', $connection);
$query = "SELECT * FROM tablename WHERE primary_key =
'$primary_key'";
$result = mysql_query($query, $connection) or
die("file not found");

--- Glyndower <[EMAIL PROTECTED]> wrote:
> I need to return a "file not found" if the search
> item is not found..
> 
> tryed my_sql_query(select from table where primary
> key = $primary key)or die
> "file not found"
> 
> that didn't work
> 
> suggestions anybody? please? purty please?
> 
> 
> -- 
> 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]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




  1   2   3   >