php-general Digest 28 Aug 2002 05:31:26 -0000 Issue 1551

Topics (messages 114270 through 114326):

Re: User Authentication Script
        114270 by: Vail, Warren

file reading
        114271 by: phper
        114272 by: Philip Hallstrom
        114273 by: Brad Dameron

Newbie,module or CGI and server question
        114274 by: Ryan A
        114292 by: Richard Lynch

exif_thumbnail() problems
        114275 by: hrd
        114293 by: Richard Lynch

php_flag not valid?
        114276 by: Steve Fox
        114277 by: Rasmus Lerdorf
        114278 by: Steve Fox

Are sessions affected by Unix user changes?
        114279 by: K Soares
        114294 by: Richard Lynch
        114319 by: Jason Wong

Just learning . . . HTML Form & PHP
        114280 by: April Lougheed
        114296 by: Richard Lynch
        114320 by: Jason Wong

'#' character breaking the URL string
        114281 by: Joseph Szobody
        114295 by: Richard Lynch
        114301 by: Joseph Szobody

GD 1.8.4
        114282 by: Zach Curtis
        114283 by: Rasmus Lerdorf
        114300 by: Zach Curtis

Re: sending email to a mailing list
        114284 by: Manuel Lemos
        114311 by: Justin French

filter records... how?
        114285 by: Matt Zur
        114297 by: Richard Lynch

Please helpme !! files problems..
        114286 by: Sebastian Tomasino
        114298 by: Richard Lynch

Re: array_push
        114287 by: Richard Lynch

Re: problem with using include files
        114288 by: Richard Lynch

Re: getting directory info
        114289 by: Richard Lynch

Re: PHPSESSID appended to URL on initial page load
        114290 by: Richard Lynch

Re: pattern matching urls
        114291 by: Richard Lynch

bulk mail
        114299 by: Pupeno
        114308 by: Justin French

php indenter
        114302 by: Gui Guy

People's Opinion
        114303 by: Christopher J. Crane
        114317 by: Bogdan Stancescu

time stamp
        114304 by: Steve Buehler

PHP with Sql Server
        114305 by: Skyhawk
        114312 by: Jerome Houston

Host
        114306 by: Bruce Karstedt
        114307 by: Christopher J. Crane
        114309 by: Liam MacKenzie
        114310 by: Justin French
        114313 by: Liam MacKenzie

Re: Command Line
        114314 by: Trevor Tregoweth
        114315 by: Gerald R. Jensen
        114316 by: Adam Williams

Re: Senior Developer, Washington DC Area
        114318 by: Alok K. Dhir

foreach fails on unitialized array?
        114321 by: Jean-Christian Imbeault
        114324 by: Michael Sims

Follow-up question about Digest Authentication in PHP
        114322 by: Seairth Jacobs

Curl request works on command line but not in script
        114323 by: Joshua Alexander

Apostrophe in preg_match?
        114325 by: Andre Dubuc

Strange Problem......
        114326 by: karthikeyan

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Sounds like you've identified your problem.  I have never installed a module
but you can check out http://www.apache.org/ for some help installing
modules on the Apache server.  I believe it involves compiling the server,
for Windows platforms I believe you need Visual C++ 6.0.

If that is to technically demanding you can checkout several pre-packaged
distributions of Apache, PHP, MySQL, Perl and the like, looking for one
where PHP is installed as a Mod (don't personally know of any).  For a
fairly complete list of packages check out;

http://www.hotscripts.com/PHP/Software_and_Servers/Installation_Kits/

Sooner, or later, you will probably reach a point where it will become more
expedient for you to write your own authentication, which is what most
application developers do.  This has the advantage of allowing you to set up
your application security independent of your server or database security.

hope this helps,

Warren Vail
Tools, Metrics & Quality Processes

-----Original Message-----
From: Anthony Ritter [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 26, 2002 8:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP: User Authentication Script


In my
phpinfo()

I get:
php version 4.0.0

Server_API................CGI
..............................................

Is this why it is not working?

If so, how does one install PHP as a "module"?

Please advise.
Thank you.

TR
...................................

Warren Vail wrote in message:

> http://www.php.net/manual/en/features.http-auth.php also mentions that
http
> auth does not work when running php as a CGI, which may also give these
> symptoms.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
how do I read the contents of a file.

$FileStream = fopen("webmaster/forum".$Forum."/forumtopics.txt", "w+");
  $line = fgetss ($FileStream, 255);
  print ("number is: ".$line." <br> ");

  fclose($FileStream);

  always returns nothing


--- End Message ---
--- Begin Message ---
You want "r" instead of "w+".  I'd suggest reading the Filesystem
Functions section of the manual again...

good luck!

-philip

On Tue, 27 Aug 2002, phper wrote:

> how do I read the contents of a file.
>
> $FileStream = fopen("webmaster/forum".$Forum."/forumtopics.txt", "w+");
>   $line = fgetss ($FileStream, 255);
>   print ("number is: ".$line." <br> ");
>
>   fclose($FileStream);
>
>   always returns nothing
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
'w+' - Open for reading and writing; place the file pointer at the beginning
of the file and truncate the file to zero length. If the file does not
exist, attempt to create it.

Change it to "r" since you are only reading. Also check to make sure your
pathing is correct.

---
Brad Dameron                                                                    
Network Account Executive
TSCNet Inc.                                                                            
 www.tscnet.com
Silverdale, WA.                                                                 
1-888-8TSCNET



> -----Original Message-----
> From: phper [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 27, 2002 2:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] file reading
>
>
> how do I read the contents of a file.
>
> $FileStream = fopen("webmaster/forum".$Forum."/forumtopics.txt", "w+");
>   $line = fgetss ($FileStream, 255);
>   print ("number is: ".$line." <br> ");
>
>   fclose($FileStream);
>
>   always returns nothing
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi,
I just installed PHP via PHPTriad...I have a couple of simple questions I hope you can 
answer....

1)How do i know if this is running  a module or cgi version?


I own 3 dot coms which are not being hosted...too expensive :-(( no job..:-((((((
2)How can i host a test site on this? (I am on win2k pro)

when i run ipconfig /all from the command prompt this is what i get:
blah blah
blah blah
blah blah

ipaddress...............193.150.***.** (stars are to mask the real ip...I know there 
are evil genus's on this list) ;-)
default gateway.......193.150.***.*  (ditto)
DHCP server........... blah
DNS servers............blah
                              blah


kindly reply,
-Ryan


--- End Message ---
--- Begin Message ---
>Hi,
>I just installed PHP via PHPTriad...I have a couple of simple questions I 
>hope you can answer....
>
>1)How do i know if this is running  a module or cgi version?

<?php phpinfo();?>

Look at the output in the top part.

You'll see CGI or ISAPI or ASAPI or whatever.

There's also a built-in function to detect it inside a PHP script if you
need it...  Forget the name, but it's in the manual.  http://php.net/

>I own 3 dot coms which are not being hosted...too expensive :-(( no job..:-((((((
>2)How can i host a test site on this? (I am on win2k pro)

Host them as in make them publicly available?...

You'll need somebody to do the DNS for you for starters, unless you want to
start running, errr, whatever Windoze uses instead of BIND, and that's going
to be a real pain...

A lot of the freebie DNS guys like http://register.com will "forward" your
DNS for you to a static IP, or you can get it cheap through places like
http://dyndns.org with a dynamic IP.  You have to install a little client
that runs and detects your IP change when you re-boot (or whatever) back to
dyndns so they know where you (your IP) moved to...

I gotta say, though, that with hosts running around $20.00 a month or less
(http://budgetweb.com), I don't understand how you can have domain names
that are "too expensive" to run that you'd want to throw on your home
computer...

You *probably* are violating the terms of service of your ISP for the home
network connection to run a web-server, and if you get any serious traffic
at all, you'll be cut off mercilessly.

Not that you can't do it, but you have to make sure there's not enough
bandwidth for you to pop up on their radar as a problem, or you can't even
surf any more cuz they've cut you off.

>when i run ipconfig /all from the command prompt this is what i get:
>blah blah
>blah blah
>blah blah
>
>ipaddress...............193.150.***.** (stars are to mask the real ip...I 
>know there are evil genus's on this list) ;-)
>default gateway.......193.150.***.*  (ditto)
>DHCP server........... blah
>DNS servers............blah

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Ok, I recently recompiled PHP with GD and exif support.

Now, I wanted to test exif_thumbnail() so created an jpeg image
which had an embedded thumbnail. I used the exif_thumbnail()
example at the php.net website, but it returns errors.

The first error I get is an incorrect parameter count when I use
exif_thumbnail($file, $x, $y, $type);
I stripped off the height, width and file_type paremeters and that
gets rid of that error.

But no matter what I do, this function returns false telling me that
there is no thumbnail to be retrieved from the image.

Can anyone provide me with a working example of thumbnail extraction
using exif_thumbnail()? I've tried many different things, with
absolutely no luck.

I tried using imagecreatefromjpeg() but that tells me theres no such
function.

Yours truly,
Hrd



--- End Message ---
--- Begin Message ---
Can't help with the exif stuff.

>I tried using imagecreatefromjpeg() but that tells me theres no such
>function.

That means you forgot the --with-jpeg-dir when you did the --with-gd or the
--with-gd never kicked in properly or...


Basically, you didn't configure right, so go back to that stage.

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
I'm using Apache 2.0.40 with PHP 4.2.2 from Red Hat Linux 8.0 beta 3
(null). php_value statements in my httpd.conf work fine, but php_value
is not recognized, giving the error message below:

Starting httpd: Syntax error on line 336 of /etc/httpd/conf/httpd.conf:
Invalid command 'php_flag', perhaps mis-spelled or defined by a module
not included in the server configuration

I've tried enabling both AllowOverride Options and AllowOverride All to
no avail.

If I turn on /server-info support in Apache I see:

Module Name: sapi_apache2.c
Content handlers: none
Configuration Phase Participation: Create Directory Config, Merge
Directory Configs
Request Phase Participation: Post-Read Request
Module Directives:
php_value - PHP Value Modifier
php_admin_value - PHP Value Modifier
Current Configuration:

which doesn't show php_flag as supported.

Does anyone have any clues how this could happen? Is Red Hat's PHP
package messed up or am I missing some config thing somewhere?

Any help would be appreciated. Thanks.

-- 

Steve Fox
IBM Linux Technology Center
http://www.ibm.com/linux/ltc
http://k-lug.org
--- End Message ---
--- Begin Message ---
Known Apache 2.0 related bug.  Not sure anybody is looking at it.

On 27 Aug 2002, Steve Fox wrote:

> I'm using Apache 2.0.40 with PHP 4.2.2 from Red Hat Linux 8.0 beta 3
> (null). php_value statements in my httpd.conf work fine, but php_value
> is not recognized, giving the error message below:
>
> Starting httpd: Syntax error on line 336 of /etc/httpd/conf/httpd.conf:
> Invalid command 'php_flag', perhaps mis-spelled or defined by a module
> not included in the server configuration
>
> I've tried enabling both AllowOverride Options and AllowOverride All to
> no avail.
>
> If I turn on /server-info support in Apache I see:
>
> Module Name: sapi_apache2.c
> Content handlers: none
> Configuration Phase Participation: Create Directory Config, Merge
> Directory Configs
> Request Phase Participation: Post-Read Request
> Module Directives:
> php_value - PHP Value Modifier
> php_admin_value - PHP Value Modifier
> Current Configuration:
>
> which doesn't show php_flag as supported.
>
> Does anyone have any clues how this could happen? Is Red Hat's PHP
> package messed up or am I missing some config thing somewhere?
>
> Any help would be appreciated. Thanks.
>
> --
>
> Steve Fox
> IBM Linux Technology Center
> http://www.ibm.com/linux/ltc
> http://k-lug.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Tue, 2002-08-27 at 14:45, Rasmus Lerdorf wrote:
> Known Apache 2.0 related bug.  Not sure anybody is looking at it.

:( At least I can quit banging my head against my keyboard now :)

Thanks much Rasmus.

-- 

Steve Fox
IBM Linux Technology Center
http://www.ibm.com/linux/ltc
http://k-lug.org
--- End Message ---
--- Begin Message ---
Are sessions in PHP somehow affected by changes in Unix users? I know that
the only recent changes to the server have been the addition of a few Unix
users and the changing of some older passwords, but now sessions do not work
within PHP.

Is a session related to a web (default?) user?
K.


--- End Message ---
--- Begin Message ---
>Are sessions in PHP somehow affected by changes in Unix users? I know that
>the only recent changes to the server have been the addition of a few Unix
>users and the changing of some older passwords, but now sessions do not work
>within PHP.
>
>Is a session related to a web (default?) user?

Session data is stored in a temp directory which must be writable by the web
(default) user defined in httpd.conf

Search httpd.conf for "User" and search php.ini for "session" (look for the
directory setting).

If you've made it impossible for PHP to write the session data in a
directory, it's got nowhere to store it.

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
On Wednesday 28 August 2002 03:51, K Soares wrote:
> Are sessions in PHP somehow affected by changes in Unix users? I know that
> the only recent changes to the server have been the addition of a few Unix
> users and the changing of some older passwords, but now sessions do not
> work within PHP.
>
> Is a session related to a web (default?) user?

The user that the webserver is running as (nobody/apache/whatever) must have 
write access to the directory defined by "session.save_path" in php.ini.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Now I lay me down to sleep,
I pray the Lord my soul to keep,
If I should die before I wake,
I'll cry in anguish, "Mistake!!  Mistake!!"
*/

--- End Message ---
--- Begin Message ---
Dear forum:

I'm trying to do several basic things with an HTML form and PHP.  So far,
I've gotten the form to write to a MySQL database, send email and echo the
fields after the form is submitted.

Next I'd just like to confirm that the fields are not blank and send a
custom error message.   But I think I'm confused about where to place the
code.

I've purchased four books on PHP and I've been working for four days and I'm
so stuck.  Am I missing some online source for information?  I've been to
PHP.net and have not found answers.

The two files below are the HTML and PHP files that are working.  The third
file is one of my attempts to check for a blank field and write a custom
error message.

*************HTML file***************
<HTML>
<HEAD>
<TITLE>Add a Record</TITLE>
</HEAD>
<BODY>

<H1>Adding a Record to tbltest</H1>

<FORM METHOD="post" ACTION="do_addrecord3.php">

<TABLE CELLSPACING=3 CELLPADDING=3>
<TR>
<TD VALIGN=TOP>
<P>First Name<BR>
<INPUT TYPE="text" NAME="firstname" SIZE=30 MAXLENGTH=225></p>

<P>Last Name<BR>
<INPUT TYPE="text" NAME="lastname" SIZE=30 MAXLENGTH=225></P>

<P>Email<BR>
<INPUT TYPE="text" NAME="email" SIZE=30 MAXLENGTH=225></P>

</TD>


<TR>
<TD VALIGN=TOP COLSPAN=2 ALIGN=CENTER>
        </P>

<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Add Record"></P>

</TD>
</TR>
</TABLE>

</FORM>

</BODY>
</HTML>

*************** Working PHP form***************
<?
/* Check to see if info is there */

if ((!$lastname) || (!$firstname) || (!$email)) {
 header("Location: http://localhost/show_addrecord3.html";);
 exit;
}

/* Login to database */
$db_name = "drip_dripirrigationdb";
$table_name = "tbltest";

$connection = @mysql_connect("localhost", "drip", "xxxxxx")
 or die("Couldn't connect.");

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

/* Insert data  */
$sql = "INSERT INTO $table_name
 (firstname, lastname, email)
 VALUES
 (\"$firstname\", \"$lastname\", \"$email\")
 ";

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

?>
<?
/* Define variables */
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "First Name:    $firstname\n";
$msg .= "Sender's E-Mail:  $email\n";
$msg .= "Last Name:          $lastname\n\n";

$to = "[EMAIL PROTECTED]";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $email\n\n";

/* send the mail */
mail($to, $subject, $msg, $mailheaders);

?>

<HTML>
<HEAD>
<TITLE>Add a Record</TITLE>
</HEAD>
<BODY>

<H1>Adding a Record to <? echo "$table_name"; ?></H1>

<TABLE CELLSPACING=3 CELLPADDING=3>
<TR>
<TD VALIGN=TOP>
<P><STRONG>Last Name:</STRONG><BR>
<!-- Reprint the info on next page -->
<? echo "$lastname"; ?></p>

      <P><STRONG>First Name:</STRONG><BR>
<? echo "$firstname"; ?></P>

<P><STRONG>Email:</STRONG><BR>
<? echo "$email"; ?></P>
</TD>

<!-- repeat -->
<P><a href="show_addrecord3.html">Click here to select your username and
password.</a></p>

</TD>
</TR>
</TABLE>

</BODY>
</HTML>


************Modified PHP form******************
<?
/* Check to see if info is there */

 if ($firstname == "") {
  $name_err = "<font color=red>Please enter your name!</font><br>";
  $send = "no";
 }

 if ($lastname == "") {
  $lastname_err = "<font color=red>Please enter a message!</font><br>";
  $send = "no";
 }

 if ($email == "") {
  $email_err = "<font color=red>Please enter your e-mail
address!</font><br>";
  $send = "no";
 }


 if ($send != "no") {

/* Login to database */
$db_name = "drip_dripirrigationdb";
$table_name = "tbltest";

$connection = @mysql_connect("localhost", "drip", "33333333")
 or die("Couldn't connect.");

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

/* Insert data  */
$sql = "INSERT INTO $table_name
 (firstname, lastname, email)
 VALUES
 (\"$firstname\", \"$lastname\", \"$email\")
 ";

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

?>
<?
/* Define variables */
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "First Name:    $firstname\n";
$msg .= "Sender's E-Mail:  $email\n";
$msg .= "Last Name:          $lastname\n\n";

$to = "[EMAIL PROTECTED]";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $email\n\n";

/* send the mail */
mail($to, $subject, $msg, $mailheaders);

?>

<HTML>
<HEAD>
<TITLE>Add a Record</TITLE>
</HEAD>
<BODY>

<H1>Adding a Record to <? echo "$table_name"; ?></H1>

<TABLE CELLSPACING=3 CELLPADDING=3>
<TR>
<TD VALIGN=TOP>
<P><STRONG>Last Name:</STRONG><BR>
<!-- Reprint the info on next page -->
<? echo "$lastname"; ?></p>

      <P><STRONG>First Name:</STRONG><BR>
<? echo "$firstname"; ?></P>

<P><STRONG>Email:</STRONG><BR>
<? echo "$email"; ?></P>
</TD>

<!-- repeat -->
<P><a href="show_addrecord3.html">Click here to add another.</a></p>

</TD>
</TR>
</TABLE>

</BODY>
</HTML>




--- End Message ---
--- Begin Message ---
>Next I'd just like to confirm that the fields are not blank and send a
>custom error message.   But I think I'm confused about where to place the
>code.

Where you currently have "if ($send != "no"){ ... }" you could tack on
something like:

else{
  echo $name_err;
  echo $email_err;
  echo $lastname_err;
}


Once that works, as an improvement, it might make more sense to do like
this:

$message = '';
if ($name == ''){
  $message .= "Name must be provided.<BR>\n";
}
if ($email == ''){
  $message .= "Email must be provided.<BR>\n";
}
if ($lastname == ''){
  $message .= "Last name must be provided.<BR>\n";
}
if (!$message){
  # Send the email.
}
else{
  echo "<FONT COLOR=FF0000>$message</FONT>\n";
}

By using $message and .= to "tack on" the messages, you can avoid having so
many variables running around confusing you and get the job done just as
well.

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
On Wednesday 28 August 2002 03:51, April Lougheed wrote:

> Next I'd just like to confirm that the fields are not blank and send a
> custom error message.   But I think I'm confused about where to place the
> code.

> The two files below are the HTML and PHP files that are working.  The third
> file is one of my attempts to check for a blank field and write a custom
> error message.

How isn't it working? What do you see? What did you expect to see?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Depart not from the path which fate has assigned you.
*/

--- End Message ---
--- Begin Message ---
I have a 5-step (5 page) process in which users must answer various questions. Each 
page passes along the data to the next page, at the same time capturing the data from 
the previous page and passing that along too.

To capture all the data submitted previously, I have the following code:

$a = "?";
$url = "";
while(list($key, $value) = each($HTTP_POST_VARS)) 
{ 
$url .= "$a$key=" . htmlspecialchars(addslashes($value));
$a = "&";
}
while(list($key, $value) = each($HTTP_GET_VARS)) 
{ 
$url .= "$a$key=" . htmlspecialchars(addslashes($value));
$a = "&";
}

Each page then submits it's own form to "nextpage.php<? $url ?>";  I'm trying to 
simply pass along everything that has already been submitted, via GET or POST.

The problem is that I noticed if the character '#' is part of a value for a GET 
variable, it breaks the whole string. Everything after the '#' is lost.

How can I get around this? Is this something I must simply check for and strip out? 
What other characters must I worry about? As you can see, I'm already putting 
everything through htmlspecialchars() and addslashes().

Thanks

-- 
: Joseph Szobody :
"Computers are like airconditioners: They stop working properly if you open windows."

--- End Message ---
--- Begin Message ---
>I have a 5-step (5 page) process in which users must answer various 
>questions. Each page passes along the data to the next page, at the same 
>time capturing the data from the previous page and passing that along too.
>
>To capture all the data submitted previously, I have the following code:
>
>$a = "?";
>$url = "";
>while(list($key, $value) = each($HTTP_POST_VARS)) 
>{ 
>$url .= "$a$key=" . htmlspecialchars(addslashes($value));

These should be http://php.net/URLEncode, not
htmlspecialchars(addslashes(..))

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Thanks. That's what I needed.

Joseph

"Richard Lynch" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]...
> >I have a 5-step (5 page) process in which users must answer various 
> >questions. Each page passes along the data to the next page, at the same 
> >time capturing the data from the previous page and passing that along too.
> >
> >To capture all the data submitted previously, I have the following code:
> >
> >$a = "?";
> >$url = "";
> >while(list($key, $value) = each($HTTP_POST_VARS)) 
> >{ 
> >$url .= "$a$key=" . htmlspecialchars(addslashes($value));
> 
> These should be http://php.net/URLEncode, not
> htmlspecialchars(addslashes(..))
> 
> -- 
> Like Music?  http://l-i-e.com/artists.htm
> 

--- End Message ---
--- Begin Message ---
I have spent most of the day trying to get gd 1.8.4, freetype2, libpng,
zlib, and jpeg-6b to work with PHP 4.0.6 running on Solaris 7. I am not to
yet to point of configuring this with PHP. I can't get 'make' to run on gd
1.8.4:

gdft.c:36: freetype/freetype.h: No such file or directory
gdft.c:37: freetype/ftglyph.h: No such file or directory
make: *** [gdft.o] Error 1

I modified gdft.c to use absolute paths:
/usr/local/include/freetype2/freetype/freetype.h and
/usr/local/include/freetype2/freetype/ftglyph.h but this resulted in further
errors as well.

Anybody experience this or have a suggestion for a resolution?

Thanks.


Zach


--- End Message ---
--- Begin Message ---
GD1 uses Freetype 1 and you appear to have Freetype2.  Grab GD2 instead.

On Tue, 27 Aug 2002, Zach Curtis wrote:

> I have spent most of the day trying to get gd 1.8.4, freetype2, libpng,
> zlib, and jpeg-6b to work with PHP 4.0.6 running on Solaris 7. I am not to
> yet to point of configuring this with PHP. I can't get 'make' to run on gd
> 1.8.4:
>
> gdft.c:36: freetype/freetype.h: No such file or directory
> gdft.c:37: freetype/ftglyph.h: No such file or directory
> make: *** [gdft.o] Error 1
>
> I modified gdft.c to use absolute paths:
> /usr/local/include/freetype2/freetype/freetype.h and
> /usr/local/include/freetype2/freetype/ftglyph.h but this resulted in further
> errors as well.
>
> Anybody experience this or have a suggestion for a resolution?
>
> Thanks.
>
>
> Zach
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
OK. I ran 'make install' for GD 2.0.1 and that seemed to go smoothly.

Thanks.


Zach

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 2:42 PM
To: Zach Curtis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] GD 1.8.4


GD1 uses Freetype 1 and you appear to have Freetype2.  Grab GD2 instead.

On Tue, 27 Aug 2002, Zach Curtis wrote:

> I have spent most of the day trying to get gd 1.8.4, freetype2, libpng,
> zlib, and jpeg-6b to work with PHP 4.0.6 running on Solaris 7. I am not to
> yet to point of configuring this with PHP. I can't get 'make' to run on gd
> 1.8.4:
>
> gdft.c:36: freetype/freetype.h: No such file or directory
> gdft.c:37: freetype/ftglyph.h: No such file or directory
> make: *** [gdft.o] Error 1
>
> I modified gdft.c to use absolute paths:
> /usr/local/include/freetype2/freetype/freetype.h and
> /usr/local/include/freetype2/freetype/ftglyph.h but this resulted in
further
> errors as well.
>
> Anybody experience this or have a suggestion for a resolution?
>
> Thanks.
>
>
> Zach
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--- End Message ---
--- Begin Message ---
Hello,

On 08/27/2002 12:38 PM, Raphael Hamzagic wrote:
> Hi everyone,
> 
> I'm with a little doubt about the best way to send a mail message to a large
> mailing list using PHP. I'm not interested  in existing mailing list
> managers, or source codes.
> I dont know if the best way to send emails is to use a repeat loop with
> mail() function, or use some other structure to send emails with timeouts
> intervals...

No, the best way is to put all recipients in Bcc: headers and send a 
single message to your local mailer program. Using mail() under 
Linux/Unix will be enough.




-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
on 28/08/02 1:38 AM, Raphael Hamzagic ([EMAIL PROTECTED]) wrote:

> I'm with a little doubt about the best way to send a mail message to a large
> mailing list using PHP. I'm not interested  in existing mailing list
> managers, or source codes.
> I dont know if the best way to send emails is to use a repeat loop with
> mail() function, or use some other structure to send emails with timeouts
> intervals...

yes, and yes, providing you want to send personalised emails, which costs
huge performance problems and a lkoad on the server... possibly leads to
timeouts of the script, timeouts of the browser, etc etc.  Not good!

the real easy solution is to send ONE email with everyone in the Bcc field.
Quick and simple.  Won't piss off your host, won't load the server, etc.

Justin


--- End Message ---
--- Begin Message ---
I have this set of code.  and what I want to know how to do is how to 
filter one or more vars in the flat file?  For example filter all the 
people that work "at night"

I'm assuming it has to be in this part of the code:
for($i = 0; $i < count($arr_lines); $i++)
{
     $arr_data = explode($delim, $arr_lines[$i]);
     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';
}

But where do I add an IF statement if that is what is needed?

<?php

/*assigned vars*/
$delim = "\t";
$file_path = "newfile.dat";

$name = "matt";
$works = "at night";
$programs = "php";

/*exporting data to flat file*/
$file = fopen($file_path, "a");
fwrite($file, $name.$delim);
fwrite($file, $works.$delim);
fwrite($file, $programs);
fwrite($file, "\n");
fclose($file);

$file = fopen($file_path,"r");
$page = fread($file, 4950);

$arr_lines = explode("\n", $page);
for($i = 0; $i < count($arr_lines); $i++)
{
     $arr_data = explode($delim, $arr_lines[$i]);
     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';
}

fclose($file);

?>

TIA!

-Matt



-- 
Matt Zur
[EMAIL PROTECTED]
http://www.zurnet.com

Need a Web Site??? - Visit... www.zurnet.com

1997 - 2002 - 5th Anniversary!!!

--- End Message ---
--- Begin Message ---
>I have this set of code.  and what I want to know how to do is how to 
>filter one or more vars in the flat file?  For example filter all the 
>people that work "at night"

Honestly, you'd be best off moving the data into a database (MySQL or
otherwise)...

At this point, you're starting to do a lot of work that's already been done
by somebody else...

>I'm assuming it has to be in this part of the code:
>for($i = 0; $i < count($arr_lines); $i++)
>{
>     $arr_data = explode($delim, $arr_lines[$i]);

$worksdelim = $arr_data[1];
echo "Works is '$worksdelim'<BR>\n";
    if ($worksdelim == 'at night'){ # Or something like 'at night'...

>     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';

    }

>}
>
>But where do I add an IF statement if that is what is needed?
>
><?php
>
>/*assigned vars*/
>$delim = "\t";
>$file_path = "newfile.dat";
>
>$name = "matt";
>$works = "at night";
>$programs = "php";
>
>/*exporting data to flat file*/
>$file = fopen($file_path, "a");
>fwrite($file, $name.$delim);
>fwrite($file, $works.$delim);
>fwrite($file, $programs);
>fwrite($file, "\n");
>fclose($file);
>
>$file = fopen($file_path,"r");
>$page = fread($file, 4950);
>
>$arr_lines = explode("\n", $page);
>for($i = 0; $i < count($arr_lines); $i++)
>{
>     $arr_data = explode($delim, $arr_lines[$i]);
>     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';
>}
>
>fclose($file);
>
>?>
>
>TIA!
>
>-Matt
>
>
>
>-- 
>Matt Zur
>[EMAIL PROTECTED]
>http://www.zurnet.com
>
>Need a Web Site??? - Visit... www.zurnet.com
>
>1997 - 2002 - 5th Anniversary!!!
>


-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Hi! Sorry for this stupid question but i am a begginer learning from a 
old book (dangerous combination), So i have to convert every example to 
not use old methods...
I have to problems and i look every where and could not resolve.
firstone:
i have a form like this...

<form enctype="multipart/form-data" action="_URL_" method="post">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>

but i when i try to acces to $_FILES['userfile']['name'] for instance, 
seems to not exist... But the $_POST['userfile'] is working..
I look inte online manual and i doit exactly like describe but still not 
working...
Any ideas ????

Second:
I cant accoplish that my slack work with safe mode on...
the user/group of the script php recognize like a -1/-1.... ¿?¿?¿? why?
i try make a user/grup apache/apache to switch once started but still 
not working...

Thaks in advance and please help... i don´t know other place to find the 
answers to this problems...

Machine conf:
-Slackware 8.1 - PHP v4.2.2 - Apache v2.0.39
-Windows XP Pro - PHP v4.2.2 - Apache v4.0.40

--- End Message ---
--- Begin Message ---
>Hi! Sorry for this stupid question but i am a begginer learning from a
>old book (dangerous combination), So i have to convert every example to
>not use old methods...
>I have to problems and i look every where and could not resolve.
>firstone:
>i have a form like this...
>
><form enctype="multipart/form-data" action="_URL_" method="post">
>Send this file: <input name="userfile" type="file">
><input type="submit" value="Send File">
></form>
>
>but i when i try to acces to $_FILES['userfile']['name'] for instance,
>seems to not exist... But the $_POST['userfile'] is working..

Do <?php phpinfo();?> on the page where $_FILES isn't working and see what's
in there that mentions 'userfile', if anything.

>I look inte online manual and i doit exactly like describe but still not
>working...
>Any ideas ????
>
>Second:
>I cant accoplish that my slack work with safe mode on...
>the user/group of the script php recognize like a -1/-1.... ¿?¿?¿? why?
>i try make a user/grup apache/apache to switch once started but still
>not working...
>
>Thaks in advance and please help... i don´t know other place to find the
>answers to this problems...
>
>Machine conf:
>-Slackware 8.1 - PHP v4.2.2 - Apache v2.0.39
>-Windows XP Pro - PHP v4.2.2 - Apache v4.0.40
>


--
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
>why this array_push($x ? $a : $b, 'value'); produce error(Fatal error:
>Only variables can be passed by reference)
>
><?php
>
>$x = 1;
>#$x = 0;
>
>$a = array();
>$b = array();
>
>array_push($x ? $a : $b, 'value');
>
>i must rewrote this in
>
>if ($x)
>   array_push($a, 'value');
>else
>   array_push($b, 'value');

My Theory:

In order for array_push to be reasonably efficient, the array is passed by
reference.

If it were passed by value, PHP would have to make a COPY of the array, and
the array could be VERY large...

$x ? $a : $b has to turn into a "temporary" variable, since you don't really
provide a storage place for it.

That temporary variable can't be turned into a reference.

At any rate, smushing the ? and the array_push all into one line is just
being obtuse.

Spell out what you're doing with an extra line of code and another variable:

$victim = $x ? $a : $b;
array_push($victim, 'value');

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
>The problem I have when using include files is the path to different parts 
>of the web site.
>
>To Explain:
>
>I have a header.inc file in an inc directory:
>
>root
> |___inc
> |       |___header.inc

You may want to move your include files outside the web tree so that
malicious users can't surf directly to them and wreak havoc.

> |
> |___images
> |       |___topbar_01.gif
> |
> |___faq
>        |___faq.php
>
>In the header.inc file there is: 
><img name="topbar_01" src="images/topbar_01.gif" width=783 height=56>
>
>now when I include this into the faq.php file I do not display the 
>topbar_01.gif as the path to topbar_01.gif is now
>/root/faq/images/topbar_01.gif
>
>I would like to be able to use a header.inc file so that I can update the 
>entire site simply.

The include file and PHP are irrelevant here -- You'd have the same problem
with this directory structure and pure HTML.

You've buried faq.php and are trying to use 'images/topbar_01.gif' when you
really want '/images/topbar_01.gif'  While the "rule" of not using absolute
pathnames is Good, it's not Absolute. :-)

Another possiblity (under Un*x) would be to symlink your images directory
under your faq directory:

cd ~/faq
ln -s ../images images

Or maybe you don't want faq.php buried down inside faq anyway...  I dunno
what else you have, but it seems like you're getting a little silly burying
faq.php inside '/faq/' when you're probably not going to have a whole lot of
files inside '/faq/'  If you start getting that many FAQs, you should throw
them in a database and have faq.php be a single file that reads FAQs out of
the database on demand. :-)

-- 
Like Music?  http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
>Can I use php to get a list of all the jpgs in a folder?  I want to make a
>photo album type thing for a website, and I want it to be real simple (i.e.
>you put photos (jpgs) in a folder called photos and upload them.  Then the
>album is built dynamically using php.  Thoughts?

http://php.net/opendir
http://php.net/readdir
http://php.net/stristr

<?php
  $path = '/full/path/to/your/jpeg/dir/'; # Be sure it's world-readable!
  $dir = opendir($path) or die("Could not open $dir");
  while ($file = readdir($dir)){
    if (stristr($file, 'jpg') || stristr($file, 'jpeg')){
      echo "<A HREF=$file>$file</A><BR>\n";
    }
  }
?>

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
>disable URL rewriting altogether and rely soley on cookies. How do I 
>disable PHP session URL rewriting? I don't see a setting in php.ini for it.
>
>; use transient sid support if enabled by compiling with --enable-trans-sid.
>session.use_trans_sid = 1

This one.

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
>Just wanting some advice on something im doing, basically im storing
>news into mysql and what i want to do is, when the news is displayed, if
>a url is in there ie(http://www.blahblah.com OR
>mailto:[EMAIL PROTECTED]) it will automatically be displayed as a link,
>im considering using preg_match for this but i was wondering if there is
>any other function already designed for automatically detecting urls? 

No built-in function, but only a zillion examples in various code archives.

http://php.net/links.php

-- 
Like Music?  http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I know a lot has been discussed in this topic, but I still don't find any 
solution.
What I want to do is send a lot of mails triggered from a web page using 
php.
I've found diferent solutions but all of them has some problem:
1) using set_time_limit() to allow the script to run longer while sending 
e-mails, my prefered solution but I won't let someone waiting a lot of time 
with a loading browser because they'll stop, reload, and at best, just not 
like it. So, I would like to launch a background process changing the 
set_time_limit() in that process (if needed), the problem is that I wasn't 
able to run a background process in PHP, were you ? I know I could use at 
(atd) to run a background process but in my shared server, there's no at 
available.

2) Queuing instead of sending. I've seen that some people improved the 
'sending' (well, it's not sending anymore) by queuin only. Then some people 
tell me that sendmails always queue and I'm a bit confused. Does sendmail 
queue or sends mails ? if it queue, why is it send imediatly if the queue 
is procesed once an hour or so ? I don't care if my mails are procesed once 
an hour for this mails, I don't need them to be sent imediatly. I can't 
change sendmail configuration (since it's a shared server) and I wouldn't 
want to because I have other 'mail cases' when I want to send the mails 
imediatly. I can't change the way PHP calls sendmail (again, it's a shared 
server) but I'm using PHPMailer and I can change the way PHPMailer uses 
sendmail, will `/usr/sbin/sendmail -O DeliveryMode=q` queue the mails I'm 
sending ?

3) Someone told me to do it using cron, do you have any idea of how to do it 
with cron ?

Thanks.
- -- 
Pupeno: [EMAIL PROTECTED]
http://www.pupeno.com
- ---
Help the hungry children of Argentina,
please go to (and make it your homepage):
http://www.porloschicos.com/servlet/PorLosChicos?comando=donar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9bAiPLr8z5XzmSDQRAncrAJ9aJNbANVfW0yWglY7n/33vQrN3UQCbB6N0
2ba6H7dP1U4Qb0xfI4M8SSE=
=cQ0X
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
on 28/08/02 9:17 AM, Pupeno ([EMAIL PROTECTED]) wrote:


> I know a lot has been discussed in this topic, but I still don't find any
> solution.
> What I want to do is send a lot of mails triggered from a web page using
> php.
> I've found diferent solutions but all of them has some problem:
> 1) using set_time_limit() to allow the script to run longer while sending
> e-mails, my prefered solution but I won't let someone waiting a lot of time
> with a loading browser because they'll stop, reload, and at best, just not
> like it. So, I would like to launch a background process changing the
> set_time_limit() in that process (if needed), the problem is that I wasn't
> able to run a background process in PHP, were you ? I know I could use at
> (atd) to run a background process but in my shared server, there's no at
> available.

If you trigger it from a web page, eventually, no matter what you do, you
will hit the wall, because browsers may time out -- not just the PHP script.
The ONLY option is to Bcc: everyone in your email, rather than send
personalise emails.  This way you only send ONE email, not 1000's.

I've spent AGES researching this, and am convinced that Bcc is the only way
to get the performance you want.

There are many hacks work-arounds like:

- have the webpage only do batches of 50 emails, and refresh with META
refresh every 1 minute... come back in a few hours, and they'll all be sent.


The other option to consider is to write a PHP script which runs FROM the
command line.  Then possibly your webpage can trigger the command line
script, AND refresh to a "thanks" page, leaving the other command line
script still running.

Of course you need PHP as a command line executable for this.


I really suggest speaking to your host.  It's quite possible THEY have the
solution you want.  It's also quite possible that they HATE bulk mailing via
their web page servers, and will actually impose restrictions.

They may also have a dedicated mailing server (as my ISP does) which can
handle this sorta stuff.


> 2) Queuing instead of sending. I've seen that some people improved the
> 'sending' (well, it's not sending anymore) by queuin only. Then some people
> tell me that sendmails always queue and I'm a bit confused. Does sendmail
> queue or sends mails ? if it queue, why is it send imediatly if the queue
> is procesed once an hour or so ? I don't care if my mails are procesed once
> an hour for this mails, I don't need them to be sent imediatly. I can't
> change sendmail configuration (since it's a shared server) and I wouldn't
> want to because I have other 'mail cases' when I want to send the mails
> imediatly. I can't change the way PHP calls sendmail (again, it's a shared
> server) but I'm using PHPMailer and I can change the way PHPMailer uses
> sendmail, will `/usr/sbin/sendmail -O DeliveryMode=q` queue the mails I'm
> sending ?

The issue of queing is only there IF you wish to send personalised emails.
Queing is NOT an issue for sending an email with a Bcc of 50,000 people.


> 3) Someone told me to do it using cron, do you have any idea of how to do it
> with cron ?

Cron is a way of executing a process at a certain time (eg 3am daily).  If
you were able to write a command-line PHP script to send you email (queries
a DB or text file to get the message body, then grabs the address', then
send the email(s)), you could set it to run at a time which the server is
less busy (eg 4am).

You could also use it to partially-send to the list in batches of 100
people, at 5 minute intervals or something.


The real answer to your question is:

If you are doing this on a shared host, use Bcc and keep it simple... your
host will probably see the huge system burden you are placing, and impose
restrictions on you.

If you want a dedicated mailing list with personalised emails, you should
look at a dedicated mailing list system on your host, or another host, which
tackles the issue properly.  There's sparklist.com, ezmlm, etc etc.


Your host may be interesting in setting up a program to do this...

Justin

--- End Message ---
--- Begin Message ---
what is a good php indenter/beautifier?
Thanks


--- End Message ---
--- Begin Message ---
This is a little off topic, but I am desperate. I am looking for a good
PHP/MySQL chat that is not in a bunch of frames. I have from WebChat
(http://www.webdev.ro/) but it has a bunch of runtime erros. If anyone has
this working or they know of another that works well please send me a link
or something anything!!!!

Thank you in advance for your time and support.


--- End Message ---
--- Begin Message ---
Christopher J. Crane wrote:
> This is a little off topic, but I am desperate. I am looking for a good
> PHP/MySQL chat that is not in a bunch of frames. I have from WebChat
> (http://www.webdev.ro/) but it has a bunch of runtime erros. If anyone has
> this working or they know of another that works well please send me a link
> or something anything!!!!
> 
> Thank you in advance for your time and support.
> 
> 


http://freshmeat.net/browse/22/?filter=183%2C15&topic_id=22

--- End Message ---
--- Begin Message ---
I am using PHP with MySQL and have a timestamp field in my db table.  What 
would be the easiest way to get the newest timestamp out of the db?

Thanks in Advance
Steve


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
ow3

--- End Message ---
--- Begin Message ---
Please, How do I make to access a database Sql Server 2000?


Thaks


--- End Message ---
--- Begin Message ---

http://www.php.net/manual/en/function.mssql-connect.php

>From: "Skyhawk" <[EMAIL PROTECTED]>

>Please, How do I make to access a database Sql Server 2000?
>
>
>Thaks
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
Anyone care to recommend a host as follows:

Unix
PHP
MySQL
Domain Reg.
No unusual size or traffic requirements (now)

Pay by Check (my company will not allow the used of company credit cards
over the Internet.)

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474

--- End Message ---
--- Begin Message ---
cedant web hosing...cedant.com. They will bill you and you can pay by check
and with Mysql databse I think they are 12.00
"Bruce Karstedt" <[EMAIL PROTECTED]> wrote in message
003b01c24e2b$7a9c9e80$7772d73f@c3">news:003b01c24e2b$7a9c9e80$7772d73f@c3...
> Anyone care to recommend a host as follows:
>
> Unix
> PHP
> MySQL
> Domain Reg.
> No unusual size or traffic requirements (now)
>
> Pay by Check (my company will not allow the used of company credit cards
> over the Internet.)
>
> Bruce Karstedt
> President
> Technology Consulting Associates, Ltd.
> Tel: 847-735-9488
> Fax: 847-735-9474
>


--- End Message ---
--- Begin Message ---
What's your site about?

I can do all that for free if if it's:
 - Non-Profit
 - Personal homepage
 - PHP Dev.

Apache, PHP, MySQL on Slackware 8.1
98% Uptime, 2 Meg pipe based in Brisbane, Australia.
I allow external MySQL DB Access, FTP, mail(), DNS hosting and unlimited
POP3 accounts.

BUT...
I have a 5gig monthly data transmission limit, so no big files...


Contact me if interested.

Cheers,
Liam


----- Original Message -----
From: "Bruce Karstedt" <[EMAIL PROTECTED]>
To: "PHP - General List (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 10:40 AM
Subject: [PHP] Host


> Anyone care to recommend a host as follows:
>
> Unix
> PHP
> MySQL
> Domain Reg.
> No unusual size or traffic requirements (now)
>
> Pay by Check (my company will not allow the used of company credit cards
> over the Internet.)
>
> Bruce Karstedt
> President
> Technology Consulting Associates, Ltd.
> Tel: 847-735-9488
> Fax: 847-735-9474
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



--- End Message ---
--- Begin Message ---
Experthost.com allows payment by cheque, but the service is withheld until
the cheque clears (understandable).

Justin



on 28/08/02 10:40 AM, Bruce Karstedt ([EMAIL PROTECTED]) wrote:

> Anyone care to recommend a host as follows:
> 
> Unix
> PHP
> MySQL
> Domain Reg.
> No unusual size or traffic requirements (now)
> 
> Pay by Check (my company will not allow the used of company credit cards
> over the Internet.)
> 
> Bruce Karstedt
> President
> Technology Consulting Associates, Ltd.
> Tel: 847-735-9488
> Fax: 847-735-9474
> 

--- End Message ---
--- Begin Message ---
I also work for a webhosting company, if you need corporate hosting, I can
help you there too.

Low rates, payable by check...

Fibre Optic pipe
Slackware 8.1
Apache 1.3.26
PHP 4.2.2
MySQL
Perl 1.27
POP3 Accounts
Admin console
FTP Access


Contact me on [EMAIL PROTECTED] if you're interested.
I'm the technician here, so I can answer any technical questions.  If you're
interested I'll pass you onto sales.

A colleague's working on the site at the moment, so god knows what's
happening to it...


Cheers,
Liam
----- Original Message -----
From: "Bruce Karstedt" <[EMAIL PROTECTED]>
To: "PHP - General List (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 10:40 AM
Subject: [PHP] Host


> Anyone care to recommend a host as follows:
>
> Unix
> PHP
> MySQL
> Domain Reg.
> No unusual size or traffic requirements (now)
>
> Pay by Check (my company will not allow the used of company credit cards
> over the Internet.)
>
> Bruce Karstedt
> President
> Technology Consulting Associates, Ltd.
> Tel: 847-735-9488
> Fax: 847-735-9474
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



--- End Message ---
--- Begin Message ---
Hi

I am very new to mysql, so any help please....

how to drop tables from a database from the command line

i have 6 tables in there, and need to be able to flush all the data out, (of
2 tables only) so there might be another way

Thanks

Trevor

--- End Message ---
--- Begin Message ---
Trevor ...

Do you want to drop the tables, or simply delete the data in them and retain
the table structure?

To delete data ...
    USE databasename;
    DELETE * FROM tablename;

To drop tables ...
    DROP TABLE [IF EXISTS] tablename1 [, tablename2,...] [RESTRICT |
CASCADE]

If you drop a table, then need to store data in it, you will have to
re-create it.

----- Original Message -----
From: "Trevor Tregoweth" <[EMAIL PROTECTED]>
To: "mysql" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, August 27, 2002 8:12 PM
Subject: Re: Command Line


Hi

I am very new to mysql, so any help please....

how to drop tables from a database from the command line

i have 6 tables in there, and need to be able to flush all the data out, (of
2 tables only) so there might be another way

Thanks

Trevor


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





--- End Message ---
--- Begin Message ---
if you just wanna delete everything from the tables you can do

DELETE FROM table_name;

for each table.  or you can do DROP table_name; for each one but then you
have to re-create each table that you drop with CREATe TABLE ( stuff here
);

Only use DROP table_name; if you know the structure of each table.  If you
need the table names do SHOW TABLES; and if you need their structure use
DESCRIBE table_name;

                        Adam

On Wed, 28 Aug 2002, Trevor Tregoweth wrote:

> Hi
>
> I am very new to mysql, so any help please....
>
> how to drop tables from a database from the command line
>
> i have 6 tables in there, and need to be able to flush all the data out, (of
> 2 tables only) so there might be another way
>
> Thanks
>
> Trevor
>
>
>

--- End Message ---
--- Begin Message ---

We have an immediate opening for an experienced web application
developer (read "guru") who meets or exceeds the following criteria:

Required skills (2.5+ years):

        - Large scale, highly available applications development on
Unix/Linux platform
        - PHP
        - Perl
        - SQL (Oracle, MySQL preferred)
        - D/HTML/Javascript/CSS
        - XML
        - OO programming
        - Source code control (CVS)

Desired skills:

        - Java/JSP
        - C/C++
        - Linux/Unix
        - Windows NT/2000/XP

Plusses:

        - Experience with Java web application servers -
Web(logic|sphere)
        - UML, RUP
        - strong understanding of various software development
          methodologies
        - Ability to work under pressure
        - Leadership ability

If you meet the requirements above, and are interested in working on
exciting projects with a strong DC area company, please send a cover
letter and resume with salary requirements to [EMAIL PROTECTED]

Thanks,


Alok K. Dhir
[EMAIL PROTECTED]
Symplicity Corporation
http://solutions.symplicity.com/

--- End Message ---
--- Begin Message ---
When I use foreach on a uninitialized array I get the following warning:

Warning:  Invalid argument supplied for foreach() in 
/www/htdocs/jc/cart/add_item.php on line 21

I would expect foreach to treat an unitialized variable as an empty 
array and hence do nothing. Is this the expected behaviour?

Thanks,

Jc

--- End Message ---
--- Begin Message ---
On Wed, 28 Aug 2002 12:53:45 +0900, you wrote:

>When I use foreach on a uninitialized array I get the following warning:
>
>Warning:  Invalid argument supplied for foreach() in 
>/www/htdocs/jc/cart/add_item.php on line 21
>
>I would expect foreach to treat an unitialized variable as an empty 
>array and hence do nothing. Is this the expected behaviour?

It's always been my experience.  I just get in a habit of doing this:

if(is_array($myvar)) foreach($myvar as $key => $value ) {
  ...
}
--- End Message ---
--- Begin Message ---
In a prior post, Rasmus Lerdorf said in response to implementing digest
authentication:

> we do not have digest auth support in PHP yet.

Is it not possible to manually implement digest authentication in PHP?  Or
does PHP preprocess the "Authorization" request header such that the
information is not retrievable from within the script?  I am guessing that
there are no issues in sending the "WWW-Authenticate" and
"Authentication-Info" response headers using the header() function.

Is digest just currently out of the question when using PHP or is it that I
just have to manually implement it?

---
Seairth Jacobs
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Hi folks,

I'm trying to send an XML request to a server to get its response 
back... I can get it to work on the command line (with passthru) but 
not with libcurl. I'm using libcurl 7.9.2 which may actually be 
different from the curl on the command line... the latter came with 
OS X, the former came from entropy.ch with the PHP package I 
installed. Of course my host is using 7.9.4 and the script doesn't 
work there either.

I've tried it with both GET and POST... here are some setup variables.

$testrequest = "$server?API=Rate&XML=<RateRequest USERID=\"$userid\" 
PASSWORD=\"$password\"><Package 
ID=\"0\"><Service>EXPRESS</Service><ZipOrigination>20770</ZipOrigination><ZipDestination>20852</ZipDestination><Pounds>10</Pounds><Ounces>0</Ounces><Container>None</Container><Size>REGULAR</Size><Machinable></Machinable></Package></RateRequest>";

$post['API']="Rate\n";
$post['XML']= "'<RateRequest USERID=\"$userid\" 
PASSWORD=\"$password\"><Package 
ID=\"0\"><Service>EXPRESS</Service><ZipOrigination>20770</ZipOrigination><ZipDestination>20852</ZipDestination><Pounds>10</Pounds><Ounces>0</Ounces><Container>None</Container><Size>REGULAR</Size><Machinable></Machinable></Package></RateRequest>'\n";

# (I've tried it with the 's and without, with the \n's and without)

$d1 = "API=Rate";
$d2 = "XML='<RateRequest USERID=\"$userid\" 
PASSWORD=\"$password\"><Package 
ID=\"0\"><Service>EXPRESS</Service><ZipOrigination>20770</ZipOrigination><ZipDestination>20852</ZipDestination><Pounds>10</Pounds><Ounces>0</Ounces><Container>None</Container><Size>REGULAR</Size><Machinable></Machinable></Package></RateRequest>'";

$ch = curl_init();

# doesn't work, returns Error 400
curl_setopt($ch, CURLOPT_URL, $testrequest);

# also doesn't work, returns BAD REQUEST
curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);

# what DOES work
passthru("curl -d " . $d1 . " -d " . $d2 . " $server");


Any ideas?

-Josh
--- End Message ---
--- Begin Message ---
I'm trying to get an apostrophe (and a dash, as well) to be 
included in a preg_match expression, but I don't know how to escape the 
characters. 

<?php
if (preg_match("^[!a-zA-Z-/\\\'/]^", $_POST['ssname']))  die
("<h5>Numbers and special characters not allowed in 'Surname'<br><br>
 Click 'Back' on your browser to re-enter
information.</h5>");

?>
Any help will be greatly appreciated.

Tia,
Andre
--- End Message ---
--- Begin Message ---
Hi All,

  I have an XML.  Using XSL How do i do grouping and counting in an efficient way.

  Thanks

karthikeyan.
--- End Message ---

Reply via email to