[PHP] [NEW] XML-PHP Forums

2003-06-30 Thread sterling
New forum, dedicated to XML/PHP, from the PHP/XML based site xmlmania.com
(main site currently in development).

Completely new, join NOW!

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

Re: [PHP] insert into

2001-04-24 Thread Sterling

H-

Here ya go. 

http://www.php.net/manual/en/function.pg-connect.php
This page and the links on the left hand column have everything you'll
ever want to know about db connects and sql queries. 8^) 

-Sterling


shawn wrote:
> 
> Could someone tell me how to actually execute this script please?
> 
> $hostname = "";
> $username = "";
> $password = "";
> $dbName = "";
> $userstable = "booking";
> 
> MYSQL_CONNECT($hostname, $username, $password)
>  or die("Unable to connect to database");
> 
> @mysql_select_db( "$dbName")
>  or die( "Unable to select database");
> 
> $mysql_query INSERT INTO $userstable (client, contact, email, address, city, state, 
>zip, phone, fax, model, country, details, type)
> VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
>'$phone', '$fax', '$model', '$country', '$details', '$type');
> 
> MYSQL_CLOSE();
> 
> ?>
> 
> Thanks, also if you know any tutorials for PHP and MySQL
> 
> Shawn

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

2001-04-24 Thread Sterling

H-

You are right. My bust. 
Sorry for the errant info. 

Although I still highly recommend the site. 8^) 
-Sterling


Philip Olson wrote:
> 
> Sterling, it appears Shawn is using MySQL, not PostgreSQL.  That said,
> Shawn, have a look here :
> 
>   http://www.php.net/manual/en/ref.mysql.php
> 
> You'll see a list of MySQL functions, which are in your snippet below.
> PHP functions such as :
> 
>   mysql_connect, mysql_select_db, mysql_query, mysql_fetch_array ...
> 
> Attend each manual page for further information on each function and note
> the examples.  This tutorial may help :
> 
>   http://php.vamsi.net/mysql/
>   http://www.sqlcourse.com/
> 
> Look around www.zend.com, php.faqts.com, www.phpbuilder.com and
> www.devshed.com for a few more goodies, as well as many many other sites!
> Also note that when you view tutorials, they are not the only way.  Also
> note the difference between SQL and PHP.
> 
> Regards,
> Philip
> 
> On Tue, 24 Apr 2001, Sterling wrote:
> 
> > H-
> >
> > Here ya go.
> >
> > http://www.php.net/manual/en/function.pg-connect.php
> > This page and the links on the left hand column have everything you'll
> > ever want to know about db connects and sql queries. 8^)
> >
> > -Sterling
> >
> >
> > shawn wrote:
> > >
> > > Could someone tell me how to actually execute this script please?
> > >
> > > $hostname = "";
> > > $username = "";
> > > $password = "";
> > > $dbName = "";
> > > $userstable = "booking";
> > >
> > > MYSQL_CONNECT($hostname, $username, $password)
> > >  or die("Unable to connect to database");
> > >
> > > @mysql_select_db( "$dbName")
> > >  or die( "Unable to select database");
> > >
> > > $mysql_query INSERT INTO $userstable (client, contact, email, address, city, 
>state, zip, phone, fax, model, country, details, type)
> > > VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
>'$phone', '$fax', '$model', '$country', '$details', '$type');
> > >
> > > MYSQL_CLOSE();
> > >
> > > ?>
> > >
> > > Thanks, also if you know any tutorials for PHP and MySQL
> > >
> > > Shawn
> >
> > --
> > 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]




[PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Sterling

H-

I've been able to escape the 'space' character in a variable so it can
be safely passed through a URL but I'm having trouble finding anything
that works for escaping the '&' ampsand. 

Here is a snippet of code. 

$topic = "Aerospace & Commercial Space";

$link_value = str_replace("&", '%26', $topic);
$link_value = str_replace(' ', '%20', $topic);


Here's the strange part. 
If the "ampersand replace" is in front of the "space replace" the "space
replace" gets done but the ampersand doesn't. 

If the "ampersand replace" is done after the "space replace" the
ampersand get's replaced but the spaces do not. 

So for the code above the %20 was replaced but the & remained &.

I split the lines up for simplicity. Is that's what's causing the
problems? 
What am I missing here? 
Very confusing. 
Thanks for any info any one might have on this. 

Thoughts, Comments, Anecdotes? 
-Sterling

-- 
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] checking if e-mail address and syntax are valid

2001-04-24 Thread Sterling

H-

If you're wanting to do it *before* the user sends the form than
javascript is the way to go. 

http://developer.irt.org/script/email.htm

It's the very first FAQ. #122. 
-Sterling


Carlos Fernando Scheidecker Antunes wrote:
> 
> Hello all!
> 
> I would like to know if anyone has or know any PHP code to verify if a form entered 
>e-mail address is valid?
> 
> I would like that things like 4$%^%$@@.com.br could not be sent. I only has to 
>verify the syntax of it, the existance I believe should be harder to verify but if it 
>is possible I would be glad if anyone could point me the way.
> 
> Thanks,
> 
> Carlos Fernando.

-- 
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] Escaping Characters - URL Encoding.

2001-04-24 Thread Sterling

H-

Thank you very much!

I feel kinda dumb.
I think I'll take a break. 6 hours in front of a monitor is too much.
8^) 

Thanks for the assist. rawurlencode worked great. 
-Sterling


Alexander Wagner wrote:
> 
> Sterling wrote:
> > $topic = "Aerospace & Commercial Space";
> >
> > $link_value = str_replace("&", '%26', $topic);
> > $link_value = str_replace(' ', '%20', $topic);
> 
> This should be
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $link_value);
> 
> Anyway, this is this wrong way to go about it.
> This line
> $link_value = rawurlencode($topic);
> will do the whole job.
> 
> regards
> Wagner
> 
> --
> "In place of infinity we usually put some really big number, like 15."
>  - Anonymous Computer Science professor

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




Re: [PHP] upload/download of files (This is LONG)

2001-05-01 Thread Sterling

H-

Some things to consider. 

You might want to do a search and replace for any spaces and special
characters and replace them with the underscore for all files. This way
you won't get the Netscape error messages and it also might be affecting
IE. 

For instance. 

Provoke - Quick Blast.mp3 would be converted to
Provoke___Quick_Blast.mp3 Or just remove white spaces. 

The reason I mention this is because in your last paragraph you mention
using the name in a web link. 
If it's not encoded correctly (meaning, has whitespace) netscape will
choke. Don't know why IE is freaking on the name. Is it being saved
correctly in the directory? What is the DB filename? 


As far as the file itself not playing. Sounds like you're not saving the
file out correctly. Might want to check for bin types or some such thing
for saving binary files. I know if you don't have the correct header and
save out code your images will be screwy. Perhaps it's related. Sorry I
can't be more helpful. 

Well that's all I can think of right now. 
Hope it helps some or gives a direction. 
-Sterling


Tyler Longren wrote:
> 
> Hello everyone,
> 
> Here's my problem:
> I need to be able to upload some info about an mp3 to a database (name,
> filename, size, and file_type).  I can do this already, and it works just
> fine.  After the info is added to the database, the mp3 is uploaded to
> music/$binFile_name.
> 
> Here's the code I have to put info into the db and upload the file to the
> music directory:
> $data = addslashes(fread(fopen($binFile, "r"), filesize($binFile)));
> $strDescription = addslashes(nl2br($txtDescription));
> $album_sql = mysql_query("SELECT *  FROM albums WHERE id = '$album_id'
> AND artist_id = '$artist_id'");
> $album = mysql_fetch_object($album_sql);
> $sql = "INSERT INTO music
> (artist_id, artist, album_id, album_title, track_name, track_number,
> mp3_type, description, filename, filesize, filetype) VALUES ('$artist_id',
> '$artist', '$album_id', '$album->album_title', '$track_name',
> '$track_number', '$mp3_type', '$strDescription', '$binFile_name',
> '$binFile_size', '$binFile_type')";
> $result = mysql_query($sql, $db);
> mysql_free_result($result);
> $len = strlen($data);
> if ($fp = fopen("../../music/$binFile_name", "wb")) {
> if ($size = fwrite($fp, $data, $len)) {
> print "Thanks, $binFile_name has been added 
>to
> our database.";
> fclose ($fp);
> }
> else {
> print "$binFile_name couldn't be written to,
> perhaps some permissions are wrong?";
> }
> }
> else {
> print "$binFile_name couldn't be opened (or
> created), please try again.";
> }
> 
> One problem begins when trying to play that MP3.  When I try to play the
> MP3, it NEVER plays.  Is there some headers that need to be sent while
> uploading the file?
> 
> Here's the code I use to let users download the mp3:
> while ($row = mysql_fetch_array($sql)) {
> $artist = $row["artist"];
> $artist_id = $row["artist_id"];
> $id = $row["id"];
> $track_name = $row["track_name"];
> $type = $row["mp3_type"];
> $filename = $row["filename"];
> if ($alternate == "1") {
> $color = "#ff";
> $alternate = "2";
> }
> else {
> $color = "$color1";
> $alternate = "1";
> }
> print " href=bands.php?option=View%20Band&id=$artist_id> color=#00>$artist href='music/$filename'> color=#00>$track_name$type";
> }
> 
> So the final dl link ends up being: Track
> Name
> I can download this in IE, but it still won't play, and when I do a "Save
> Target As" the file name is all screwed up.
> If the link was this: http://localhost/sweetleaf/music/Provoke -
> Quick Blast.mp3>Quick Blast you'd think the filename I'd download would
> be "Provoke - Quick Blast.mp3".  When doing a Save Link As, this is the
> filename: ProvokQuicBlast.mp3.  Any ideas why?
> 
> Also, when downloading in NS, I get this: The parameter is incorrect.
> Any idea what that means?
> 
> thanks for sitting through all of this.  I hope you can offer me some help.
> :)
> 
> Regards,
> Tyler Longren
> 
> P.S.
> If you'd like more of my code to look @, just let me 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]

-- 
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] Manipulating Images into JPG

2001-05-10 Thread Sterling

H-

A good place to start would be GD.pm and ImageMagick
http://stein.cshl.org/WWW/software/GD/GD.html
http://www.wizards.dupont.com/ -- This is the website but it's not
pulling up right now. 

There are many others but this will give ya a start.

HTH,
-Sterling



Adam Plocher wrote:
> 
> I want to build a personal page that will have functionality to change many
> types of image formats into a jpg.  Ie, convert gif to jpg, png to jpg, even
> bmp to jpg.  Assuming this is possible, does anybody have any sample code I
> can take a look at?
> 
> Thanks much.
> 
> Adam Plocher
> 
> "If ignorance is bliss, why aren't there more happy people in the world?"
> 
> --
> 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] StripSlashes

2001-05-10 Thread Sterling

H-

I'd like to be able to strip the slashes from all the imported
HTTP_POST_VARS. 

I found the $string = stripslashes($string); command. 

But this becomes very tedious if I have 20 vars and I need to code each
one with its own stripslashes line. 
Which I am currently doing in a function. 

So I have two situations. 
One: 
function scrub_slashes(){
$email = stripslashes($email);
$first_name = stripslashes(first_name);
$last_name = stripslashes($last_name);
$street1 = stripslashes($street1);
$street2 = stripslashes($street2);
$city = stripslashes($city);
$zipcode = stripslashes($zipcode);
} 

I'm not sure if I'm doing this function correctly. From what I
understand I think I need to pass each variable to the function; which
would negate the speedyness of my typing which is what I'm going for
anyway. 
function scrub_slashes($email, $first_name, etc){ CODE }

and it'd be called like so $scrub_error = scrub_slashes($email,
$first_name, etc) 
I might as well copy paste the $email stripslashes($email); $first_name
= stripslashes($first_name);
in any location that it's needed. It might seem lazy but I really don't
see why I need to dupe the code when I could put it into a function.

Second situation:
Is there a better way to pass all the variables into the function
without typing out each one that's gonna be used in the function? 
Am I even using the function correctly? 
Am I confusing anyone? 

Thanks for any info or advice any can provide. 

Thoughts, Comments, Anecdotes? 
-Sterling

-- 
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] Array confusion.

2001-03-22 Thread Sterling

H-

I'm kinda new to the PHP scene so if the below plea for help is
incredibly simple ... well.. What can I say? I'm stuck. 

I've been on the PHP website for the last hour reading the documentation
on arrays and all the functions associated with it but have yet to find
a straight forward explaination on how to accomplish this code. 
Here's what I have: (PHP4)
 $m = "03";
 $list = array(01=>"Jan", 02=>"Feb", 03=>"Mar", 04=>"Apr", 05=>"May",
06=>"Jun", 07=>"Jul", 08=>"Aug", 09=>"Sep\", 10=>"Oct", 11=>"Nov",
12="Dec");
 $month = $list[$m];
 print "$month\n";

What I want to print is the month in Text format, which in this instance
should be Mar . 
I even tried: $month = array_keys($list, $m);

Now I know that $list[x]; references the location of an item so I know
why the previous code doesn't work in that respect, since nowhere is 01
a location but an association within the array. Right?

I've seen examples on printing every element of an array. Printing every
element of a 2d array, poping elements from the beginning and end of an
array but not an example of getting a single element from an array. 

I'm sure I'm doing something backwards and might even be confused on how
the array works but don't know what. 
If any one has any better solutions to this code please feel free to
post. 

Thanks for any assistance anyone can provide. 
-Sterling

-- 
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] Array confusion.

2001-03-22 Thread Sterling

H-

Thanks to all that wrote in with input on this issue. 

I really appreciate the assistance. 

Thanks to CC Zona and James for the code sample. It looks like there
were typo's in my code and it threw me for a minute after
recieving/applying all the emails. 
That backslash wasn't suppose to be in the original email I sent out, it
was just from my Emacs window wrapping and the = next to Dec became a
problem after I quoted everything else but I found it eventually.

Thanks again. It's now working as I expected it too. 
-Sterling


CC Zona wrote:
> 
> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Sterling) wrote:
> 
> >  $m = "03";
> >  $list = array(01=>"Jan", 02=>"Feb", 03=>"Mar", 04=>"Apr", 05=>"May",
> > 06=>"Jun", 07=>"Jul", 08=>"Aug", 09=>"Sep\", 10=>"Oct", 11=>"Nov",
> > 12="Dec");
> >  $month = $list[$m];
> >  print "$month\n";
> >
> > What I want to print is the month in Text format, which in this instance
> > should be Mar .
> > I even tried: $month = array_keys($list, $m);
> >
> > Now I know that $list[x]; references the location of an item so I know
> > why the previous code doesn't work in that respect, since nowhere is 01
> > a location but an association within the array. Right?
> 
> The keys to an associative array should be quoted.  Also, that escaped
> quote on "Sep\" is throwing everything off.  Try:
> 
>  $m = "03";
>  $list = array("01"=>"Jan", "02"=>"Feb", "03"=>"Mar", "04"=>"Apr",
> "05"=>"May", "06"=>"Jun", "07"=>"Jul", "08"=>"Aug", "09"=>"Sep",
> "10"=>"Oct", "11"=>"Nov","12"="Dec");//keys quoted, no escaped quotes
>  $month = $list["$m"];//associative array element index quoted
>  print "$month\n";
> 
> --
> CC
> 
> --
> 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] Text fading with PHP?

2001-03-24 Thread Sterling

H-

Go here. 
http://www.dynamicdrive.com/

This site has a lot of free code that does fancy html stuff. 

It'll even tell ya which browsers the code is compatible. 
Later, 
-Sterling


Jack Dempsey wrote:
> 
> Umm, what exactly are you talking about?? I'm not sure how you could have
> gotten PHP confused with Flash, but if you want to "fade" text, you need a
> graphics program, like flash, not PHP.
> www.macromedia.com
> 
> jack
> 
> -Original Message-
> From: Jamie Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 24, 2001 2:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Text fading with PHP?
> 
> Hi
> 
> Is it possible to do text fading with PHP.  For instance, I want to one line
> of text fade in, have another line fade in later, and a third line after
> that.  Then all three lines will fade out at the same time and start over
> with three different lines.  Is this possible with php?
> 
> Thanks
> 
> Jamie
> 
> --
> 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] GD problem

2001-03-26 Thread Sterling

H-

You might want to make sure your version of GD supports JPG format. 

If I'm not mistaken newer versions of GD don't support GIF anymore and
the earlier versions of GD didn't support JPG but PNG format has always
been supported. 

Maybe it's related to GD and not PHP at all. 

Just a thought. 
-Sterling


Brandon Orther wrote:
> 
> Hello,
> 
> Using GD i get this error.  I know what it means I just wanted to know if
> anyone knew how I resolve it.
> 
> Error: ImageCreateFromJpeg: No JPEG support in this PHP build in jpg.php on
> line 5
> 
> Do I need to get new GD files and change php.ini or chan I just change the
> library?
> 
> Thank you,
> 
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.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] Simple If-else statement

2001-03-27 Thread Sterling

H-

Another solution might be to use javascript to check the fields before
the page is even submitted to make sure they put "something" in the
first and last name fields. 

Unfortunately I'm not a javascript person but I've seen it done so much
I'm sure you could find examples on the web or via a web search engine. 

As far as your code; I concure with the other posters replies: "" is
empty, " " is a space. I've made the same mistake. Also did the if
($name = "") { } Screwed me up for a bit until I remembered == is
comparison. 8^) Oh well if you don't use it you lose it. 

Take it easy. 
-Sterling


Louis Brooks wrote:
> 
> Hi:
> 
> I am trying to set up a simple script that will verify that all the blanks
> in a form have been filled out and then submit that to mySQL. If the form
> has not been completely filled out I want it to redirect them back to the
> original form. I know that the mySQL part of the script works, but I am
> unable to get the part of the script that checks the form input to see if
> everything was filled out to work. It seems to bypass this part of the
> script and enter the info into mySQL . Here is what I have so far:
> 
> If (($fname == " ") || ($lname == " "))
>  {
>  header("Location: http://callook.org/member_joinform.html");
> }else{
>  $db = mysql_connect("localhost", "name", "password");
>  mysql_select_db("dBase",$db);
>  $sql = "INSERT INTO
> members
> (fname,lname,address,city,state,zip,country,email,username,password)
> VALUES
> ('$fname','$lname','$address','$city','$state','$zip','$country','$email','$user
> name','$password')";
>  $result = mysql_query($sql);
> }
> 
> I hope the formatting comes out right. I am sure it is something simple I
> have missed but I have tried the script several different ways and nothing
> seems to work. Thank you for any help.
> 
> Sincerely,
> 
> Louis Brooks
> 
> BTW: Is there a faq for this list before I go asking anymore questions?

-- 
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] Simple If-else statement

2001-03-27 Thread Sterling

H-

Really, that's strange. 

Try printing out your variables and seeing what is actually being
passed. 

print "FNAME:$fname:\n";

With the : : colons surrounding your variable you can see what if
anything is actually in $fname. 

Also it might have been a typo on your part but be sure to check for
single = and double == when using your if statements. 

For debugging purposes do simple stuff first. 

if ($fname == "") { 
print "NOTHING HERE\n";
//header("Location: http://callook.org/member_joinform.html");
} else {
print "Got Something: FNAME:$fname:\n";

if (1 == 2) {
 $db = mysql_connect("localhost", "name", "password");
 mysql_select_db("dBase",$db);
 $sql = "INSERT INTO 
members 
(fname,lname,address,city,state,zip,country,email,username,password) 
VALUES 

('$fname','$lname','$address','$city','$state','$zip','$country','$email','$user 
name','$password')";
$result = mysql_query($sql);
} # end if block commentor for multipe line comments. It's cleaner. 8^)

} end if-else check.

Hope this is helpful. 
-Sterling


Louis Brooks wrote:
> 
> Thanks for everyone's response. I am still not able to get the
> 
> if(($fname="")) {
> 
> statement to work even with the suggestions everyone made so I am beginning
> to wonder if it is a problem with the server. (It is php3 on an Apache
> server. ) Any other suggestions would be greatly appreciated.
> 
> Thanks again,
> 
> Louis Brooks
> 
> At 02:29 PM 3/27/01 -0500, you wrote:
> >H-
> >
> >Another solution might be to use javascript to check the fields before
> >the page is even submitted to make sure they put "something" in the
> >first and last name fields.
> >
> >Unfortunately I'm not a javascript person but I've seen it done so much
> >I'm sure you could find examples on the web or via a web search engine.
> >
> >As far as your code; I concure with the other posters replies: "" is
> >empty, " " is a space. I've made the same mistake. Also did the if
> >($name = "") { } Screwed me up for a bit until I remembered == is
> >comparison. 8^) Oh well if you don't use it you lose it.
> >
> >Take it easy.
> >-Sterling
> >
> >
> >Louis Brooks wrote:
> > >
> > > Hi:
> > >
> > > I am trying to set up a simple script that will verify that all the blanks
> > > in a form have been filled out and then submit that to mySQL. If the form
> > > has not been completely filled out I want it to redirect them back to the
> > > original form. I know that the mySQL part of the script works, but I am
> > > unable to get the part of the script that checks the form input to see if
> > > everything was filled out to work. It seems to bypass this part of the
> > > script and enter the info into mySQL . Here is what I have so far:
> > >
> > > If (($fname == " ") || ($lname == " "))
> > >  {
> > >  header("Location:
> > http://callook.org/member_joinform.html");
> > > }else{
> > >  $db = mysql_connect("localhost", "name", "password");
> > >  mysql_select_db("dBase",$db);
> > >  $sql = "INSERT INTO
> > > members
> > > (fname,lname,address,city,state,zip,country,email,username,password)
> > > VALUES
> > >
> > ('$fname','$lname','$address','$city','$state','$zip','$country','$email','$user
> > > name','$password')";
> > >  $result = mysql_query($sql);
> > > }
> > >
> > > I hope the formatting comes out right. I am sure it is something simple I
> > > have missed but I have tried the script several different ways and nothing
> > > seems to work. Thank you for any help.
> > >
> > > Sincerely,
> > >
> > > Louis Brooks
> > >
> > > BTW: Is there a faq for this list before I go asking anymore questions?
> >
> >--
> >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]




[PHP] Pattern Replacing

2001-03-29 Thread Sterling

H-

Well here's a pattern replace issue which I've been working on without
success hence the post. 8^) 

I have a variable that has stuff in it (tree, bird, nest, )(yes there is
a trailing space)

What I'd like to do is strip off the last ', ' and replace it with a
single space so that I have 
(tree, bird, nest )

I thought I had it with a simple substr_replace but it only returned my
replace character. 

I thought that ereg_replace would work but got infinitly lost with the
[]\s(.) stuff. 

If I was in perl I'd do something like (s/,.$/ /ig). I think. Never
fully grasped the pattern stuff anyway. 8^/

But anywhoo... if anyone has any ideas send them along. Any help would
be greatly appreciated. 

Thanks. 
-Sterling

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

2001-03-29 Thread Sterling

H-

Thanks to those that emailed. 

$query = "tree, bird, nest, ";
$new = substr($query,0,2);

Doesn't seem to work. It returns "tr". 

I think maybe I should also mention that to get this variable I have an
array that is placed through a for loop 
// file://loop through array
 for($i = 0;$i <$num;$i++){
   print $fields[$i] . "";
   $query .= "$fields[$i], ";
  }

That's where I get $query from. It's been returned from a multiple
select via a web form. 
I want to format this selected data into a query string so I can plug it
into a SQL statement. 

Thanks for the input and if any one has any thoughts on the subject
appreciate the assistance. 
-Sterling



Sterling wrote:
> 
> H-
> 
> Well here's a pattern replace issue which I've been working on without
> success hence the post. 8^)
> 
> I have a variable that has stuff in it (tree, bird, nest, )(yes there is
> a trailing space)
> 
> What I'd like to do is strip off the last ', ' and replace it with a
> single space so that I have
> (tree, bird, nest )
> 
> I thought I had it with a simple substr_replace but it only returned my
> replace character.
> 
> I thought that ereg_replace would work but got infinitly lost with the
> []\s(.) stuff.
> 
> If I was in perl I'd do something like (s/,.$/ /ig). I think. Never
> fully grasped the pattern stuff anyway. 8^/
> 
> But anywhoo... if anyone has any ideas send them along. Any help would
> be greatly appreciated.
> 
> Thanks.
> -Sterling
> 
> --
> 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] Pattern Replacing

2001-03-29 Thread Sterling

H-

Thanks for the emails and reply. 

Someone mentioned substr and after first failing with the attempt I went
to the PHP site and looked it up. 

Here's code that works for what I'm trying to do. 
$test = "tree, bird, nest, ";
$new = substr($test, 0, strlen($test)-2);
$new = "$new ";

Appreciate nudges in the right directions. 
-Sterling

-- 
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] Print or Echo.

2001-04-06 Thread Sterling

H-

Just a quick question. 

Is there any difference between using print or echo? 

>From what I have read and seen there isn't any. 
Than why the two different commands? 

Thanks. 
-Sterling

-- 
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] Print or Echo.

2001-04-09 Thread Sterling

H-

Thanks to all that wrote in. 

Appreciate the information and have learned much, the links were most
helpful.

Happy coding everyone. 

Sincerely,
-Sterling


Sterling wrote:
> 
> H-
> 
> Just a quick question.
> 
> Is there any difference between using print or echo?
> 
> >From what I have read and seen there isn't any.
> Than why the two different commands?
> 
> Thanks.
> -Sterling
> 
> --
> 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] Subject: RE:Please Confirm!! Yes I want to Optin RE: php-general@lists.php.net

2001-10-05 Thread Sterling

You [EMAIL PROTECTED],  or someone using your email 
[EMAIL PROTECTED] address, posted  to my Blastomatic site. This is a
one time 
emailing to ask you to verify your email address. Just reply 
to this email address to verify or follow the below instructions.
*
To receive the Blastomatic please click on the following link:
http://oneop.blastomatic.com/rainforest 
And Optin from this site.

To receive my Weekly News Update reply to:
mailto:[EMAIL PROTECTED]?Subject=BLASTOMATIC

Sincerely,
  Sterling White

**
This email is sent in compliance with our strict anti-abuse 
regulations. We are attempting to verify your email address. 
This message is only a request to verify. It is not in any 
way to be construed as a commercial message. If you do not
wish to receive any mail from our servers, do not reply to 
this email nor click on any links. If you wish to have your 
email address blocked from our servers from further 
verification requests please go to 
http://inetekk.com/abuse.html
 Thank you!!  Sterling White
***



-- 
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] does //commenting reduce performance?

2002-11-24 Thread Sterling Hughes
> At 09:42 24.11.2002, Adam said:
> [snip]
> >I have always had the opinion that the more comments you put into php
> >scripts, the slower they will run because there is more data to be read...
> >Can someone tell me if there is any truth in this or whether commenting has
> >absolutely 'no' impact on the performance of a script?
> [snip] 
> 
> As PHP is an interpreter it needs to scan every line and every token of
> code as it runs it. Thus said, of course using comments takes more time to
> execute than having no comments.
> 
> I have no profiling yet how much having comments or blank lines would
> actually effect execution times, but I doubt it would be really an issue
> since PHP, once a comment start is encountered, doesn't parse the text but
> just scans for the end-comment tag.
>

Having comments within loops is no different than having comments anywhere else
in your PHP scripts, comments are stripped out in the lexical analysis phase, 
and therefore, they don't even enter into consideration in the execution phase.

If you're worried about the extra lex/io time on your scripts then (besides 
being a little insane :), you should just be using a cache like the PHP 
Accelerator or APC, which will make comments give you absolutely no performance
hit.

-Sterling

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




Re: [PHP] Insert file into sql server binary field.

2002-11-24 Thread Sterling Hughes
> Read the file, addslashes(), and then insert it
>
Rather, read the file, don't touch addslashes, then insert it.

AddSLashes is not for binary data...

-Sterling



> Naif Al-Otaibi wrote:
> 
> >How can I insert a file into a binary field in sql server 2000. Do I 
> >need some function in the query like upload or just read the file and 
> >insert it.
> >
> >Thanks,
> >
> > 
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




Re: [PHP] OS X and cURL Issues

2002-11-30 Thread Sterling Hughes
you need to upgrade the bundled cURL to version 7.9.8 (soon to be 
7.10.2), or install a special version of the cURL library for PHP's 
installation.

-Sterling


> I'm working on getting the following install working under OS 10.2.2:
> 
> ../configure --prefix=/usr \
> --sysconfdir=/etc \
> --localstatedir=/var \
> --mandir=/usr/share/man \
> --with-apxs=/usr/sbin/apxs \
> --with-mysql \
> --with-gd=/usr/local \
> --with-png-dir=/usr/local \
> --with-zlib-dir=/usr/local \
> --with-jpg-dir=/usr/local \
> --with-freetype-dir=/usr/local \
> --enable-trans-sid \
> --enable-exif \
> --enable-ftp \
> --enable-calendar \
> --with-curl=/usr/lib \
> --with-flatfile \
> --with-ming=/Users/whoughto/src/ming-0.2a \
> --enable-sockets \
> --with-jave=/Library/Java/Home \
> --with-xml
> 
> And Curl keeps throwing me the following error, but as you can see, I 
> do indeed have 7.9.8 installed. Any ideas?
> 
> checking for CURL support... yes
> checking for CURL in default path... found in /usr
> checking for cURL 7.9.8 or greater... configure: error: cURL version 
> 7.9.8 or later is required to compile php with cURL support
> [user/src/php4rc2] root# curl --help
> curl 7.9.8 (powerpc-apple-darwin5.5) libcurl 7.9.8
> 
> Thanks,
> Wes
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




[PHP] Problems with text files from a Mac

2002-12-13 Thread Sterling Anderson
I am working on an application for a school district and am having some 
problems with the files they are supplying for import.
They are supplying data files and I am writing routines to populate the 
database using these files. Its a simple file upload then I just need to 
parse through the tab separated value file. I am using the most recent 
PHP build on Windows with IIS ISAPI and a MSSQL database. They are 
sending text files from a Macintosh application.
I noticed on the documentation for fgetcsv() that it cannot read the end 
of line character on Mac files. I have not been able to find a good work 
around for this issue. When I grab the entire contents of the file then 
try doing a string replacement on the "\r" or even "\t" for that matter 
it does not work.
Has anyone found a good solution for dealing with Mac files?


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



Re: [PHP] PHP 4.3.0, function removed?

2002-12-28 Thread Sterling Hughes
leak() is only included if you compile PHP with debug mode.

Out of interest, why on earth would someone in user-space be using
the leak() function.

-Sterling

> Can't see anything in the changelog but after upgrading to 4.3.0 I get an error when 
>using leak();
> Fatal error: Call to undefined function: leak() in .
> 
> I was previously using 4.2.3 and it worked fine.
> I upgraded with the Windows Binaries (PHP 4.3.0 installer [1,028Kb] - 27 December 
>2002) and running on Win2k/Apache.
> 
> The function still shows as being a function as such..
> http://www.php.net/manual/en/function.leak.php
> and there is no notices that it won't work with 4.3.0
> 
> I can probably run the script without the function fine but has anyone else found 
>any problems with using this function in 4.3.0 or have I configured something wrong? 
>:P
> 

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




Re: [PHP] Web Based PHP CVS

2003-01-05 Thread Sterling Hughes
> 
> Does anyone know of any decent PHP/Web front ends to CVS?
>

check out chora.

-sterling


> Thanks
> Mike
> 
> 
> P.S. Still looking for a good Linux SysAdmin Mail list.
> I don't understand Romanian but thanks for the answer!  :-)
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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




Re: [PHP] Zend IDE vs. PhpEd

2003-01-05 Thread Sterling Hughes
> Can anyone who's familiar with both give an honest, open evaluation?  I'm
> in a rush project and need something quickly (have to purchase tomorrow),
> but I'm on the fence when it comes to these two products.
> 
> Zend costs $100 less than Phped, so I'm leaning that way.  But if there's
> anything you know that could make my decision easier, please forward it
> on.  They seem pretty comparable, with the exception of PhpEd's db
> browser.
> 

I personally recommend the Zend IDE, simply because:

1) Its (more) cross platform
2) A more complete autocompletion.  Uses javadoc style documentation to generate
function prototypes for which you can then use autocompletion.  It also resolves
classes and objects.
3) Richer debugger
4) Better integration with other Zend products, if you want to use the encoder, 
it plugs right into the Zend IDE.
5) I like working with it more, and that's what it all comes down too.  The Zend
IDE is what I'm more comfortable with (outside of vim and emacs, which I must admit
are my primary development tools).

-Sterling


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

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




[PHP] PHP and XML mailing list

2003-01-24 Thread Sterling Hughes
A mailing list for discussing the future of PHP and XML development has
been created.  You can subscribe by sending a message to
[EMAIL PROTECTED] (normal ezmlm commands apply).  This
mailing list is _only_ intended for actual php extension and api
development, user support questions should remain on
[EMAIL PROTECTED]

-Sterling

-- 
"Nothing is particularly hard if you divide it into small jobs." 
- Henry Ford


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




Re: [PHP] slides

2003-01-27 Thread Sterling Hughes
On Mon, 2003-01-27 at 10:20, Ornella Fasolo wrote:
> Hallo,
> does anybody knows where can I find a set of presentation 
> sildes of the PHP language base(or PHP toghether with mysql)? .
> May be coming from any tutorial or previous course.
> Thank you very much
> 

http://talks.php.net/

> Ornella
-- 
"The computer programmer is a creator of universes for which he  
 alone is responsible. Universes of virtually unlimited complexity  
 can be created in the form of computer programs." 
- Joseph Weizenbaum


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




[PHP] Destroying COM objects

2003-02-27 Thread Sterling Anderson
When using the COM functions in PHP what is the equivalent of 
ASPs "set object=nothing"?
I am using the Crystal Report objects and I cannot seem to 
destroy my Report object.

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



RE: [PHP] Destroying COM objects

2003-02-28 Thread Sterling Anderson
Tried setting it to NULL and unset(com_onject).
Neither are working. I'm stumped.

On Thu, 27 Feb 2003 23:35:23 +, Rich Gray wrote:

>> When using the COM functions in PHP what is the equivalent of 
>> ASPs "set object=nothing"?
>> I am using the Crystal Report objects and I cannot seem to 
>> destroy my Report object.
> 
> Have you tried setting it to NULL?
> Rich


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



RE: [PHP] php5 writeup

2003-04-04 Thread Sterling Hughes
On Fri, 2003-04-04 at 10:45, Dan Rossi wrote:
> what exactly do namespaces do , i can sorta see whats its doin
> 
> and this is what i want !!
> 
>  define('NUM', 10);
> try {
> if (NUM < 20) {
> throw new Exception(
> NUM . " is too small!"
> );
> }
> } catch (Exception $e) {
> echo $e->getMessage();
> echo "\n\n";
> }
> ?>
> 
> 
> function __construct() {
> echo "peel..peel..";
> echo "\n\n";
> }
> 
> cool
> 
> when is this actually used ?
> function __destruct() {
> echo "slip... crack!";
> echo "\n\n";
> }
> 
> yep this is cool i've already tested it out and it works , but what is the
> whole point of private and protected again ? i've been reading the java
> intro on the sun site and it goes into detail about it
> http://ny1.php.net/talks/show.php/php5intro/13
> 
> hmm i soughta found php4 cant do this
> 
>  function add_agent($name) {
> array_push($this->agents, $name);
> }
> }
> 
> class cia_administration extends cia {
> function __construct() {
> $this->add_agent('Sterling');
> $this->add_agent('Zeev');
> $this->add_agent('Andi');
> $this->add_agent('Rasmus');
> $this->add_agent('Thies');
> }
> }
> 
> i had to call the parent class constructor into the base constructor first
> to use its functions ?>?

Constructors in PHP5 are unified.  This means you don't have to be aware
of your parent class name while coding (so, for example, if you change
what class you inherit, you don't have to dig to find where the parent
constructor was called.

> 
> i dont get this http://ny1.php.net/talks/show.php/php5intro/25
> 

It misses something without my explanation. :)

PHP5 has native support for overloading access to properties and
methods.  Take the following:

overloads = array(
"name" => "Sterling",
"address" => "More Spam Mail",
"email" => "Even More Spam Mail"
);
}

function __get($name) {
return $this->overloads[$name];
}

function __set($name, $value) {
$this->overloads[$name] = $value;
}
}

$f = new foo;
// undefined, __get method will be called, and it will 
// return the appropriate entry from overloads
var_dump($f->address);  
?>

> wots the point of this ? http://ny1.php.net/talks/show.php/php5intro/28
> 

Abstract allows you to define certain methods that *must* be implemented
in child classes.  It also makes sure you can't instantiate parent
classes (as they are incomplete).  Its really a good way of passing
interface contracts onto child classes.

Take the example in my presentation, and copy it into your editor.  Then
remove the paint() method, and the corresponding method call from the
child class.  Without abstract being specified, this would still work;
with abstract, watch what happens.

-sterling

-- 
Good judgement comes from experience, and experience comes from 
bad judgement. 
- Fred Brooks


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



Re: [PHP] dotnet module?

2003-06-11 Thread Sterling Hughes
In php5 you can use the mono module.

-Sterling

On Wed, 2003-06-11 at 21:43, DvDmanDT wrote:
> Hello, I was wondering if anyone has a working php_dotnet.dll? I was also
> wondering is anyone was going to add class constructor support for it? Or is
> that already supported?
> 
> Thanks in advance / DvDmanDT
-- 
"Programming today is a race between software engineers stirring to  
 build bigger and better idiot-proof programs, and the universe trying  
 to produce bigger and better idiots. So far, the universe is winning." 
- Unknown

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



[PHP] PHP 5.0.0 Beta 1

2003-06-29 Thread Sterling Hughes
The PHP development community is proud to announce the release of
PHP 5 Beta 1.  Both source packages and a Win32 build are available, you
can find these packages at http://www.php.net/downloads.php.  For a
complete list of changes, please refer to
http://www.php.net/ChangeLog-5.php.

Some of the more major changes include:

  - PHP5 features the Zend Engine 2.  For a list of Zend Engine 2 
changes, please visit http://www.php.net/zend-engine-2.php.

  - XML support has been completely redone in PHP5, all extensions 
are now focused around the excellent libxml2 library 
(http://www.xmlsoft.org/).

  - SQLite has been bundled with PHP.  For more information on SQLite,
please visit their website, http://www.hwaci.com/sw/sqlite/.

  - Streams have been greatly improved, including the ability to access
low-level socket operations on streams.

  - Due to issues surrounding the MySQL 4.0 license, the MySQL libraries
are no longer bundled with PHP.  For more information on these
licensing changes please see the MySQL licensing policy [1]

Note: This is a beta version. It should not be used in production or
even semi-production web sites. There are known bugs in it, and in
addition, some of the features may change (based on feedback). We
encourage you to download and play with it (and report bugs[2] if you
find any!), but please do not replace your production installations of
PHP 4 at this time.

[1] http://www.mysql.com/products/licensing.html
[2] http://bugs.php.net/

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



[PHP] Re: [PHP-DEV] Do I need the closing ?> tag

2002-11-08 Thread Sterling Hughes
> PHP 4.2.2 (linux) doesn't seem to mind if I leave off the closing ?> tag at
> the end of a file.  Is the ?> assumed at EOF?
> 
> I have PHP that outputs binary and along the way I include() a lot of php
> scripts.  I'm constantly having problems when I leave a little whitespace at
> the end of some script after the ?> which screws up the output binary.
> First time this happened it took me hours to figure out the cause.
> 
> What does everyone think about just leaving off the ?> as a solution to
> this?  It works for me now, but would any PHP developer care to
> prognosticate on the liklihood this might change in future?
> 

I definitely think that _you_ should do it.

But this is not the proper place for these questions, ask them on
[EMAIL PROTECTED]

?> Sterling


-- 
Sterling Hughes <[EMAIL PROTECTED]>
Did I help you? Consider a gift: http://wishlist.edwardbear.org/

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




[PHP-CVS] cvs: php4 /ext/zziplib php_zziplib.h zziplib.c

2001-01-11 Thread Sterling Hughes

sterlingThu Jan 11 01:23:34 2001 EDT

  Modified files:  
/php4/ext/zziplib   zziplib.c php_zziplib.h 
  Log:
  
  @ Add an experimental version of the ZZipLib extension which provides the 
  @ ability to read zip files. (Sterling)
  
  
  

Index: php4/ext/zziplib/zziplib.c
diff -u php4/ext/zziplib/zziplib.c:1.1 php4/ext/zziplib/zziplib.c:1.2
--- php4/ext/zziplib/zziplib.c:1.1  Tue Nov 21 17:28:51 2000
+++ php4/ext/zziplib/zziplib.c  Thu Jan 11 01:23:34 2001
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Hartmut Holzgraefe <[EMAIL PROTECTED]> |
+   | Authors: Sterling Hughes <[EMAIL PROTECTED]>  |
+--+
  */
 
@@ -20,32 +20,38 @@
 #include "php_ini.h"
 #include "php_zziplib.h"
 
-/* You should tweak config.m4 so this symbol (or some else suitable)
-   gets defined.
-*/
 #if HAVE_ZZIPLIB
-
-/* If you declare any globals in php_zziplib.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(zziplib)
-*/
-
-/* True global resources - no need for thread safety here */
-static int le_zziplib;
-
-/* Every user visible function must have an entry in zziplib_functions[].
-*/
-function_entry zziplib_functions[] = {
-   PHP_FE(confirm_zziplib_compiled,NULL)   /* For testing, remove 
later. */
-   {NULL, NULL, NULL}  /* Must be the last line in zziplib_functions[] */
+
+#include 
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+static int le_zzip_dir;
+static int le_zzip_entry;
+
+function_entry zziplib_functions[] = {
+   PHP_FE(zzip_opendir, NULL)
+   PHP_FE(zzip_readdir, NULL)
+   PHP_FE(zzip_closedir,NULL)
+   PHP_FE(zzip_entry_name,  NULL)
+   PHP_FE(zzip_entry_compressedsize,NULL)
+   PHP_FE(zzip_entry_filesize,  NULL)
+   PHP_FE(zzip_entry_compressionmethod, NULL)
+   PHP_FE(zzip_open,NULL)
+   PHP_FE(zzip_read,NULL)
+   PHP_FE(zzip_close,   NULL)
+   {NULL, NULL, NULL}
 };
 
 zend_module_entry zziplib_module_entry = {
"zziplib",
zziplib_functions,
PHP_MINIT(zziplib),
-   PHP_MSHUTDOWN(zziplib),
-   PHP_RINIT(zziplib), /* Replace with NULL if there's nothing to do 
at request start */
-   PHP_RSHUTDOWN(zziplib), /* Replace with NULL if there's nothing to do at 
request end */
+   NULL,
+   NULL,   
+   NULL,
PHP_MINFO(zziplib),
STANDARD_MODULE_PROPERTIES
 };
@@ -53,38 +59,30 @@
 #ifdef COMPILE_DL_ZZIPLIB
 ZEND_GET_MODULE(zziplib)
 #endif
-
-/* Remove comments and fill if you need to have entries in php.ini
-PHP_INI_BEGIN()
-PHP_INI_END()
-*/
-
-PHP_MINIT_FUNCTION(zziplib)
-{
-/* Remove comments if you have entries in php.ini
-   REGISTER_INI_ENTRIES();
-*/
-   return SUCCESS;
-}
-
-PHP_MSHUTDOWN_FUNCTION(zziplib)
-{
-/* Remove comments if you have entries in php.ini
-   UNREGISTER_INI_ENTRIES();
-*/
-   return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request start */
-PHP_RINIT_FUNCTION(zziplib)
-{
-   return SUCCESS;
+
+static void php_zziplib_free_dir(zend_rsrc_list_entry *rsrc)
+{
+   ZZIP_DIR *z_dir = (ZZIP_DIR *) rsrc->ptr;
+   zzip_closedir(z_dir);
+}
+
+static void php_zziplib_free_entry(zend_rsrc_list_entry *rsrc)
+{
+   php_zzip_dirent *entry = (php_zzip_dirent *) rsrc->ptr;
+
+   if (entry->fp) {
+   zzip_close(entry->fp);
+   }
+
+   efree(entry);
 }
 
-/* Remove if there's nothing to do at request end */
-PHP_RSHUTDOWN_FUNCTION(zziplib)
-{
-   return SUCCESS;
+PHP_MINIT_FUNCTION(zziplib)
+{
+   le_zzip_dir   = zend_register_list_destructors_ex(php_zziplib_free_dir, NULL, 
+"ZZIP Directory", module_number);
+   le_zzip_entry = zend_register_list_destructors_ex(php_zziplib_free_entry, 
+NULL, "ZZIP Entry", module_number);
+
+   return(SUCCESS);
 }
 
 PHP_MINFO_FUNCTION(zziplib)
@@ -92,41 +90,213 @@
php_info_print_table_start();
php_info_print_table_header(2, "zziplib support", "enabled");
php_info_print_table_end();
-
-   /* Remove comments if you have entries in php.ini
-   DISPLAY_INI_ENTRIES();
-   */
-}
-
-/* Remove the following function when you have succesfully modified config.m4
-   so that your module can be compiled into PHP, it exists only for testing
-   purposes. */
-
-/* Every user-visible function in PHP should document itself in the source */
-/* {{{ proto string confirm_zziplib_compiled(string arg)
-   Return a

[PHP-CVS] cvs: php4 / EXTENSIONS /ext/zziplib CREDITS EXPERIMENTAL README

2001-01-11 Thread Sterling Hughes

sterlingThu Jan 11 01:35:15 2001 EDT

  Modified files:  
/php4   EXTENSIONS 
/php4/ext/zziplib   CREDITS EXPERIMENTAL README 
  Log:
  Housekeeping...
  
  
  
Index: php4/EXTENSIONS
diff -u php4/EXTENSIONS:1.12 php4/EXTENSIONS:1.13
--- php4/EXTENSIONS:1.12Thu Jan  4 03:15:34 2001
+++ php4/EXTENSIONS Thu Jan 11 01:35:14 2001
@@ -171,6 +171,11 @@
 MAINTENANCE: Unknown
 STATUS:  Unknown
 ---
+EXTENSION:   bz2
+PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
+MAINTENANCE: Maintained
+STATUS:  Experimental
+---
 EXTENSION:   calendar
 MAINTENANCE: Unknown
 STATUS:  Unknown
@@ -187,7 +192,7 @@
 EXTENSION:   CURL
 PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
 MAINTENANCE: Maintained
-STATUS:  Experimental
+STATUS:  Working
 SINCE:   4.0.2
 ---
 EXTENSION:   cybercash
@@ -321,8 +326,8 @@
 ---
 EXTENSION:   sockets
 PRIMARY MAINTAINER:  Chris Vandomelen <[EMAIL PROTECTED]>
-MAINTENANCE: Unknown
-STATUS:  Unknown
+MAINTENANCE: Maintained
+STATUS:  Experimental
 SINCE:   4.0.2
 ---
 EXTENSION:   swf
@@ -346,7 +351,12 @@
 EXTENSION:   xml
 PRIMARY MAINTAINER:  Thies C. Arntzen <[EMAIL PROTECTED]>
 MAINTENANCE: Maintained
-STATUS:  Unknown
+STATUS:  Working
+---
+EXTENSION:   xslt
+PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
+MAINTENANCE: Maintained
+STATUS:  Experimental
 ---
 EXTENSION:   yaz
 PRIMARY MAINTAINER:  Adam Dickmeiss <[EMAIL PROTECTED]>
@@ -358,6 +368,10 @@
 PRIMARY MAINTAINER:  Stefan Roehrich <[EMAIL PROTECTED]>
 MAINTENANCE: Maintained
 STATUS:  Working
+---
+EXTENSION:   ZZiplib
+PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
+MAINTENANCE: Maintained
+STATUS:  Experimental
 ---
-
 # iptc?
Index: php4/ext/zziplib/CREDITS
diff -u php4/ext/zziplib/CREDITS:1.1 php4/ext/zziplib/CREDITS:1.2
--- php4/ext/zziplib/CREDITS:1.1Tue Nov 21 17:28:51 2000
+++ php4/ext/zziplib/CREDITSThu Jan 11 01:35:15 2001
@@ -1,2 +1,2 @@
-zZIPlib
-Hartmut Holzgraefe
\ No newline at end of file
+ZZiplib
+Sterling Hughes
Index: php4/ext/zziplib/EXPERIMENTAL
diff -u php4/ext/zziplib/EXPERIMENTAL:1.1 php4/ext/zziplib/EXPERIMENTAL:1.2
--- php4/ext/zziplib/EXPERIMENTAL:1.1   Tue Nov 21 17:28:51 2000
+++ php4/ext/zziplib/EXPERIMENTAL   Thu Jan 11 01:35:15 2001
@@ -1,2 +1,4 @@
-this extension dosn't do anything useful yet
-but it should at least configure and compile without problems
\ No newline at end of file
+This extension now provides basic functionality that is provided by the ZZiplib 
+library
+and it has not been extensively tested (only basic functionality).
+
+
Index: php4/ext/zziplib/README
diff -u php4/ext/zziplib/README:1.1 php4/ext/zziplib/README:1.2
--- php4/ext/zziplib/README:1.1 Tue Nov 21 17:28:51 2000
+++ php4/ext/zziplib/README Thu Jan 11 01:35:15 2001
@@ -1,4 +1,4 @@
-This extension is going to provide read access to ZIP files
+This extension provides read access to ZIP files
 using the zziplib library (similar to the zlib extension for
 gzip'ped files).
 



-- 
PHP CVS 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-CVS] cvs: php4 /ext/curl curl.c php_curl.h

2001-01-12 Thread Sterling Hughes

sterlingFri Jan 12 02:49:39 2001 EDT

  Modified files:  
/php4/ext/curl  php_curl.h curl.c 
  Log:
  Make daniel's changes work in ZTS mode...
  
  
  
Index: php4/ext/curl/php_curl.h
diff -u php4/ext/curl/php_curl.h:1.15 php4/ext/curl/php_curl.h:1.16
--- php4/ext/curl/php_curl.h:1.15   Fri Jan 12 02:26:29 2001
+++ php4/ext/curl/php_curl.hFri Jan 12 02:49:38 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_curl.h,v 1.15 2001/01/12 10:26:29 dbeu Exp $ */
+/* $Id: php_curl.h,v 1.16 2001/01/12 10:49:38 sterling Exp $ */
 
 #ifndef _PHP_CURL_H
 #define _PHP_CURL_H
@@ -58,16 +58,6 @@
CURL *cp;
zend_llist to_free;
 } php_curl;
-
-
-
-#ifdef ZTS
-#define CURLG(v) (curl_globals->v)
-#define CURLLS_FETCH() php_curl_globals *curl_globals = ts_resource(curl_globals_id)
-#else
-#define CURLG(v) (curl_globals.v)
-#define CURLLS_FETCH()
-#endif
 
 
 #else
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.34 php4/ext/curl/curl.c:1.35
--- php4/ext/curl/curl.c:1.34   Wed Jan  3 08:07:55 2001
+++ php4/ext/curl/curl.cFri Jan 12 02:49:38 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.34 2001/01/03 16:07:55 sniper Exp $ */
+/* $Id: curl.c,v 1.35 2001/01/12 10:49:38 sterling Exp $ */
 
 
 #include "php.h"
@@ -48,12 +48,6 @@
 #include "ext/standard/file.h"
 #include "php_curl.h"
 
-#ifdef ZTS
-int curl_globals_id;
-#else
-php_curl_globals curl_globals;
-#endif
-
 static int le_curl;
 
 static void _php_curl_close(zend_rsrc_list_entry *rsrc);
@@ -315,7 +309,7 @@
 
urlstr = estrndup(Z_STRVAL_PP(url), Z_STRLEN_PP(url));
curl_easy_setopt(curl_handle->cp, CURLOPT_URL, urlstr);
-   zend_llist_add_element(&curl_handle->to_free,&urlstr);
+   zend_llist_add_element(&curl_handle->to_free, &urlstr);
}
 
curl_easy_setopt(curl_handle->cp, CURLOPT_NOPROGRESS, 1);
@@ -383,7 +377,7 @@
copystr = estrndup(Z_STRVAL_PP(curl_value), 
Z_STRLEN_PP(curl_value));

ret = curl_easy_setopt(curl_handle->cp, option, 
copystr);
-   zend_llist_add_element(&curl_handle->to_free,©str);
+   zend_llist_add_element(&curl_handle->to_free, 
+©str);
}
break;




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




Re: [PHP] Problem with Exec()

2001-01-12 Thread Sterling Hughes

It should also be noted that the system interaction functions (namely,
passthru(), exec(), system() and popen()) are broken/incorrectly implemented,
actually, its windows that's incorrectly implemented, but be that as it may, the
functions do not work with windows).

To the original poster:

Use PHP's built-in mail() function instead, don't fork out to sendmail,
actually, better yet, use linux :-).

-Sterling

Richard Lynch wrote:
> 
> First, make sure that sendmail is something the iUSR_machinename can run --
> Just because you logged in as you can run it doesn't mean that the user that
> Apache/PHP is running as can run it.
> 
> Next, forget about that goofy DOS backslash thing.  Just use "/" for your
> paths.
> 
> Finally, add the optional arguments to exec()
> exec("d:/sendmail/sendmail.exe -t -messagefile=d:/sendmail/msg.txt",
> $results, $error);
> while (list(,$line) = each($results)){
> echo $line, "\n";
> }
> if ($error){
> echo "OS Error $error.  Usually path/permissions.\n":
> }
> 
> - Original Message -
> From: Jon Haworth <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Friday, January 12, 2001 10:13 AM
> Subject: [PHP] Problem with Exec()
> 
> > Hello list,
> >
> > I'm having a problem with Exec and Sendmail, on PHP-4 running under Apache
> > 1.3.14 on Windows NT.
> >
> > When I go to a DOS prompt and enter
> >
> > d:\sendmail\sendmail -t -messagefile=d:\sendmail\msg.txt
> >
> > it works fine. When I have any of the lines
> >
> > exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt");
> > exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt");
> > $foo = exec ("d:\sendmail\sendmail.exe -t
> > -messagefile=d:\sendmail\msg.txt");
> > $foo = exec ("d:\\sendmail\\sendmail.exe -t
> > -messagefile=d:\\sendmail\\msg.txt");
> >
> > all that happens is my PHP script times out. If I remove this line,
> > everything works fine. I'm sure I'm missing something simple but I'm
> *very*
> > tired. Any ideas?
> >
> >
> > Cheers
> > Jon
> >
> >
> >
> > --
> > 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] Guru Needed - the parser is corrupting my html!!

2001-01-13 Thread Sterling Hughes

As a note, you can also place:



And that will solve your problem...

-Sterling


Cynic wrote:
> 
> this is a bug in PHP (several reports in bug db). either ask
> your ISP to disable trans-sid in your virtual host, or do it
> yourself in .htaccess
> 
> At 15:52 13.1. 2001, Jamie Burns wrote the following:
> --
> >hey guys...
> >
> >my dumb isp has turned on ' --enable-trans-sid ' for all of the users on their 
>webserver without telling them.
> >
> >while i am sure this feature has some benefits, it is breaking my code, big time. 
>besides sticking the session value onto the end of every suspected server request, it 
>is corrupting my javascript code in strange ways! Look at these examples...
> >
> >
> >
> >SPOT THE DIFFERENCE!
> >
> >ORIGINAL CODE:
> >
> >   function MM_swapImgRestore() { //v3.0
> >   var i,x,a=document.MM_sr; for(i=0;a&&ix.src=x.oSrc;
> >   }
> >
> >   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> >
> >CORRUPTED CODE:
> >
> >   function MM_swapImgRestore() { //v3.0
> >   var i,x,a=document.MM_sr; for(i=0;a&&ix.src="x.oSrc;"
> >   }
> >
> >   var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array();
> >
> >
> >
> >see those speech marks around:
> >
> >)" x.src="x.oSrc;"   and   d="document;"
> >
> >they (and many more elsewhere in my code) are corrupting my javascript?!?!?!?!
> >
> >please help, this is a live system and my isp has forced my into an emergency 
>situation.
> >
> >can i turn off transparent sid's through a run time or configuration file (i cannot 
>recompile) ?
> >
> >anyone know how to stop this corruption?
> >
> >if it helps, i use the include() function to get and output the html template from 
>my code.
> >
> >jamie burns.
> --end of quote--
> 
> 
> Cynic:
> 
> A member of a group of ancient Greek philosophers who taught
> that virtue constitutes happiness and that self control is
> the essential part of virtue.
> 
> [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] Wondering whats wrong?

2001-01-13 Thread Sterling Hughes



Toby Butzon wrote:
> 
> This is a matter of figuring out why the variable isn't a
> valid file handle resource. To do so, find where it should
> be made such a resource (the line that says $fp =
> fsockopen...etc... is probably it), and add some error
> checking. I believe this function has its own way of
> returning what's wrong; check php.net/fsockopen and take a
> look at additional arguments... Then you must simply output
> the resulting error message (which is assumed to be
> resulting because the file handle is not being created).
> 
> --Toby
> 

That is good advice, but i don't think that's the poster's problem.

The problem is the following code:

fputs("$fp", "GROUP $groups[$i]\n");

You cannot stringify a resource (with PHP 4).  Therefore the offending code must
look like:

fputs($fp, "GROUP $groups[$i]\n");

In order to work...

-Sterling


> - Original Message -
> From: "K.Simon" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, January 13, 2001 11:07 AM
> Subject: [PHP] Wondering whats wrong?
> 
> Hello,
> running the following script (exec.php) on telnet account i
> get this error:
> Warning: Supplied argument is not a valid file handler
> resource in exec.php on line 21
> Can anybody tell me whats wrong with it? Normally it should
> fetch the newsgroups on my local news server and insert them
> into rows on a mysql database. This script is part of
> myPHPusenet-0.9.9.
> I hope the script was not too long.
> 
> THE SCRIPT:
> *
> 
> #!/usr/bin/php -q
> 
>  
> $start = gettimeofday();
> 
> include("conf.inc.php");
> include("newsgroups.inc.php");
> 
> @mysql_connect($hostname, $username, $password) OR DIE
> ("Could not connect");
> @mysql_select_db("$database") OR DIE ("Could not open
> database");
> 
> $i = 0;
> $j = 0;
> 
> while($i < sizeof($groups) ) {
> 
> $fp = fsockopen("$server", 119);
> set_socket_blocking($fp, true);
> $response = fgets($fp, 256);
> fputs("$fp", "GROUP $groups[$i]\n");
> $gruppe = fgets($fp, 1024);
> $range = split(" ", $gruppe);
> $range_start = $range[2];
> $range_end = $range[3];
> 
> $db_ng_name[$i] = ereg_replace("\.","_", $groups[$i]);
> 
> $query1 = "UPDATE last SET last.last = '$range_end' WHERE
> newsgroup = '$db_ng_name[$i]'";
> $query2 = "SELECT last FROM last WHERE (newsgroup LIKE
> '$db_ng_name[$i]')";
> $runit2 = MYSQL_QUERY($query2);
> $result = @MYSQL_RESULT($runit2,0,last);
> 
> IF (@MYSQL_NUMROWS($runit2) == 1) {
> 
> $range_start = $result;
> 
> while($range_start < $range_end) {
> 
> system("parse.php $server $groups[$i] $range_start");
> 
> $range_start++;
> $j++;
> 
> }
> 
> }
> 
> ELSE {
> PRINT "No new posts in $groups[$i]\n";
> }
> 
> $runit1 = MYSQL_QUERY($query1);
> 
> $i++;
> }
> 
> $tables = MYSQL_LIST_TABLES($database);
> $k = 0;
> 
> WHILE ($k < MYSQL_NUM_ROWS ($tables)) {
> $area_names[$k] = MYSQL_TABLENAME ($tables, $k);
> $query = "SELECT count(*) AS total_nr FROM $area_names[$k]";
> $q_string = @MYSQL_QUERY($query);
> $fundet = @MYSQL_RESULT($q_string,0,total_nr);
> 
> $total += $fundet;
> $k++;
> }
> 
> $date = date("d");
> $month = date("F");
> $shortmonth = date("M");
> $year = date("Y");
> $hour = date("H");
> $min = date("i");
> $sec = date("s");
> 
> $end =  gettimeofday();
> 
> $exec_time = number_format( (($end["sec"] +
> $end["usec"]/100) - ($start["sec"] +
> $start["usec"]/100)), 3);
> 
> $contents = "Hi!\n\nThe newsparser was run $date $month
> $year at $hour:$min:$sec, and it inserted $j posts in
> the\ndatabasen, there are now $total posts in the
> \n\nDatabase the update took $exec_time seconds.\n\n--
> \n\nYours Truly.\n\tmyPHP usenet";
> 
> mail("$email", "$subject", "$contents",
> "From:$USER@$HOSTNAME\nReply-To: [EMAIL PROTECTED]");
> 
> $fp = fopen($logname, "a") or die ("Could not open
> logfile");
> $logmess = "$shortmonth $date $hour:$min:$sec the newsparser
> inserted $j posts, there are now $total total\n";
> $write = fputs($fp, $logmess);
> fclose($fp);
> 
> ?>
> 
> --
> 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]




[PHP-CVS] cvs: php4 /ext/sablot php_sablot.h sablot.c

2001-01-16 Thread Sterling Hughes

sterlingTue Jan 16 04:02:47 2001 EDT

  Modified files:  
/php4/ext/sablotphp_sablot.h sablot.c 
  Log:
  @ Added the xslt_set_base function. (Sterling)
  
  Added the SABLOT_SET_ERROR() macro to set sablotron errors...
  
  
  
Index: php4/ext/sablot/php_sablot.h
diff -u php4/ext/sablot/php_sablot.h:1.11 php4/ext/sablot/php_sablot.h:1.12
--- php4/ext/sablot/php_sablot.h:1.11   Sat Jan  6 00:37:00 2001
+++ php4/ext/sablot/php_sablot.hTue Jan 16 04:02:47 2001
@@ -56,6 +56,7 @@
 #ifdef HAVE_SABLOT_SET_ENCODING
 PHP_FUNCTION(xslt_set_encoding);
 #endif
+PHP_FUNCTION(xslt_set_base);
 PHP_FUNCTION(xslt_fetch_result);
 PHP_FUNCTION(xslt_free);
 
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.28 php4/ext/sablot/sablot.c:1.29
--- php4/ext/sablot/sablot.c:1.28   Tue Jan  9 12:17:11 2001
+++ php4/ext/sablot/sablot.cTue Jan 16 04:02:47 2001
@@ -99,6 +99,15 @@
 
 #define SABLOT_BASIC_HANDLE SABLOTG(processor)
 
+#define SABLOT_SET_ERROR(handle, error)   \
+   if (error != 0) { \
+   if (handle) { \
+   handle->last_errno = error;   \
+   } \
+ \
+   SABLOTG(last_errno) = error;  \
+   }
+
 /**
  * SAX Handler structure, this defines the different functions to be
  * called when Sablotron's internal expat parser reaches the 
@@ -150,6 +159,7 @@
 PHP_FE(xslt_closelog, NULL)
 PHP_FE(xslt_set_sax_handler,  NULL)
 PHP_FE(xslt_set_error_handler,NULL)
+PHP_FE(xslt_set_base, NULL)
 #ifdef HAVE_SABLOT_SET_ENCODING
 PHP_FE(xslt_set_encoding, NULL)
 #endif
@@ -865,6 +875,50 @@
 
 #endif
 
+/* {{{ proto bool xslt_set_base(resource xh, string scheme, string base)
+   Overrides the default base for a resource.  If scheme is non-null, it only affects 
+the uri given by scheme */
+PHP_FUNCTION(xslt_set_base)
+{
+   zval   **xh, **scheme, **base;
+   php_sablot  *handle;
+   int  argc = ZEND_NUM_ARGS(),
+ret  = 0;
+   SABLOTLS_FETCH();
+
+   if (argc < 2 || argc > 3 ||
+   zend_get_parameters_ex(argc, &xh, &scheme, &base,) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
+   
+   if (argc > 2) {
+   ZEND_FETCH_RESOURCE(handle, php_sablot *, xh, -1, "PHP-Sablotron 
+handle", le_sablot);
+   
+   if (Z_TYPE_PP(scheme) != IS_STRING) {
+   ret = SablotSetBase(handle->p, Z_STRVAL_PP(base));
+   } else {
+   ret = SablotSetBaseForScheme((void *) handle->p,
+Z_STRVAL_PP(scheme),
+Z_STRVAL_PP(base));
+   }
+   } else {
+   if (Z_TYPE_PP(scheme) != IS_STRING) {
+   ret = SablotSetBase(SABLOTG(processor), Z_STRVAL_PP(base));
+   } else {
+   ret = SablotSetBaseForScheme((void *) SABLOTG(processor),
+Z_STRVAL_PP(scheme),
+Z_STRVAL_PP(base));
+   }
+   }
+   
+   SABLOT_SET_ERROR(handle, ret);
+   
+   if (ret != 0) {
+   RETURN_FALSE;
+   } else {
+   RETURN_TRUE;
+   }
+}
+/* }}} */
 
 /* }}} */
 



-- 
PHP CVS 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-CVS] cvs: php4 /ext/sablot sablot.c

2001-01-17 Thread Sterling Hughes

sterlingWed Jan 17 06:14:22 2001 EDT

  Modified files:  
/php4/ext/sablotsablot.c 
  Log:
  Fix (well it works) the error display with sablotron.
  
  
  
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.30 php4/ext/sablot/sablot.c:1.31
--- php4/ext/sablot/sablot.c:1.30   Wed Jan 17 03:43:17 2001
+++ php4/ext/sablot/sablot.cWed Jan 17 06:14:22 2001
@@ -1394,27 +1394,16 @@
 
 static void _php_sablot_standard_error(php_sablot_error *errors, php_sablot_error 
errors_start, int code, int level)
 {
-int len = 0,
-pos = 0;
 char *errstr = NULL;
 SABLOTLS_FETCH();
 
 errors = errors_start.next;
 while (errors) {
-len = pos + strlen(errors->key) + sizeof(": ") + strlen(errors->value) + 
sizeof("\n");
-
-/** 
- * Could be a problem, I just hate looping through strings
- * more than I have to ;-)
- */
-if (pos)
-errstr = erealloc(errstr, len);
-else
-errstr = emalloc(len+1);
-
-sprintf(errstr + pos, "%s: %s\n", errors->key, errors->value);
-
-pos = len;
+   if (strcmp(errors->key, "msg") == 0) {
+   errstr = estrdup(errors->value);
+   break;
+   }
+
 errors = errors->next;
 }
 
@@ -1427,6 +1416,8 @@
 php_error(E_WARNING, errstr);
 break;
 }
+
+efree(errstr);
 }
 
 /* }}} */



-- 
PHP CVS 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-CVS] cvs: php4 /pear/HTML Processor.php

2001-01-17 Thread Sterling Hughes

sterlingWed Jan 17 08:34:06 2001 EDT

  Added files: 
/php4/pear/HTML Processor.php 
  Log:
  @ Add the HTML_Processor class which provides common functions for processing HTML.
  @ (Sterling)
  
  
  

Index: php4/pear/HTML/Processor.php
+++ php4/pear/HTML/Processor.php
http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to  |
// | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
// +--+
// | Authors: Sterling Hughes <[EMAIL PROTECTED]>  |
// +--+
//
// $Id: Processor.php,v 1.1 2001/01/17 16:34:05 sterling Exp $
//
// HTML processing utility functions.
//

/**
 * TODO:
 *   -  Extend the XML_Parser module to provide HTML parsing abilities
 */

require_once('PEAR.php');

// {{{ HTML_Processor

$_HTML_Processor_translation_table = array();

/**
 * The HTML_Processor class facilitates the parsing and processing of
 * HTML.  Currently only some basic functionality to process HTML is 
 * provided..
 *
 * @access public
 * @author Sterling Hughes <[EMAIL PROTECTED]>
 * @since  PHP 4.0.5
 */
class HTML_Processor extends XML_Parser
{
// {{{ HTML_Processor()

function HTML_Processor()
{
global $_HTML_Processor_translation_table;
$_HTML_Processor_translation_table = get_html_translation_table();
}

// }}}
// {{{ ConvertSpecial()

/**
 * Convert special HTML characters (like ©) into their ASCII
 * equivalents.
 *
 * @param  string &$text The text to convert
 *
 * @access public
 * @author Sterling Hughes <[EMAIL PROTECTED]>
 * @since  PHP 4.0.5
 */
function ConvertSpecial(&$text)
{
global $_HTML_Processor_translation_table;

$text = strtr($text, 
  array_keys($_HTML_Processor_translation_table), 
  
array_flip(array_values($_HTML_Processor_translation_table)));
}

// }}}
// {{{ ConvertASCII()

/**
 * Convert ASCII characters into their HTML equivalents (ie, ' to 
 * ").
 *
 * @param  string &$text The text to convert
     *
     * @access public
 * @author Sterling Hughes <[EMAIL PROTECTED]>
 * @since  PHP 4.0.5
 */
function ConvertASCII(&$text)
{
global $_HTML_Processor_translation_table;

$text = strtr($text,
  
array_flip(array_values($_HTML_Processor_translation_table)), 
  array_keys($_HTML_Processor_translation_table));
}

// }}}
}

// }}}
?>


-- 
PHP CVS 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] xslt_run problems

2001-01-18 Thread Sterling Hughes


> 
> I am having an issue hopefully someone else has encountered already.  I
> have successfully compiled the latest expat(0.50) and sablot(1.95.1)
> libraries and configured and compiled php4 and apache1.3.14 to use the
> Sablotron Extensions.
> 
> I think anyway it was successful because it says "Sablotron XSLT
> support - enabled" in a phpinfo page.
> 
> When I try to actually do a transform though, I get this fatal error
> that is somewhat confusing:
> 
> Fatal error: msgtype: error in /usr/local/apache/htdocs/index.php on
> line 4
> 
> I have included the code that I am running, and have noticed that I
> only get an error when trying to do the transform.  In other words, the
> xslt_create() line works fine. (qs.xml and qs.xsl exist in the same
> directory as the index page)
> 
> CODE:
>  $parser = xslt_create();
> print "Parser Handle[$parser]";
> xslt_run($parser, './qs.xsl', './qs.xml');
> print "Here is the output:".xslt_fetch_result($parser);
> xslt_free($parser);
> ?>
> 
> OUPUT:
> Parser Handle[Resource id #1]
> Fatal error: msgtype: error in /usr/local/apache/htdocs/index.php on
> line 4
> 
> Any help is of course greatly appreciated.
> 

The basic error outputting in sablotron was broken, it means that something is
wrong with your XML or XSL file (syntax wise).  This has been fixed in CVS, you
can upgrade, or a work-around to see what exactly is wrong, is to simply go:


function xsl_error($parser, $code, $level, $errors)
{
echo "Parser: $parser\n\n";
echo "Code:   $code\n\n";
echo "Level:  $level\n\n";
echo "Errors: \n\n\n";
var_dump($errors);
}

// initialize parser here

xslt_set_error_handler($parser, "xsl_error");

// xslt_run here


-sterling

-- 
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-CVS] cvs: php4 /ext/sockets sockets.c

2001-01-18 Thread Sterling Hughes

sterlingThu Jan 18 12:49:13 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix the proto
  
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.28 php4/ext/sockets/sockets.c:1.29
--- php4/ext/sockets/sockets.c:1.28 Tue Jan 16 12:37:51 2001
+++ php4/ext/sockets/sockets.c  Thu Jan 18 12:49:12 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.28 2001/01/16 20:37:51 rasmus Exp $ */
+/* $Id: sockets.c,v 1.29 2001/01/18 20:49:12 sterling Exp $ */
 
 #include "php.h"
 
@@ -272,7 +272,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool fd_dealloc(void)
+/* {{{ proto bool fd_dealloc(int set)
De-allocates a file descriptor set */
 PHP_FUNCTION(fd_dealloc)
 {



-- 
PHP CVS 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] Clearing a variable

2001-01-18 Thread Sterling Hughes

> On Thu, 18 Jan 2001, Brandon Orther wrote:
>
> > Hello,
> >
> > How can I clear a variable?
> >
> > Thank you,
> >
> > 
> > Brandon Orther
> > WebIntellects Design/Development Manager
> > [EMAIL PROTECTED]
> > 800-994-6364
> > www.webintellects.com
> > 
> >
>
> unset($var);
>

Actually, just to clarify, that removes a variable from the symbol table.
to clear the contents of a variable, just set it to null:

$var = NULL;

// $var is now empty

-sterling


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

2001-01-19 Thread Sterling Hughes


> > In a message dated 19/01/2001 19:03:13 GMT Standard Time,
> > [EMAIL PROTECTED] writes:
> >
> > << Use a database for the words and say "SELECT 1 WHERE
LOWERCASE('$name')
> > LIKE
> >  '%'+word+'%'" and count how many rows are returned. No need to
re-invent the
> >  wheel.
> >
> >  --
> >  Ignacio Vazquez-Abrams >>
> >
> >
> > Yeah problem is he has no database support from his host
> >
> > Ade
> >
>
> Ouch. All is not lost, however:
>
> $words=Array(
>  "f***",
>  "s***",
>   ...
> ); // Or use file() to read them from a file.
>
>  ...
>
> $done=false;
> while ((list($key, $val)=each($words)) and $done===false)
> {
>   $done=strpos(strtolower($name), $val);
> };
> if ($done!==false)
> {
>   // Oops! Bad name.
> }
> else
> {
>   // Okay, valid name.
> };
>

all that code, well, geez.   why not store the words in a file, space
delimited, then:

if (preg_match("/" . implode(" ", file($prof_file)) . "/i", $text)) {
print("Naughty man");
} else {
print("Well, fuck, you're curse free!  Congrats...");
}

Or just store it in a string and omit the implode and file() function calls
(I'd prefer placing it in a file for easy addition of new curses)...


If you go with the other method (described by Ignacio), see the in_array()
function, which saves you the trouble of looping...

-Sterling


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

2001-01-19 Thread Sterling Hughes

> On Fri, 19 Jan 2001, DanO wrote:
>
> >
> > why use a DB?
> >
> > just create an array of dirty words then loop your input thru it with a
> > regex.
> >
> > DanO
> >
>
> Because a DB would probably be faster than creating an array and looping
> through it with a regex.
>

Not really, a db would be slower

the advantage to a db is ease of storage, ease of use and improved speed for
*larger* scale applications, for an application as simple as the poster is
describing, a db would be fine, but so would a text file.  I don't like
arrays, because then it requires a programmer to add dirty word...

-sterling


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

2001-01-19 Thread Sterling Hughes


> On Fri, 19 Jan 2001, Sterling Hughes wrote:
>
> > If you go with the other method (described by Ignacio), see the
in_array()
> > function, which saves you the trouble of looping...
> >
> > -Sterling
> >
>
> I thought about in_array(), but then I realized that the comparison has to
go
> the OTHER way :)
>

I'm saying use the same method, but use an array and avoid the strpos()
function:

$words = preg_split("//", $data);
foreach ($words as $word) {
if (in_array($prof, $words)) {
echo "BAD WORD";
echo "BAD WORD";
echo "I'M TELLING";
}
}

-Sterling


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

2001-01-19 Thread Sterling Hughes



> On Fri, 19 Jan 2001, Ignacio Vazquez-Abrams wrote:
>
> > On Fri, 19 Jan 2001, Sterling Hughes wrote:
> >
> > > I'm saying use the same method, but use an array and avoid the
strpos()
> > > function:
> > >
> > > $words = preg_split("//", $data);
> > > foreach ($words as $word) {
> > > if (in_array($prof, $words)) {
> > > echo "BAD WORD";
> > > echo "BAD WORD";
> > > echo "I'M TELLING";
> > > }
> > > }
> > >
> > > -Sterling
> > >
> >
> > That method suffers from the dictionary problem that Egan brought up.
> >
>
> Hey, wait a second...
>
> Does that code even make sense? I must be missing something...
>
> --

well if you have a concussion... :)

Its a whip up of what I was talking about, I didn't mean it as real code
:)...   Switch $words to $word and then swith the argument order to in_array
and yes, it makes sense...




Would be the somewhat sane version...

_Sterling


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

2001-01-19 Thread Sterling Hughes




> On Fri, 19 Jan 2001, Sterling Hughes wrote:
>
> > Its a whip up of what I was talking about, I didn't mean it as real code
> > :)...   Switch $words to $word and then swith the argument order to
in_array
> > and yes, it makes sense...
> >
> >  > $profanities = array("fuck", "shit");
> >
> > $words = preg_split("/\s+/", $data);
> > foreach ($words as $word) {
> > if (in_array($word, $profanities)) {
> > echo "you did a naughty thing";
> > break;
> > }
> > }
> > ?>
> >
> >
> > Would be the somewhat sane version...
> >
> > _Sterling
> >
>
> It still suffers from failing on "goodf***" and "eats***anddie" because of
> the lack of spaces. That's why I had to use strpos().
>

true it does take em away, that's why I suggest preg_match as the optimal
choice...  I happen to strongly dislike the strpos() function when used for
more than:

strpos($str, ":");

ie, one character searches...

-Sterling


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

2001-01-19 Thread Sterling Hughes




> On Fri, 19 Jan 2001, Sterling Hughes wrote:
>
> > Its a whip up of what I was talking about, I didn't mean it as real code
> > :)...   Switch $words to $word and then swith the argument order to
in_array
> > and yes, it makes sense...
> >
> >  > $profanities = array("fuck", "shit");
> >
> > $words = preg_split("/\s+/", $data);
> > foreach ($words as $word) {
> > if (in_array($word, $profanities)) {
> > echo "you did a naughty thing";
> > break;
> > }
> > }
> > ?>
> >
> >
> > Would be the somewhat sane version...
> >
> > _Sterling
> >
>
> It still suffers from failing on "goodf***" and "eats***anddie" because of
> the lack of spaces. That's why I had to use strpos().
>

true it does take em away, that's why I suggest preg_match as the optimal
choice...  I happen to strongly dislike the strpos() function when used for
more than:

strpos($str, ":");

ie, one character searches...

-Sterling


-- 
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-CVS] cvs: php4 /ext/sablot sablot.c

2001-01-20 Thread Sterling Hughes

sterlingSat Jan 20 15:42:03 2001 EDT

  Modified files:  
/php4/ext/sablotsablot.c 
  Log:
  Fix the scheme handler support and make it compile on win32 systems.
  
  
  
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.32 php4/ext/sablot/sablot.c:1.33
--- php4/ext/sablot/sablot.c:1.32   Fri Jan 19 03:44:12 2001
+++ php4/ext/sablot/sablot.cSat Jan 20 15:42:03 2001
@@ -1506,76 +1506,81 @@
 
 /* {{{ Sablotron Scheme Handler functions */
 
-static int _php_sablot_sh_getAll(void *userData, SablotHandle p, const char *scheme, 
const char *rest, char **buffer, int *byteCount) {
-   php_sablot *handle = (php_sablot *)userData;
+static int _php_sablot_sh_getAll(void *userData, SablotHandle p, const char *scheme, 
+const char *rest, char **buffer, int *byteCount) 
+{
+   php_sablot *handle = (php_sablot *) userData;
+   ELS_FETCH();
 
if (handle->getAllHandler) {
-   zval *retval;
-   zval *args[4];
-   char *mybuff;
-   int i;
-int argc;
-
-argc=4;
-   args[0] = _php_sablot_resource_zval(handle->index);
-   args[1] = _php_sablot_string_zval(scheme);
-   args[2] = _php_sablot_string_zval(rest);
-   args[3] = _php_sablot_string_zval("");
+   zval *retval,
+*argv[4];
+   int   idx,
+ argc = 4;
 
MAKE_STD_ZVAL(retval);
 
-   if (call_user_function(EG(function_table), NULL, handle->getAllHandler, 
retval, argc, args) == FAILURE) {
-   php_error(E_WARNING, "Sorry, couldn't call %s handler", "scheme 
getAll");
-   }
-
-   zval_dtor(retval);
-   efree(retval);
-
-/**
- * do not destroy xml data.
- */
-   *buffer=Z_STRVAL_P(args[3]);
-   *byteCount=Z_STRLEN_P(args[3]);
-/**
- * destroy zvals
- */
-   for (i=0; i<3; i++) {
-   zval_del_ref(&(args[i]));
-   }
+   argv[0] = _php_sablot_resource_zval(handle->index);
+   argv[1] = _php_sablot_string_zval(scheme);
+   argv[2] = _php_sablot_string_zval(rest);
+   argv[3] = _php_sablot_string_zval("");
+
+   if (call_user_function(EG(function_table),
+  NULL,
+  handle->getAllHandler,
+  retval,
+  argc,
+  argv) == FAILURE) {
+   php_error(E_WARNING, "Sorry couldn't call function, %s, with 
+handler of type %s",
+ handle->getAllHandler->value.str.val, "Scheme 
+GetALL");
+   }
+
+   zval_dtor(retval);
+   efree(retval);
+
+   *buffer= Z_STRVAL_P(argv[3]);
+   *byteCount = Z_STRLEN_P(argv[3]);
+
+   for (idx = 1; idx < 3; idx++) {
+   zval_del_ref(&(argv[idx]));
+   }
}
-};
 
-static int _php_sablot_sh_freeMemory(void *userData, SablotHandle p, char *buffer) {
-/**
- * here we should destroy the buffer containing the xml data
- * buffer to zval and zval-del_ref
- * we should destroy the zval not the pointer.
- */
-};
+
+   return(0);
+}
+
+static int _php_sablot_sh_freeMemory(void *userData, SablotHandle p, char *buffer) 
+{
+   /** Not implemented **/
+}
 
-static int _php_sablot_sh_open(void *userData, SablotHandle p, const char *scheme, 
const char *rest, int *handle) {
+static int _php_sablot_sh_open(void *userData, SablotHandle p, const char *scheme, 
+const char *rest, int *handle) 
+{
 /**
  * Not implemented
  */
-};
+}
 
-static int _php_sablot_sh_get(void *userData, SablotHandle p, int handle, char 
*buffer, int *byteCount) {
+static int _php_sablot_sh_get(void *userData, SablotHandle p, int handle, char 
+*buffer, int *byteCount)
+{
 /**
  * Not implemented
  */
-};
+}
 
-static int _php_sablot_sh_put(void *userData, SablotHandle p, int handle, const char 
*buffer, int *byteCount) {
+static int _php_sablot_sh_put(void *userData, SablotHandle p, int handle, const char 
+*buffer, int *byteCount)
+{
 /**
  * Not implemented
  */
-};
+}
 
-static int _php_sablot_sh_close(void *userData, SablotHandle p, int handle) {
+static int _php_sablot_sh_close(void *userData, SablotHandle p, int handle) 
+{
 /**
  * Not implemented
  */
-};
+}
 
 /* }}} */
 



-- 
PHP CVS 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] W98se, PWS 4.0, IE 5.5 php wird nicht interpretiert

2001-01-21 Thread Sterling Hughes

Hoi,
Das hier ist eine rein-deutschsprachige Liste.  Bitte schicke deutsche
Mails an die deutsche PHP liste (php-center.de).

Danke,
Sterling


Philipp Althaus wrote:
> 
> trotz viel Nachlesen und üben schaffe ich es nicht php zum Laufen zu bringen.
> Bin neu in der PHP-Welt.
> 
> ich möchte PHP ausprobieren und local installieren auf Notebook zum Testen.
> Leider wird der php-Code nicht interpretiert. Nachfolgend meine Daten:
> 
> Problem:  php-Code wird nicht interpretiert
> 
> 
> 
> Beispiel
> 
> 
> test 1
> 
> 
> 
> 
> es wird nur test 1 angezeigt
> 
> Windows 98 SE  mit  PWS 4.0  Explorer 5.5  ,  PWS funktioniert
> PWS-Basis-Verzeichnis : d:\windows\wwwroot
> 
> php-4.0.4-win32.zip gemäss Anleitung installiert
> d:\programme\php
> 
> php-4.0.4-installer.exe ausgeführt
> 
> php registriert:
> 
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
> ".php"="D:\Programme\php\sapi\php4isapi.dll"
> ".php3"="D:\Programme\php\sapi\php4isapi.dll"
> ".php4"="D:\Programme\php\sapi\php4isapi.dll"
> 
> HKEY_CLASSES_ROOT
> .phpphpfile
> .php3   "
> .php4   "
> 
> phpfile shell open command  : d:\programme\php\sapi\php4isapi.dll
> 
> Explorer  5.5 erkennt php-Files als PHP-Script
> 
> php.ini angepasst:
> 
> ;
> ; Paths and Directories ;
> ;
> include_path =   d:\windows\wwwroot
> doc_root = d:\windows\wwwroot
> user_dir = d:\programme\php
> extension_dir = d:\programme\php\extensions
> enable_dl  = On
> 
> [browscap]
> ;browscap = extra/browscap.ini
> browscap = d:\windows\system\inetsrv\browscap.ini
> 
> wer weiss was falsch ist ?
> 
> Danke für eine kurze Nachricht.
> 
> freundlich grüsst Philipp

-- 
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] W98se, PWS 4.0, IE 5.5 php wird nicht interpretiert

2001-01-21 Thread Sterling Hughes

[EMAIL PROTECTED] wrote:
> 
> On Sun, Jan 21, 2001 at 09:40:01PM +0100, Sterling Hughes wrote:
> > Hoi,
> >   Das hier ist eine rein-deutschsprachige Liste.  Bitte schicke deutsche
> > Mails an die deutsche PHP liste (php-center.de).
> 
> Hei Sterling, this is a English speaking list. I know in Südtirol our
> language is also recogniced. Have you seen too much snow?
> 

Typo, englishsprachige, duh!

Brain konfuse much :)

-Sterling

-- 
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] null or NULL

2001-01-22 Thread Sterling Hughes

Carsten Gehling wrote:
> 
> I don't get it. Is there any difference between null and NULL in PHP?
> 
> Couldn't find any reference to either in the manual, only in the errata?
> 

There is none.  Its case-insensitive afaik.

-Sterling

-- 
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-CVS] cvs: php4 /ext/curl curl.c

2001-03-02 Thread Sterling Hughes

sterlingFri Mar  2 17:06:55 2001 EDT

  Modified files:  
/php4/ext/curl  curl.c 
  Log:
  add a warn not available for curl_getinfo().
  remove unneccessary error checking.
  
  
  
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.38 php4/ext/curl/curl.c:1.39
--- php4/ext/curl/curl.c:1.38   Sun Feb 25 22:06:52 2001
+++ php4/ext/curl/curl.cFri Mar  2 17:06:55 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.38 2001/02/26 06:06:52 andi Exp $ */
+/* $Id: curl.c,v 1.39 2001/03/03 01:06:55 sterling Exp $ */
 
 
 #include "php.h"
@@ -97,6 +97,8 @@
PHP_FE(curl_exec, NULL)
 #if LIBCURL_VERSION_NUM >= 0x070401
PHP_FE(curl_getinfo,  NULL)
+#else
+   PHP_FALIAS(curl_getinfo, warn_not_available, NULL)
 #endif
PHP_FE(curl_error,NULL)
PHP_FE(curl_errno,NULL)
@@ -526,11 +528,7 @@
RETURN_FALSE;
}
 
-   commands = (struct curl_slist *)emalloc(sizeof(struct 
curl_slist));
-   if (!commands) {
-   php_error(E_WARNING, "Couldn't allocate 
command list from %s()", get_active_function_name());
-   RETURN_FALSE;
-   }
+   commands = (struct curl_slist *) emalloc(sizeof(struct 
+curl_slist));
memset(commands, 0, sizeof(struct curl_slist));

for (zend_hash_internal_pointer_reset(php_commands);
@@ -604,7 +602,7 @@
} else if (curl_handle->return_transfer &&
   curl_handle->output_file) {
 
-   ZEND_FETCH_RESOURCE(fp, FILE *, (zval **)NULL, 
curl_handle->output_file, "File-Handle", php_file_le_fopen());
+   ZEND_FETCH_RESOURCE(fp, FILE *, (zval **) NULL, 
+curl_handle->output_file, "File-Handle", php_file_le_fopen());
 
}

@@ -626,38 +624,38 @@
}

fseek(fp, 0, SEEK_SET);
-   
+
if (curl_handle->php_stdout) {

while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
php_write(buf, b);
}
-   
+
if (is_temp_file)
fclose(fp);
-   
+
} else {
-   
+
char *ret_data;
struct stat stat_sb;
-   
+
if (fstat(fileno(fp), &stat_sb)) {
RETURN_FALSE;
}

-   ret_data = emalloc(stat_sb.st_size+1);
-   
+   ret_data = (char *) emalloc(stat_sb.st_size + 1);
+
while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
memcpy(ret_data + pos, buf, b);
pos += b;
}
ret_data[stat_sb.st_size] = '\0';
-   
+
if (is_temp_file)
fclose(fp);
-   
+
RETURN_STRINGL(ret_data, stat_sb.st_size, 0);
-   
+
}
 
 }
@@ -688,37 +686,37 @@
 
curl_easy_getinfo(curl_handle->cp, CURLINFO_EFFECTIVE_URL, &url);
add_assoc_string(return_value, "url", url, 1);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_HTTP_CODE, &l_code);
add_assoc_long(return_value, "http_code", l_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_HEADER_SIZE, &l_code);
add_assoc_long(return_value, "header_size", l_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_REQUEST_SIZE, &l_code);
add_assoc_long(return_value, "request_size", l_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_TOTAL_TIME, &d_code);
add_assoc_double(return_value, "total_time", d_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_NAMELOOKUP_TIME, &d_code);
add_assoc_double(return_value, "namelookup_time", d_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_CONNECT_TIME, &d_code);
add_assoc_double(return_value, "connect_time", d_code);
-   
+
curl_easy_getinfo(curl_handle->cp, CURLINFO_PRETRANSFER_TIME, &d_code);
add_assoc_double(return_value, "pretransfer_time", d_code);
-   
+
curl_easy_ge

Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h

2001-03-03 Thread Sterling Hughes

Am I right that your removing this function?

uu, backwards compat??  ;-)

-Sterling


> zeev Sat Mar  3 17:17:22 2001 EDT
>
>   Modified files:
> /php4/ext/standard basic_functions.c basic_functions.h
>   Log:
>   this function will never return true...
>
>
> Index: php4/ext/standard/basic_functions.c
> diff -u php4/ext/standard/basic_functions.c:1.311
php4/ext/standard/basic_functions.c:1.312
> --- php4/ext/standard/basic_functions.c:1.311 Fri Mar  2 12:22:14 2001
> +++ php4/ext/standard/basic_functions.c Sat Mar  3 17:17:21 2001
> @@ -17,7 +17,7 @@
>
+--+
>   */
>
> -/* $Id: basic_functions.c,v 1.311 2001/03/02 20:22:14 andrei Exp $ */
> +/* $Id: basic_functions.c,v 1.312 2001/03/04 01:17:21 zeev Exp $ */
>
>  #include "php.h"
>  #include "php_main.h"
> @@ -368,7 +368,6 @@
>   PHP_FE(headers_sent, NULL)
>
>   PHP_FE(connection_aborted, NULL)
> - PHP_FE(connection_timeout, NULL)
>   PHP_FE(connection_status, NULL)
>   PHP_FE(ignore_user_abort, NULL)
>
> @@ -2148,16 +2147,6 @@
>   PLS_FETCH();
>
>  RETURN_LONG(PG(connection_status)&PHP_CONNECTION_ABORTED);
> -}
> -/* }}} */
> -
> -/* {{{ proto int connection_timeout(void)
> -   Returns true if script timed out */
> -PHP_FUNCTION(connection_timeout)
> -{
> - PLS_FETCH();
> -
> -RETURN_LONG(PG(connection_status)&PHP_CONNECTION_TIMEOUT);
>  }
>  /* }}} */
>
> Index: php4/ext/standard/basic_functions.h
> diff -u php4/ext/standard/basic_functions.h:1.74
php4/ext/standard/basic_functions.h:1.75
> --- php4/ext/standard/basic_functions.h:1.74 Sun Feb 25 22:07:16 2001
> +++ php4/ext/standard/basic_functions.h Sat Mar  3 17:17:21 2001
> @@ -17,7 +17,7 @@
>
+--+
>  */
>
> -/* $Id: basic_functions.h,v 1.74 2001/02/26 06:07:16 andi Exp $ */
> +/* $Id: basic_functions.h,v 1.75 2001/03/04 01:17:21 zeev Exp $ */
>
>  #ifndef BASIC_FUNCTIONS_H
>  #define BASIC_FUNCTIONS_H
> @@ -97,7 +97,6 @@
>  PHP_FUNCTION(print_r);
>
>  PHP_FUNCTION(connection_aborted);
> -PHP_FUNCTION(connection_timeout);
>  PHP_FUNCTION(connection_status);
>  PHP_FUNCTION(ignore_user_abort);
>
>
>
>
> --
> PHP CVS 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 CVS 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-CVS] cvs: php4 /ext/curl config.m4

2001-03-11 Thread Sterling Hughes

Why this?

-Sterling


> sniper Sat Mar 10 16:49:16 2001 EDT
>
>   Modified files:
> /php4/ext/curl config.m4
>   Log:
>   If AC_CHECK_LIB fails, assume that --with-openssl is needed
>
> Index: php4/ext/curl/config.m4
> diff -u php4/ext/curl/config.m4:1.3 php4/ext/curl/config.m4:1.4
> --- php4/ext/curl/config.m4:1.3 Mon Oct  2 10:35:57 2000
> +++ php4/ext/curl/config.m4 Sat Mar 10 16:49:16 2001
> @@ -1,4 +1,4 @@
> -dnl $Id: config.m4,v 1.3 2000/10/02 17:35:57 rasmus Exp $
> +dnl $Id: config.m4,v 1.4 2001/03/11 00:49:16 sniper Exp $
>  dnl config.m4 for extension CURL
>
>  PHP_ARG_WITH(curl, for CURL support,
> @@ -28,7 +28,12 @@
>PHP_SUBST(CURL_SHARED_LIBADD)
>AC_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD)
>
> -  AC_DEFINE(HAVE_CURL,1,[ ])
> +  AC_CHECK_LIB(curl,curl_easy_perform,
> +

> +AC_DEFINE(HAVE_CURL,1,[ ])
> +  ],[
> +AC_MSG_ERROR(Try adding --with-openssl[=DIR] into your configure
line.)
> +  ])
>
>PHP_EXTENSION(curl, $ext_shared)
>  fi
>
>
>
> --
> PHP CVS 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 CVS 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-CVS] cvs: php4 /ext/bz2 bz2.c php_bz2.h

2001-03-14 Thread Sterling Hughes

sterlingWed Mar 14 22:24:38 2001 EDT

  Modified files:  
/php4/ext/bz2   bz2.c php_bz2.h 
  Log:
  Bit of a cleanup, added some inline docs, decreased the amount of 
  memory used.
  
  
  

Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.8 php4/ext/bz2/bz2.c:1.9
--- php4/ext/bz2/bz2.c:1.8  Sun Feb 25 22:06:48 2001
+++ php4/ext/bz2/bz2.c  Wed Mar 14 22:24:38 2001
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: bz2.c,v 1.8 2001/02/26 06:06:48 andi Exp $ */
+/* $Id: bz2.c,v 1.9 2001/03/15 06:24:38 sterling Exp $ */
 
  
 #include "php.h"
@@ -28,12 +28,20 @@
 #include "ext/standard/file.h"
 #include "ext/standard/info.h"
 
-/* Std includes */
+/* for fileno() */
 #include 
 
 /* Bzip2 includes */
 #include 
 
+/* Internal error constants */
+#define PHP_BZ_ERRNO   0
+#define PHP_BZ_ERRSTR  1
+#define PHP_BZ_ERRBOTH 2
+
+/* Blocksize of the decompression buffer */
+#define PHP_BZ_DECOMPRESS_SIZE 4096
+
 function_entry bz2_functions[] = {
PHP_FE(bzopen,   NULL)
PHP_FE(bzread,   NULL)
@@ -53,8 +61,8 @@
bz2_functions,
PHP_MINIT(bz2),
NULL,
-   NULL,   
NULL,
+   NULL,
PHP_MINFO(bz2),
STANDARD_MODULE_PROPERTIES
 };
@@ -63,14 +71,16 @@
 ZEND_GET_MODULE(bz2)
 #endif
 
-static void   _php_bz2_close_handle(zend_rsrc_list_entry *rsrc);
-static void   _php_bz2_error_machine(INTERNAL_FUNCTION_PARAMETERS, int);
+static int  le_bz2;
 
-static int le_bz2;
+static void php_bz2_close(zend_rsrc_list_entry *);
+static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
 
 PHP_MINIT_FUNCTION(bz2)
 {
-   le_bz2 = zend_register_list_destructors_ex(_php_bz2_close_handle, NULL, 
"bzip2", module_number);
+   /* Register the resource, with destructor (arg 1) and text description (arg 
+3), the 
+  other arguments are just standard placeholders */
+   le_bz2 = zend_register_list_destructors_ex(php_bz2_close, NULL, "BZip2 File 
+Handle", module_number);
 
return SUCCESS;
 }
@@ -78,35 +88,35 @@
 PHP_MINFO_FUNCTION(bz2)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, "BZip2 support", "enabled");
-   php_info_print_table_row(2, "BZip2 Version", (char *)BZ2_bzlibVersion());
+   php_info_print_table_row(2, "BZip2 Support", "Enabled");
+   php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion());
php_info_print_table_end();
-
 }
 
 /* {{{ proto int bzopen(string|int file|fp, string mode)
Open a new BZip2 stream */
 PHP_FUNCTION(bzopen)
 {
-   zval **File,
-**Mode;
-   BZFILE *bz;
+   zval**file,   /* The file to open */
+   **mode;   /* The mode to open the stream with */
+   BZFILE   *bz; /* The compressed file stream */
+   FILE *fp; /* If filepointer is given, its placed in here */

if (ZEND_NUM_ARGS() != 2 ||
-   zend_get_parameters_ex(2, &File, &Mode) == FAILURE) {
+   zend_get_parameters_ex(2, &file, &mode) == FAILURE) {
WRONG_PARAM_COUNT;
}
-   convert_to_string_ex(Mode);
+   convert_to_string_ex(mode);

-   if (Z_TYPE_PP(File) != IS_RESOURCE) {
-   convert_to_string_ex(File);
-   
-   bz = BZ2_bzopen(Z_STRVAL_PP(File), Z_STRVAL_PP(Mode));
-   } else {
-   FILE *fp;
-   ZEND_FETCH_RESOURCE(fp, FILE *, File, -1, "File-Handle", 
php_file_le_fopen());
-   
-   bz = BZ2_bzdopen(fileno(fp), Z_STRVAL_PP(Mode));
+   /* If it's not a resource its a string containing the filename to open */
+   if (Z_TYPE_PP(file) != IS_RESOURCE) {
+   convert_to_string_ex(file);
+   bz = BZ2_bzopen(Z_STRVAL_PP(file), Z_STRVAL_PP(mode));
+   } 
+   /* If it is a resource, than its a 'FILE *' resource */
+   else {
+   ZEND_FETCH_RESOURCE(fp, FILE *, file, -1, "File Handle", 
+php_file_le_fopen());
+   bz = BZ2_bzdopen(fileno(fp), Z_STRVAL_PP(mode));
}

ZEND_REGISTER_RESOURCE(return_value, bz, le_bz2);
@@ -117,30 +127,35 @@
Read len bytes from the BZip2 stream given by bz */
 PHP_FUNCTION(bzread)
 {
-   zval **Bz,
-**Len;
-   BZFILE *bz;
-   void *buf = NULL;
-   int ret,
-   len  = 1024,
-   argc = ZEND_NUM_ARGS();
-   
+   zval  **bzp,   /* BZip2 Resource Pointer */
+ **zlen;  /* The (optional) length to read */
+   BZFILE *bz;/* BZip2 File pointer */
+   void   *buf;   /* Buffer to read data into */
+   int 

[PHP-CVS] cvs: php4 /ext/bz2 bz2.c

2001-03-14 Thread Sterling Hughes

sterlingWed Mar 14 23:03:28 2001 EDT

  Modified files:  
/php4/ext/bz2   bz2.c 
  Log:
  remove a little insanity.
  
  
  
Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.9 php4/ext/bz2/bz2.c:1.10
--- php4/ext/bz2/bz2.c:1.9  Wed Mar 14 22:24:38 2001
+++ php4/ext/bz2/bz2.c  Wed Mar 14 23:03:28 2001
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: bz2.c,v 1.9 2001/03/15 06:24:38 sterling Exp $ */
+/* $Id: bz2.c,v 1.10 2001/03/15 07:03:28 sterling Exp $ */
 
  
 #include "php.h"
@@ -80,7 +80,7 @@
 {
/* Register the resource, with destructor (arg 1) and text description (arg 
3), the 
   other arguments are just standard placeholders */
-   le_bz2 = zend_register_list_destructors_ex(php_bz2_close, NULL, "BZip2 File 
Handle", module_number);
+   le_bz2 = zend_register_list_destructors_ex(php_bz2_close, NULL, "BZip2", 
+module_number);
 
return SUCCESS;
 }



-- 
PHP CVS 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-CVS] cvs: php4 /ext/bz2 bz2.c

2001-03-15 Thread Sterling Hughes

sterlingThu Mar 15 20:23:58 2001 EDT

  Modified files:  
/php4/ext/bz2   bz2.c 
  Log:
  Slightly modified fix from jeremy brand <[EMAIL PROTECTED]>.  he 
  correctly pointed out that allocating the buffer to a little more than
  need (exact formula is in the code) will save the need to keep retrying
  the compression.
  
  
  
Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.11 php4/ext/bz2/bz2.c:1.12
--- php4/ext/bz2/bz2.c:1.11 Thu Mar 15 17:21:24 2001
+++ php4/ext/bz2/bz2.c  Thu Mar 15 20:23:58 2001
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: bz2.c,v 1.11 2001/03/16 01:21:24 sniper Exp $ */
+/* $Id: bz2.c,v 1.12 2001/03/16 04:23:58 sterling Exp $ */
 
  
 #include "php.h"
@@ -276,9 +276,11 @@
convert_to_string_ex(source);

/* Assign them to easy to use variables, dest_len is initially the length of 
the data
-  because, the compression buffer should be smaller than the size of the data 
passed */
+  + .01 x length of data + 600 which is the largest size the results of the 
+compression 
+  could possibly be, at least that's what the libbz2 docs say (thanks to 
[EMAIL PROTECTED] 
+  for pointing this out).  */
source_len = Z_STRLEN_PP(source);
-   dest_len   = Z_STRLEN_PP(source);
+   dest_len   = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600;

/* Allocate the destination buffer */
dest = emalloc(dest_len + 1);
@@ -293,20 +295,8 @@
convert_to_long_ex(zwork_factor);
work_factor = Z_LVAL_PP(zwork_factor);
}
-   
-   /* Compression loop */
-   do {
-   /* Handle the (re)allocation of the buffer */
-   size = dest_len * iter;
-   if (iter > 1) {
-   dest = erealloc(dest, size);
-   }
-   iter++;
-   
-   /* Try and perform the compression */
-   error = BZ2_bzBuffToBuffCompress(dest, &size, Z_STRVAL_PP(source), 
source_len, block_size, 0, work_factor);
-   } while (error == BZ_OUTBUFF_FULL);
-   
+
+   error = BZ2_bzBuffToBuffCompress(dest, &size, Z_STRVAL_PP(source), source_len, 
+block_size, 0, work_factor);
if (error != BZ_OK) {
RETVAL_LONG(error);
} else {



-- 
PHP CVS 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-CVS] cvs: php4 /ext/bz2 bz2.c

2001-03-19 Thread Sterling Hughes

sterlingMon Mar 19 10:59:24 2001 EDT

  Modified files:  
/php4/ext/bz2   bz2.c 
  Log:
  Whitespace fix...
  
  
  
Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.12 php4/ext/bz2/bz2.c:1.13
--- php4/ext/bz2/bz2.c:1.12 Thu Mar 15 20:23:58 2001
+++ php4/ext/bz2/bz2.c  Mon Mar 19 10:59:23 2001
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: bz2.c,v 1.12 2001/03/16 04:23:58 sterling Exp $ */
+/* $Id: bz2.c,v 1.13 2001/03/19 18:59:23 sterling Exp $ */
 
  
 #include "php.h"
@@ -185,7 +185,9 @@
convert_to_long_ex(zlen);
len = Z_LVAL_PP(zlen);
}
-   else { len = Z_STRLEN_PP(data); }
+   else { 
+   len = Z_STRLEN_PP(data); 
+   }

/* Write the data and return the error */
error = BZ2_bzwrite(bz, (void *) Z_STRVAL_PP(data), len);



-- 
PHP CVS 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-CVS] cvs: php4 /ext/midgard config.m4

2001-03-19 Thread Sterling Hughes

On Mon, 19 Mar 2001, Jani Taskinen wrote:

> On Mon, 19 Mar 2001, Alexander Bokovoy wrote:
> 
> >On Mon, Mar 19, 2001 at 01:19:06PM -0600, Andrei Zmievski wrote:
> >> On Mon, 19 Mar 2001, Alexander Bokovoy wrote:
> >> > This fix does not work because @MIDCONFIG_FILE@ in php_midgard.h does
> >> > not substituted by PHP_OUTPUT using template file php_midgard.h.in.
> >> > Either fix building environment in PHP4 which does not allow output
> >> > variable's value through template header file for extensions or revert
> >> > change back. That change was tested before commit.
> >>
> >> Well, it wasn't tested well enough. I am against reverting it, because
> >> it completely breaks the build.
> >Andrei, problem is that build environment needs to be fixed, not module alone.
> >This is really serious problem because it prevents people from using Midgard
> >extension with, say, PHP 4.0.4pl1 (latest stable PHP4 version) though
> >they could do it (there are no dependencies on PHP 4.0.5 in Midgard extension).
> >
> 
> Uh. This comes back to the fact that this extension shouldn't even be in
> PHP CVS. Where's that PEAR thing? :)
> 

I don't think it belongs in PEAR at all.  I could see the logic behind
distributing it with PHP, but don't see any reason to distribute it in
pear...

-Sterling


-- 
PHP CVS 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-CVS] cvs: php4 /ext/midgard config.m4

2001-03-19 Thread Sterling Hughes

On Mon, 19 Mar 2001, Colin Viebrock wrote:

> > I don't think it belongs in PEAR at all.  I could see the logic behind
> > distributing it with PHP, but don't see any reason to distribute it in
> > pear...
> 
> 
> Except that isn't this what PEAR was for all along?  A collection of classes
> and add-on modules to extend PHP's functionality?
>

Yes.  But the midgard extension doesn't really do that, it provides some
propreitary functions and classes for use by Midgard only.  The reason its
being distributed as an extension is --

a) It helps the Midguard users to have the extension distributed with PHP
(not too sure on why this is so).
b) No one likes reversing commits :)))

> I don't have anything against the Midguard folks personally, but isn't
> distributing Midguard with the main PHP distribution implicitly saying PHP
> supports/prefers the Midguard content management system over any other
> similar system?  What happens when someone else wants *their* system to be
> part of the main PHP distribution?  What criteria are we basing these
> decisions on?
> 

Plus it contributes bloat and doesn't make sense.

> There is also the license issue (which I know has been discussed before).
> But the first thing I read on the Midguard website is:
> 
> Midgard will always implement an OS development to publishing
> solution, future releases will include APIs for implementing
> commercial applications.
> 
> Are we going to run into trouble down the road when this happens (and end up
> having to take Midguard out of PHP anyway)?
> 
> [There is also the fact that Midguard accepts donations and collects
> membership fees ... how is that going to change if Midguard is part of the
> main PHP distribution?]
> 

Don't quite see the problem here, can you spell it out for me :)))?

> And as for Alexander's comment:
> 
> Shouldn't that means that almost all extensions from ext/
> directory could be classified as PEAR thing?
> 
> My opinion is that yes they *could* be classified that way, but it doesn't
> make a lot of sense.  PHP users don't have a choice of which module they
> want to use for Blowfish encryption, for example ... so mcrypt is part of
> the standard distribution.  Perhaps the PDF modules should be, since we have
> several.  I don't know.
> 
> But, to me at least, Midguard seems to be code that is a "layer above" what
> I would feel belongs in the main PHP distribution.  In the same way the DB
> abstraction class is (even the C version of it) ... and that they both
> belong in PEAR.
> 

Well, I think a db abstraction layer could and should be distributed.  But
that's off topic.  

The midguard code, imho, belongs distributed with midguard, not in pear
(where it doesn't fit)  or as an extension... 

> Just my 2 cents (and given without intent to offend).
> 

Same for me.

-Sterling



-- 
PHP CVS 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-CVS] cvs: php4 /ext/curl curl.c

2001-03-19 Thread Sterling Hughes

sterlingMon Mar 19 17:46:41 2001 EDT

  Modified files:  
/php4/ext/curl  curl.c 
  Log:
  Remove some unnecessary error checking
  
  
  
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.39 php4/ext/curl/curl.c:1.40
--- php4/ext/curl/curl.c:1.39   Fri Mar  2 17:06:55 2001
+++ php4/ext/curl/curl.cMon Mar 19 17:46:41 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.39 2001/03/03 01:06:55 sterling Exp $ */
+/* $Id: curl.c,v 1.40 2001/03/20 01:46:41 sterling Exp $ */
 
 
 #include "php.h"
@@ -291,10 +291,6 @@
}

curl_handle = (php_curl *)emalloc(sizeof(php_curl));
-   if (!curl_handle) {
-   php_error(E_WARNING, "Couldn't allocate a CURL Handle");
-   RETURN_FALSE;
-   }
memset(curl_handle, 0, sizeof(php_curl));
 
zend_llist_init(&curl_handle->to_free, sizeof(char *), (void(*)(void 
*))curl_free_string, 0);
@@ -440,10 +436,6 @@
val_str = estrndup(Z_STRVAL_PP(current), 
Z_STRLEN_PP(current));

str = emalloc(strlen(string_key) + 
strlen(val_str) + 1 + 2);
-   if (!str) {
-   php_error(E_WARNING, "Couldn't 
allocate a post field from %s()", get_active_function_name());
-   RETURN_FALSE;
-   }
sprintf(str, "%s=%s", string_key, val_str);
 
ret = curl_formparse(str, &first, &last);



-- 
PHP CVS 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-CVS] cvs: php4 /ext/curl curl.c

2001-03-20 Thread Sterling Hughes

sterlingTue Mar 20 13:30:43 2001 EDT

  Modified files:  
/php4/ext/curl  curl.c 
  Log:
  remove some unneccessary casts, remove unneccessary error casts, standardize
  the coding format for some of the stuff.
  
  
  

Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.40 php4/ext/curl/curl.c:1.41
--- php4/ext/curl/curl.c:1.40   Mon Mar 19 17:46:41 2001
+++ php4/ext/curl/curl.cTue Mar 20 13:30:42 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.40 2001/03/20 01:46:41 sterling Exp $ */
+/* $Id: curl.c,v 1.41 2001/03/20 21:30:42 sterling Exp $ */
 
 
 #include "php.h"
@@ -67,20 +67,20 @@
Initialize WSA stuff on Win32 systems */
 static CURLcode win32_init()
 {
-   WORD wVersionRequested;  
-   WSADATA wsaData; 
-   int err; 
-   wVersionRequested = MAKEWORD(1, 1); 
-
-   err = WSAStartup(wVersionRequested, &wsaData); 
-
-   if (err != 0) return CURLE_FAILED_INIT;
-
-   if (LOBYTE(wsaData.wVersion) != 1 || 
-   HIBYTE(wsaData.wVersion) != 1) { 
-   WSACleanup(); 
-   return CURLE_FAILED_INIT; 
+   WSADATA wsa_data;
+   WORDrequested_version = MAKEWORD(1, 1);
+   int error;
+   
+   error = WSAStartup(requested_version, wsa_data);
+   if (error != 0) {
+   return CURLE_FAILED_INIT;
+   }
+   
+   if (LOBYTE(wsa_data.wVersion) != 1 || HIBYTE(wsa_data.wVersion) != 1) {
+   WSACleanup();
+   return CURLE_FAILED_INIT;
}
+   
return CURLE_OK;
 }
 /* }}} */
@@ -124,7 +124,7 @@
 PHP_MINFO_FUNCTION(curl)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, "CURL support", "enabled");
+   php_info_print_table_row(2, "CURL support","enabled");
php_info_print_table_row(2, "CURL Information", curl_version());
php_info_print_table_end();
 }
@@ -205,52 +205,52 @@
 #endif
 
/* Error Constants */
-   REGISTER_LONG_CONSTANT("CURLE_OK", (int)CURLE_OK, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_UNSUPPORTED_PROTOCOL", 
(int)CURLE_UNSUPPORTED_PROTOCOL, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FAILED_INIT", (int)CURLE_FAILED_INIT, CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT", (int)CURLE_URL_MALFORMAT, 
CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT_USER", 
(int)CURLE_URL_MALFORMAT_USER, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_PROXY", 
(int)CURLE_COULDNT_RESOLVE_PROXY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_HOST", 
(int)CURLE_COULDNT_RESOLVE_HOST, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_COULDNT_CONNECT", (int)CURLE_COULDNT_CONNECT, 
CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_SERVER_REPLY", 
(int)CURLE_FTP_WEIRD_SERVER_REPLY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_ACCESS_DENIED", 
(int)CURLE_FTP_ACCESS_DENIED, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_USER_PASSWORD_INCORRECT", 
(int)CURLE_FTP_USER_PASSWORD_INCORRECT, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASS_REPLY", 
(int)CURLE_FTP_WEIRD_PASS_REPLY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_USER_REPLY", 
(int)CURLE_FTP_WEIRD_USER_REPLY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASV_REPLY", 
(int)CURLE_FTP_WEIRD_PASV_REPLY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_227_FORMAT", 
(int)CURLE_FTP_WEIRD_227_FORMAT, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_GET_HOST", 
(int)CURLE_FTP_CANT_GET_HOST, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_RECONNECT", 
(int)CURLE_FTP_CANT_RECONNECT, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_SET_BINARY", 
(int)CURLE_FTP_COULDNT_SET_BINARY, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_PARTIAL_FILE", (int)CURLE_PARTIAL_FILE, CONST_CS 
| CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_RETR_FILE", 
(int)CURLE_FTP_COULDNT_RETR_FILE, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_WRITE_ERROR", (int)CURLE_FTP_WRITE_ERROR, 
CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT("CURLE_FTP_QUOTE_ERROR", (int)CURLE_FTP_QUOTE_ERROR, 
CONST_CS | CONST_PERSISTE

Re: [PHP-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-16 Thread Sterling Hughes

On Tue, 17 Apr 2001, Dan Kalowsky wrote:

> kalowsky  Mon Apr 16 19:02:36 2001 EDT
>
>   Modified files:
> /php4/ext/odbcphp_odbc.c
>   Log:
>   This change seems to fix bugs 7158, 7807, 8531, and 8636.  After asking why this 
>patch was applied no one seemed to respond with anything useful.  If you find this 
>change in error, sorry, I tested it on as many systems as I could.
>
>
>
> Index: php4/ext/odbc/php_odbc.c
> diff -u php4/ext/odbc/php_odbc.c:1.77 php4/ext/odbc/php_odbc.c:1.78
> --- php4/ext/odbc/php_odbc.c:1.77 Tue Apr 10 09:26:27 2001
> +++ php4/ext/odbc/php_odbc.c  Mon Apr 16 19:02:36 2001
> @@ -19,7 +19,7 @@
> +--+
>   */
>
> -/* $Id: php_odbc.c,v 1.77 2001/04/10 16:26:27 kevin Exp $ */
> +/* $Id: php_odbc.c,v 1.78 2001/04/17 02:02:36 kalowsky Exp $ */
>
>  #include "php.h"
>  #include "php_globals.h"
> @@ -2435,11 +2435,7 @@
>
>   ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", 
>le_conn, le_pconn);
>
> -#ifndef HAVE_DBMAKER
> - if ((*pv_onoff)) {
> -#else
>   if (pv_onoff && (*pv_onoff)) {
> -#endif
>   convert_to_long_ex(pv_onoff);
>   rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT,
>    
>((*pv_onoff)->value.lval) ?
>

This should be breaking something, no?

Either way an "if" statement is started therefore it needs to be finished.

-Sterling


-- 
PHP CVS 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-CVS] cvs: php4 /ext/odbc php_odbc.c

2001-04-17 Thread Sterling Hughes

On Tue, 17 Apr 2001, Jani Taskinen wrote:

> On Mon, 16 Apr 2001, Sterling Hughes wrote:
>
> >>
> >> -#ifndef HAVE_DBMAKER
> >> -  if ((*pv_onoff)) {
> >> -#else
> >>if (pv_onoff && (*pv_onoff)) {
> >> -#endif
> >>convert_to_long_ex(pv_onoff);
> >>rc = SQLSetConnectOption(conn->hdbc, SQL_AUTOCOMMIT,
> >> 
>((*pv_onoff)->value.lval) ?
> >>
> >
> >This should be breaking something, no?
> >
> >Either way an "if" statement is started therefore it needs to be finished.
> >
>
> Maybe you should get thicker glasses? :)
>
> #ifndef <-- see this ? :-p
>

Maybe *you* need glasses :)

#ifndef HAVE_DBMAKER
if ((*pv_onoff)) {
#else
if (pv_onoff && (*pv_onoff)) {
#else

Either way an "if" block is started but not finished.

As Dan pointed out, it looks as if the diff got truncated.

-Sterling


-- 
PHP CVS 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-CVS] cvs: php4 /ext/sablot sablot.c

2001-04-19 Thread Sterling Hughes

sterlingThu Apr 19 07:59:34 2001 EDT

  Modified files:  
/php4/ext/sablotsablot.c 
  Log:
  fix crash bug 10400.
  
  
  
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.37 php4/ext/sablot/sablot.c:1.38
--- php4/ext/sablot/sablot.c:1.37   Sat Mar  3 17:09:36 2001
+++ php4/ext/sablot/sablot.cThu Apr 19 07:59:33 2001
@@ -70,7 +70,7 @@
 /* Macro's */
 
 /* Free macros */
-#define S_FREE(__var) if (__var) efree(__var);
+#define S_FREE(__var) if (__var) { efree(__var); __var = NULL; }
 #define FUNCH_FREE(__var) if (__var) zval_ptr_dtor(&(__var));
 
 /* ERROR Macros */
@@ -208,9 +208,10 @@
 
 static void php_sablot_init_globals(SABLOTLS_D)
 {
-   SABLOTG(processor)= NULL;
-   SABLOTG(errors)   = NULL;
-   SABLOTG(errorHandler) = NULL;
+   SABLOTG(processor) = NULL;
+   SABLOTG(errors)= NULL;
+   SABLOTG(errorHandler)  = NULL;
+   SABLOTG(output_transform_file) = NULL;
 }
 
 



-- 
PHP CVS 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-CVS] cvs: php4 /ext/ccvs ccvs.c

2001-04-22 Thread Sterling Hughes

sterlingSun Apr 22 16:40:34 2001 EDT

  Modified files:  
/php4/ext/ccvs  ccvs.c 
  Log:
  Fix bug #10447.
  
  
  
  
Index: php4/ext/ccvs/ccvs.c
diff -u php4/ext/ccvs/ccvs.c:1.13 php4/ext/ccvs/ccvs.c:1.14
--- php4/ext/ccvs/ccvs.c:1.13   Sun Feb 25 22:06:48 2001
+++ php4/ext/ccvs/ccvs.cSun Apr 22 16:40:34 2001
@@ -17,7 +17,7 @@
+--+
  */
 /*
-*  cvvs.c $Revision: 1.13 $ - PHP4 Interface to the RedHat CCVS API
+*  cvvs.c $Revision: 1.14 $ - PHP4 Interface to the RedHat CCVS API
 *   ---
 *   Interfaces RedHat's CCVS [Credit Card Verification System] 
<http://www.redhat.com/products/ccvs/>
 *   This code is ported from an original php3 interface written by RedHat's Doug 
DeJulio <[EMAIL PROTECTED]>
@@ -27,10 +27,10 @@
 
 /*
 *  Code started on [EMAIL PROTECTED] by Brendan W. McAdams <[EMAIL PROTECTED]>
-*  $Revision: 1.13 $
+*  $Revision: 1.14 $
 */
 
-static char const cvsid[] = "$Id: ccvs.c,v 1.13 2001/02/26 06:06:48 andi Exp $";
+static char const cvsid[] = "$Id: ccvs.c,v 1.14 2001/04/22 23:40:34 sterling Exp $";
 
 #include 
 #include 
@@ -193,6 +193,11 @@
   }
 
   convert_to_string_ex(psess);
+  if (!Z_STRVAL_PP(psess)) {
+php_error(E_WARNING, "Invalid session to ccvs_new()");
+RETURN_FALSE;
+  }
+
   sess = hks_ptr_stringtoptr((*psess)->value.str.val);
 
   convert_to_string_ex(pinvoice);



-- 
PHP CVS 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-CVS] cvs: php4 /ext/curl curl.c

2001-04-24 Thread Sterling Hughes

sterlingTue Apr 24 15:10:41 2001 EDT

  Modified files:  
/php4/ext/curl  curl.c 
  Log:
  Fixed a crash bug.
  
  Return the proper amount.
  
  
  
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.41 php4/ext/curl/curl.c:1.42
--- php4/ext/curl/curl.c:1.41   Tue Mar 20 13:30:42 2001
+++ php4/ext/curl/curl.cTue Apr 24 15:10:41 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.41 2001/03/20 21:30:42 sterling Exp $ */
+/* $Id: curl.c,v 1.42 2001/04/24 22:10:41 sterling Exp $ */
 
 
 #include "php.h"
@@ -483,9 +483,6 @@
RETURN_FALSE;
}

-   header = emalloc(sizeof(struct curl_slist));
-   memset(header, 0, sizeof(struct curl_slist));
-   
for (zend_hash_internal_pointer_reset(headers);
 zend_hash_get_current_data(headers, (void 
**)¤t) == SUCCESS;
 zend_hash_move_forward(headers)) {
@@ -520,9 +517,6 @@
RETURN_FALSE;
}
 
-   commands = (struct curl_slist *) emalloc(sizeof(struct 
curl_slist));
-   memset(commands, 0, sizeof(struct curl_slist));
-   
for (zend_hash_internal_pointer_reset(php_commands);
 zend_hash_get_current_data(php_commands, (void 
**)¤t) == SUCCESS;
 zend_hash_move_forward(php_commands)) {
@@ -646,7 +640,7 @@
if (is_temp_file)
fclose(fp);
 
-   RETURN_STRINGL(ret_data, stat_sb.st_size, 0);
+   RETURN_STRINGL(ret_data, stat_sb.st_size + 1, 0);
 
}
 



-- 
PHP CVS 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] Fwd: curl questionnaire!

2002-01-09 Thread Sterling Hughes

For those of you who use the cURL extension, the underlying library
is putting up a little questionaire, to help get a better idea of
what the cURL user community wants, feel free to go ahead and
participate, the URL (without reading the attachment :) is:

http://curl.haxx.se/q/

-Sterling


--- Begin Message ---

Hello fellow curl users!

I'd like to ask you all who read this to skip over to the curl web site and
fill in the questionnaire regarding various aspects of curl.

I want to know what we all think of curl, what the general people think is
important, what's bad, what's good and where to put the most focus in the
immediate future development.

There are ten quickly answered questions that'll only take you a few minutes
to fill in.

Give me your view of things on this URL:

http://curl.haxx.se/q/

I appreciate if you fill in your opinion only once for each individual.

-- 
Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/






--- End Message ---

-- 
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] Using include() and URL's

2002-01-17 Thread Sterling Hughes

> In regards to 1, neither of them are. they're just examples I was testing.
> 
> As for your second note, it need only include the page, it needs only to 
> display the page. It works fine with local references, just not with URL's.
>
You can't use URL includes on the windows systems, only unix.

-Sterling

> At 06:33 AM 1/18/02 +0200, you wrote:
> >A couple of comments:
> >1. Your include() statement specifies a different file than your error
> >message - which one is right?
> >2. From what I recall (but I'm not positive), using a protocol type at the
> >beginning of the location ("http://";) means that your server will actually
> >use that (i.e. parse it -- it'll include whatever you see when you're using
> >a browser on the respective location) rather than include the source file.
> >Is that wht you want?
> >
> >Just my 2c.
> >
> >Bogdan
> >
> >Hippie wrote:
> >
> >> I have a simple command similar to this.
> >>
> >> include ("http://www.cci.net.au/default.htm";);
> >>
> >> When it parses the php file it is contained in though I get the
> >> following response.
> >>
> >> Warning: Failed opening 'http://flurry.cci.net.au/template/index.php'
> >> for inclusion (include_path='') in
> >> C:\Inetpub\wwwroot\template\index.php on line 61
> >>
> >> I checked that I hard url_fopen_wrappers enabled within the php.ini
> >> file which it was and other than that have been unable to deduce why
> >> this isn't working.
> >>
> >> Any comments would be much appreciated.
> >>
> >> Hippie.
> >>
> >> --
> >> 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]
> 

-- 
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] Porting from Linux to Windows!?$#

2002-01-27 Thread Sterling Hughes

> Hi all,
> 
> I would like to ask my experienced friends here if its possible to port a
> script made for linux to run in windows IIS. I've been trying to make linux
> scripts run on my server and some of them do and some don't. I also notice
> that the problem relies how Linux and Windows refer to firectories.
> 
> Linux Ex.
> $base_dir = "/home/somescript/"
> 
> Windows Ex.
> $base_dir = "C:\home\somescript"
> 
> Now. My question is... Is there any way to use script made for Linux in
> Windows? If YES what have to be done in order to make it to work?
> 
> Thank you,
> Andre
> 
>
Well, that depends on the script greatly.  Both Win32 and Linux have
difference sets of functions, and features.  Issues such as relative
path's are easy enough to solve, however, it would greatly depend on
what other features the piece of code use.

In most cases, it is possible to port a script from Win32 to
Linux, and vice-versa, with a few hours of hair-pulling and a little
    bit of luck...  But then again, this question depends on the
application.

-Sterling


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

-- 
I wish I may, I wish I might, GIMME STUFF! 
http://www.amazon.com/exec/obidos/wishlist/E7I1IWUJDPB4/
:)))

-- 
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: Sending an e-mail to 1,000 people

2002-02-02 Thread Sterling Hughes

On Sat, 2002-02-02 at 17:42, Manuel Lemos wrote:
> Hello,
> 
> Lars Wilhelmsen wrote:
> > 
> > "Ben Clumeck" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I would like to send an e-mail (the same e-mail) to 1,000 different
> > people.
> > > I want each persons name to be in the "To:" field.  Is there a way to
> > > customize it to where it can say Dear (having a different persons name
> > > corresponding to an e-mail address) so that it looks customized.
> > >
> > > Thanks,
> > >
> > > Ben
> > >
> > 
> > What you are describing is called SPAMMING, something
> > we really, really dislike.
> 
> You are confused. Spamming is sending the same message to the same
> person more than once.
> 
> What I think you mean is unsolicited e-mail. The original poster did not
> mention whether the people he wants to mail want to receive his
> messages, so you can't assume that is necessarily unsolicited.
> 

I think you are confused...  Unsolicited e-mail is in fact the
definition of spam!

Secondly, reasonable assumptions can often be made, for example, when I
see a message from you, its almost guaranteed that you'll be plugging
PHPClasses, or Metabase, or both.  Assumptions are why killfiles were
invented.

>From the users original post, the likely assumption is that he is using
it to send out some sort of spam/product announcement.

-Sterling

-- 
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] telnet or ssh in PHP (Curl?)

2001-12-17 Thread Sterling Hughes

> 
> Hi Bas!
> 
> SSH is possible but complicated.
>
Not really, just create a tunnel...

-Sterling

-- 
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-CVS] cvs: php4 / EXTENSIONS

2001-03-21 Thread Sterling Hughes

sterlingWed Mar 21 11:46:13 2001 EDT

  Modified files:  
/php4   EXTENSIONS 
  Log:
  Remove experimental status from bz2
  
  
  
Index: php4/EXTENSIONS
diff -u php4/EXTENSIONS:1.15 php4/EXTENSIONS:1.16
--- php4/EXTENSIONS:1.15Fri Jan 19 08:12:36 2001
+++ php4/EXTENSIONS Wed Mar 21 11:46:05 2001
@@ -174,7 +174,7 @@
 EXTENSION:   bz2
 PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
 MAINTENANCE: Maintained
-STATUS:  Experimental
+STATUS:  Working
 SINCE:   4.0.3
 ---
 EXTENSION:   calendar
@@ -375,7 +375,7 @@
 EXTENSION:   swf
 PRIMARY MAINTAINER:  Sterling Hughes <[EMAIL PROTECTED]>
 MAINTENANCE: Maintained
-STATUS:  Unknown
+STATUS:  Depreciated (Use the ming swf extension instead)
 COMMENT: Only for Unix (won't change)
 ---
 EXTENSION:   sysvsem



-- 
PHP CVS 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-CVS] cvs: php4 /ext/bz2 EXPERIMENTAL

2001-03-21 Thread Sterling Hughes

sterlingWed Mar 21 11:47:05 2001 EDT

  Removed files:   
/php4/ext/bz2   EXPERIMENTAL 
  Log:
  Remove experimental status from bz2 (as of 4.0.6)
  
  
  



-- 
PHP CVS 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-CVS] cvs: php4 /ext/dbx dbx.c dbx_mysql.c dbx_mysql.hdbx_odbc.c dbx_odbc.h php_dbx.h

2001-03-22 Thread Sterling Hughes

On Thu, 22 Mar 2001, Marc Boeren wrote:

> mboeren   Thu Mar 22 07:14:35 2001 EDT
> 
>   Modified files:  
> /php4/ext/dbx dbx.c dbx_mysql.c dbx_odbc.c dbx_mysql.h dbx_odbc.h 
>   php_dbx.h 
>   Log:
>   Changed C++ style comments to C-style comments (Marc)
>   #I hope I got 'em all
>   @Changed C++ style comments to C-style comments (Marc)
>   

This shouldn't be a news entry.

NEWS entries are only for things that are relevant to end users, such as
the addition of a new function, or a changed behaviour, or the fixing of
an important bug/crash.

-Sterling   


-- 
PHP CVS 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-CVS] cvs: php4 / FUNCTION_LIST.txt

2001-03-26 Thread Sterling Hughes

sterlingMon Mar 26 10:29:13 2001 EDT

  Removed files:   
/php4   FUNCTION_LIST.txt 
  Log:
  Remove FUNCTION_LIST.txt, the file is sadly out of date and not really used...
  
  
  



-- 
PHP CVS 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-CVS] cvs: php4 /ext/fdf fdf.c

2001-04-06 Thread Sterling Hughes

On Sat, 7 Apr 2001, Jani Taskinen wrote:

> sniperFri Apr  6 19:48:20 2001 EDT
>
>   Modified files:
> /php4/ext/fdf fdf.c
>   Log:
>   fixed protos
>


Yikes, it seems like you moved the grammar backwards...

>From what I remember of english, the active voice is the correct voice for
you to use in this case.


-Sterling


-- 
PHP CVS 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-CVS] cvs: php4 /ext/fdf fdf.c

2001-04-06 Thread Sterling Hughes

On Sat, 7 Apr 2001, Jani Taskinen wrote:

> On Fri, 6 Apr 2001, Sterling Hughes wrote:
>
> >On Sat, 7 Apr 2001, Jani Taskinen wrote:
> >
> >> sniper Fri Apr  6 19:48:20 2001 EDT
> >>
> >>   Modified files:
> >> /php4/ext/fdf  fdf.c
> >>   Log:
> >>   fixed protos
> >>
> >
> >
> >Yikes, it seems like you moved the grammar backwards...
> >
> >>From what I remember of english, the active voice is the correct voice for
> >you to use in this case.
>
> Egon told me that they should be like that.. :)
> And those are only comments so what's the big deal anyway?
>

Well, the comments result in function lists and summaries that many people
use (genfunclist genfuncsummary). Also the book PHP: Pocket reference
uses these folding comments to generate the function definitions...

-Sterling


-- 
PHP CVS 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-CVS] cvs: php4 /ext/standard dir.c

2001-04-09 Thread Sterling Hughes

On Mon, 9 Apr 2001, Sean Bright wrote:

> elixerMon Apr  9 13:56:49 2001 EDT
>
>   Modified files:
> /php4/ext/standarddir.c
>   Log:
>   Stop SIGSEGV on Apache startup.  Patch from <[EMAIL PROTECTED]>
>

Should be CONST_CS|CONST_PERSISTENT no?

>
> Index: php4/ext/standard/dir.c
> diff -u php4/ext/standard/dir.c:1.59 php4/ext/standard/dir.c:1.60
> --- php4/ext/standard/dir.c:1.59  Sun Apr  8 14:57:13 2001
> +++ php4/ext/standard/dir.c   Mon Apr  9 13:56:49 2001
> @@ -17,7 +17,7 @@
> +--+
>   */
>
> -/* $Id: dir.c,v 1.59 2001/04/08 21:57:13 ssb Exp $ */
> +/* $Id: dir.c,v 1.60 2001/04/09 20:56:49 elixer Exp $ */
>
>  /* {{{ includes/startup/misc */
>
> @@ -141,7 +141,7 @@
>  #endif
>  tmpstr[0] = DEFAULT_SLASH;
>  tmpstr[1] = '\0';
> -REGISTER_STRING_CONSTANT("DIRECTORY_SEPARATOR", tmpstr, 0);
> +REGISTER_STRING_CONSTANT("DIRECTORY_SEPARATOR", tmpstr, CONST_PERSISTENT);
>
>   return SUCCESS;
>  }
>
>
>
>

-- 
Alavilla mailla hallanvaara


-- 
PHP CVS 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] accessing files not in www root directory.

2001-06-30 Thread Sterling Anderson

Hi,
I am trying to write a page that will perform a select on a DB and get the 
path and file name of an image. Then display the image.
The DB part if fine but I am having difficulty figuring out how to get the 
images to display. For example:

result from select:
$file_path = "/home/pics/friends/"
$file_name = "bob.jpg"

Now, say my web root directory is "/etc/http/wwwroot"

How do I create a link to my file "/home/pics/friends/bob.jpg"?
I tried symlink() but the link created appears to hang around after it is no 
longer needed.

By the way, this is a Linux server running Apache.

Any ideas?

Thanks,

Sterling Anderson
[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] accessing files not in www root directory.

2001-06-30 Thread Sterling Anderson

Hi,
I am trying to write a page that will perform a select on a DB and get the
path and file name of an image. Then display the image.
The DB part if fine but I am having difficulty figuring out how to get the
images to display. For example:

result from select:
$file_path = "/home/pics/friends/"
$file_name = "bob.jpg"

Now, say my web root directory is "/etc/http/wwwroot"

How do I create a link to my file "/home/pics/friends/bob.jpg"?
I tried symlink() but the link created appears to hang around after it is no
longer needed.

By the way, this is a Linux server running Apache.

Any ideas?

Thanks,

Sterling Anderson
[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] PHP is cool by me.

2001-07-17 Thread Sterling Hanenkamp

Just thought I'd send in my testimonial. I run a web site for a 
relatively small business (4 employees including the President ;). 
Anyway, I had been using JSP and Servlets to manage our smallish web 
site, but in preparation for graduation and moving on to another job, we 
need a web site that can be managed by my boss and coworkers who know 
nothing of Java.

Thus, I endeavored to find a solution that would be more stable (the 
servlet engine was unstable from time to time, though it is highly 
reputed as stable). Anyway, I chose PHP over everything else because of 
it's resemblance to Perl and my boss' familiarity with Perl. Within 
hours I was able to port the entire site from JSP to PHP with all the 
previous functionality.  (It took me much longer to design the original 
site in JSP.) Within hours I was able to add even more functionality to 
make it easier for them to maintain.

This is not meant in any way to detract from JSP, just that PHP happens 
to make JSP look rather inept in this particular case--especially since 
PHP had built-in a lot of stuff that I had to build myself in Java code. 
PHP does for web programming what Perl does for script programming. It 
makes what should be easy, easy and yet still manages to make the hard 
stuff easier or, at least, no harder.

Excellent product. My appreciation goes to the authors and anyone else 
who had a hand in this product. I have met few IT products that actually 
stand up to my expectations after I have put hours and days of effort 
into them--this one has done just that.

Thanks,
Sterling


-- 
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] Teen Hobos having sex? ..no.. but MAYBE

2001-07-30 Thread Sterling Hanenkamp

Matt's Script Archive was just updated a couple days ago and includes a 
fix similar to mine--I just discovered.

Thanks,
Sterling

Andrew Sterling Hanenkamp wrote:

> Actually, if you use telnet you can write your own headers and say 
> you've been refered by whoever you want to say you were refered by and 
> then use the script anyway, because you'll just say you came from 
> someplace where they have a form. This script is very bad. I submitted 
> an update to the archive which adds an additional constraint to it by 
> allowing users to only send to certain domains or only certain 
> addresses, but I never received word back so I had assumed that the site 
> was not very actively maintained.
> 
> Any script you write that allows a user to sendmail should ALWAYS CHECK 
> THE RECIPIENT to make sure it's not just anyone. I've quit using that 
> script in favor of my PHP script that just translates keys given in the 
> form into real addresses so that the formmail doesn't even really get 
> the ability to send to just anyone.
> 
> Sterling
> 
> PS - If you or anyone else is interested in the script, I can send it to 
> them. (If I get a lot of requests I just post it on my web site since 
> Matt's Script Archive never posted my update.)
> 
> Thomas Deliduka wrote:
> 
>> This is a classic case of someone not having formmail.pl from Matt's 
>> Script
>> archive locked down.
>>
>> I found it very interesting that while Matt's Script Archive is setup to
>> block you from using someone else's form as a referer to yours to prevent
>> the use of your script from another server, he simply allows you 
>> through if
>> you have no referer at all. And that's how someone used our server 
>> several
>> times about 6 months ago. If you format a perfect querystring and 
>> simply hit
>> enter on the browser, you can successfully send many people e-mail 
>> through
>> formmail.pl if it's not modified to block 'no referer' references.
>>
>> On 7/26/2001 8:29 PM this was written:
>>
>>
>>> Below is the result of your feedback form.  It was submitted by
>>> ([EMAIL PROTECTED]) on Thursday, July 26, 2001 at 20:29:47
>>> --- 
>>>
>>>
>>> : Join for free Today.
>>> Free Memberships. No Credit Cards Needed.
>>> HUGE Celebrity selection from Jennifer Lopez to Britney Spears.
>>> Also Specializing Streaming Video, Live sex shows for every desire!
>>> This isn't one of those crummy scams where you have touse a credit card!
>>> Take a look and you'll see.
>>> http://coverme1.devil.ru";>Enter Here
>>>
>>>
>>> 
>>>
>>> You recived this email because you subscribed to a mailing list. If 
>>> you would
>>> like to be removed from this mailing list please >> href="mailto:[EMAIL PROTECTED]";>Click Here!
>>>
>>> --- 
>>>
>>>
>>>
>>> -- 
>>> 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] socket error

2001-09-07 Thread Sterling Hughes

On Sat, 8 Sep 2001, sagar wrote:

> line10 -> if (($sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
> echo "socket() failed: reason: " . strerror($sock) . "\n";
> }
>
> i'm getting an error saying
> Fatal error: Call to undefined function: socket() in c:\program files\apache 
>group\apache\htdocs\test\sock.php on line 10
>
>
> can any one help
>

The socket functions have been renamed as of php4.0.7

Use socket_open() instead...

-Sterling


-- 
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] randomly picking a variable from an array

2001-09-07 Thread Sterling Hughes

On Fri, 7 Sep 2001, King, Justin wrote:

> The easiest way I can think of would be to get a random number based on
> the size of an array.  If you're querying your database and filling an
> array with all images, just use the database's random routine instead.
> (I.E. "SELECT quote,author from randomQuote ORDER by RAND() LIMIT 1" in
> mysql)
>
> If this isn't the case, something like this should work..
>
>   srand(time());
>   $random=rand(0,sizeof($myVar)-1);
>
> Hope I could be of some help...
>

array_rand() will also do this for you...

-Sterling

> --Justin King, School District of Superior Web Coordinator
> (www.superior.k12.wi.us)
>
>
> -Original Message-
> From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 07, 2001 2:08 PM
> To: PHP (E-mail)
> Subject: [PHP] randomly picking a variable from an array
>
> How do you randomly picking a variable from an array with PHP?
>
> Thanks,
>
> Joseph
>
>
>
>
> PS. Thanks to those who helped me with GD. If you go to my site, you'll
> see
> the new counter I created at the top of the page.
>
> http://www.collegesucks.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] socket error

2001-09-07 Thread Sterling Hughes

On Sat, 8 Sep 2001, sagar wrote:

> thanX sterling,
>
> i've changed it to socket_open()  but the problem
> still exists.
>

Sorry, meant socket_create() -- for a list of the new names, open up
php4/ext/sockets/sockets.c and take a look at the function entry.

-Sterling

> /sagar
>
> - Original Message -
> From: Sterling Hughes <[EMAIL PROTECTED]>
> To: sagar <[EMAIL PROTECTED]>
> Cc: php <[EMAIL PROTECTED]>
> Sent: Saturday, September 08, 2001 1:54 AM
> Subject: Re: [PHP] socket error
>
>
> > On Sat, 8 Sep 2001, sagar wrote:
> >
> > > line10 -> if (($sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
> > > echo "socket() failed: reason: " . strerror($sock) .
> "\n";
> > > }
> > >
> > > i'm getting an error saying
> > > Fatal error: Call to undefined function: socket() in c:\program
> files\apache group\apache\htdocs\test\sock.php on line 10
> > >
> > >
> > > can any one help
> > >
> >
> > The socket functions have been renamed as of php4.0.7
> >
> > Use socket_open() instead...
> >
> > -Sterling
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.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] file management

2001-09-07 Thread Sterling Hughes

On Fri, 7 Sep 2001, Gerard Samuel wrote:

> Can a file be truncated from the beginning, and by x amount of lines??
> Thanks
>
Truncated from the beginning?  Do you mean truncate the file by X
lines, starting from the first position in the file, well, yeah:



Please note the above is devoid of error checking :)

-Sterling


-- 
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] Cybercash compiling as shared module

2001-09-07 Thread Sterling Hughes

On Fri, 7 Sep 2001, Michael Kimsal wrote:

> I'm trying this specifically with the cybercash module.  When I just do
> ./configure --with-cybercash=/path/to/mck, it works (well, it gets thru
> configure
> and make anyway).
>
> ./configure --with-cybercash=/path/to/mck,shared and
> ./configure --with-cybercash=shared,/path/to/mck
>
> both don't work.  Is Cybercash not something that can be compiled as a
> shared object?
>

No, I got this working in PHP 4.0.2 (scary that I remembered this
off the top of my head).

-Sterling


-- 
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: Regular Expressions - A relatively simple search...

2001-09-09 Thread Sterling Hughes

On Mon, 10 Sep 2001, Mike Gifford wrote:

> Thanks robin, this is very useful!
>
yep, although pathinfo() is much easier:

$extension = pathinfo($userfile_name, PATHINFO_EXTENSION);

-Sterling

> Robin Vickery wrote:
> > [EMAIL PROTECTED] (Mike Gifford) writes:
> >
> >
> >>Hello,
> >>
> >>I'm trying to replace a couple of lines of code:
> >>
> >>$dotpos = 1 - (strlen($userfile_name) - strpos($userfile_name, '.'));
> >>$extension = substr($userfile_name, $dotpos);
> >>
> >>with a simpler regular expression:
> >>$extension = eregi_replace( "/.*", "", $userfile_name);
> >>
> >>However it isn't working..
> >>
> >>What I'd like to do is to find the extension of a file name and place
> >>that in a variable.  So in '/home/mike/test.txt', I want to have the
> >>statement return 'txt'
> >>
> >
> > you don't need a regular expression for that...
> >
> > $extension = strrchr(basename($userfile_name), '.');
> >
> >   -robin
> >
>
>
>
>


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




Re: [PHP] cURL support

2001-09-10 Thread Sterling Hughes

On Tue, 11 Sep 2001, Daniel Baldoni wrote:

> G'day Jason
>
> >> On the hosting provider, HTTPS connections don't work.  But,
> >> I'm told the command-line version of curl does work.
> >
> > That'd probably be because they didn't install the HTTPS-able
> > version of cURL. Check out curl.haxx.se for more info.
>
> No, testing shows that their cURL binary does work just fine with HTTPS URIs.
> Thinking I'd gone crazy (which, admittedly, would be a short trip), I ran
> tests here using various PHP versions.  All the PHPs were built with the
> same configure options and curl was only built once.
>
> And... I noticed the same behaviour with v4.0.6 as the hosting company has
> seen on their boxes.  That is, 4.0.6 doesn't like the curl library installed
> on my local machine - but 4.0.4p1 and 4.0.5 work just fine.  Curious.
>
Some people have reported problems with cURL and PHP v4.0.6
(regarding SSL, although I haven't seen them, and some people don't have problems).
Upgrade to a recent snapshot (or latest CVS) of cURL and everything
should be fine...

-Sterling


-- 
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: WELCOME to php-general@lists.php.net

2001-09-13 Thread Sterling Hughes

On Thu, 13 Sep 2001 [EMAIL PROTECTED] wrote:

> I'm not entirely positive but not sure if you can use the domain name in the
> include.. in other words try:
>   include("home.htm");
> ?>
>
> And you obviously cant include pages from other servers..
>

1) yes, you can include pages from other servers
2) the error means that the domain name you are including from
doesn't resolve to an ip address (more accurately an addrinfo
structure).

-Sterling

> - Original Message -
> From: "Andreas Sartori" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 13, 2001 11:08 PM
> Subject: [PHP] Re: WELCOME to [EMAIL PROTECTED]
>
>
> > i have a small problem.
> >
> >  >
> > include("http://www.sbg.ac.at/home.htm";);
> >
> > ?>
> >
> >
> > Warning: php_network_getaddresses: getaddrinfo failed: Name does not
> resolv
> > to supplied parameters; neither nodename nor servname were passed. in
> > /usr/INFO/web-docs/test.php on line 3
> >
> > Warning: Failed opening 'http://www.sbg.ac.at/home.htm' for inclusion
> >
> (include_path='.:/php/includes:/usr/INFO/web-docs/unineu/search:/usr/INFO/we
> b-docs/unineu/classes')
> > in /usr/INFO/web-docs/test.php on line 3
> >
> >
> >
> > when using:
> >
> >  >
> > fopen("http://www.sbg.ac.at/home.htm";, "r");
> >
> > ?>
> >
> > Warning: php_network_getaddresses: getaddrinfo failed: Name does not
> resolv
> > to supplied parameters; neither nodename nor servname were passed. in
> > /usr/INFO/web-docs/test.php on line 3
> >
> > Warning: fopen("http://www.sbg.ac.at/home.htm","r";) - Bad file number in
> > /usr/INFO/web-docs/test.php on line 3
> >
> >
> > please help me :)
> >
> >
> >
> >
> >
> >
> > --
> --
> >   andreas sartori
> hellbrunnerstrasse 34
> >   Datenbankadministration & unix support 5020 salzburg,
> austria
> >   zid - universitaet salzburgtel: +43 (662)
> > 8044-6731
> >   http://www.sbg.ac.at/zid/people/sartori/sartori.htmfax: +43 (662)
> 629842
> > --
> --
> > --
> --
>
>
>


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

2001-09-13 Thread Sterling Hughes

On Fri, 14 Sep 2001 [EMAIL PROTECTED] wrote:

> ereg_replace or str_replace perhaps?
>
> eg
>
> $something= "this is a sentence";
>
> $something =  ereg_replace (" ","+", $something);
>
> print $something;
>

That'll work, although str_replace is faster and better...

fyi, if you want to encode a string for a URL, use the urlencode()
function.

-Sterling

> -Original Message-
> From: Egon Schmid [mailto:[EMAIL PROTECTED]]
> Sent: September 14, 2001 2:20 PM
> To: Alexander Skwar
> Cc: murat; [EMAIL PROTECTED]
> Subject: Re: [PHP] posted urls
>
>
> Alexander Skwar wrote:
> >
> > So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
> > > how can i change variables that has two or more words to variables that
> > >  has "+" instead of blanks in that variables.
> > > Like this: "word1 word2 word3"  => "word1+word2+word3"
> >
> > $word1 . $word2 . $word3
> >
> > Read the manual!
>
> Alexander, please don't try to educate people with a RTFM. Your solution
> to the above problem is obviously wrong.
>
> -Egon
>
>


--
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: Why doesn't this work?

2001-09-15 Thread Sterling Hughes

On Sat, 15 Sep 2001, CC Zona wrote:

> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Ray Van Dolson) wrote:
>
> > I'm trying to do:
> >
> > print split("=",$testString)[0];
>
> Curly braces often seem to help in situations like these.  Untried, but
> maybe this will do the trick for you:
>
> print {split("=",$testString)}[0];
>
>
This won't work.  Reason: PHP isn't Perl.

-Sterling




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