php-general Digest 4 Apr 2001 10:18:41 -0000 Issue 607

Topics (messages 46901 through 47007):

Referencing *only* programmer-created session vars
        46901 by: Johnson, Kirk

Cookies  and flash
        46902 by: abraxas.zaratustra.ulatina.ac.cr

Re: query 2 databases from one script
        46903 by: Fabian Raygosa
        46955 by: Plutarck
        46972 by: Jason Lotito
        46975 by: Dell Coleman

Slow running PHP
        46904 by: JCampbell
        46908 by: Steve Werby

Re: Validation Email in PHP programs
        46905 by: php3.developersdesk.com
        46910 by: Steve Werby
        46928 by: Manuel Lemos
        46930 by: Manuel Lemos
        46993 by: Renze Munnik

Re: column names
        46906 by: Steve Werby

Re: Change the filename sent via html header
        46907 by: Frank M. Kromann
        46938 by: Spunk S. Spunk III

IMAP Problem.
        46909 by: Richard Gordon

a PHP fucntion like window.confirm("Click OK to continue. Click Cancel to stop.");
        46911 by: Javier Morquecho Morquecho
        46995 by: Renze Munnik

Loading SQL files (not CSV) into mySQL
        46912 by: Andy Warwick
        46917 by: Mark Maggelet

Alphabetize array,.. please?
        46913 by: Brandon Orther
        46914 by: Peter Houchin
        46918 by: Mark Maggelet

Seeking PHP case studies
        46915 by: Michael Kimsal

Re: register_globals on or off?
        46916 by: Yasuo Ohgaki

Help Needed Please
        46919 by: Peter Houchin
        46933 by: David Robley
        46936 by: Peter Houchin
        46948 by: David Robley

Re: socket functions
        46920 by: Joseph Blythe
        47003 by: Yasuo Ohgaki

Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect
        46921 by: Daevid Vincent

Re: Java applet can't read PHP output !!
        46922 by: Peter Choynowski
        46944 by: Andrew Braund
        46962 by: Peter Choynowski

help, with parse
        46923 by: WD
        46924 by: WD

help with parse
        46925 by: WD
        46926 by: Jason Murray
        46927 by: Jason Murray
        46929 by: Wade DeWerff
        46931 by: Wade DeWerff
        46996 by: Renze Munnik
        47007 by: Harshdeep S Jawanda

Script Encodeing??? other than Zend.
        46932 by: Dallas K.
        46952 by: Michael Stearne

Re: file upload
        46934 by: Augusto Cesar Castoldi

PEAR
        46935 by: glenn
        46941 by: Matt Stone
        46943 by: Maxim Maletsky

Re: phpinfo unneeded...................... it worked
        46937 by: juang

PHP, MYSQL and Multiple Records   - AGAIN :<
        46939 by: Curtis

Re: Metabase Opinions
        46940 by: Manuel Lemos

error on last line of file (tearing hair out)
        46942 by: Justin French
        46945 by: Peter Houchin
        46947 by: Steve Werby
        46985 by: CC Zona

Re: How can i sent an html e-mail using mail()?
        46946 by: Jason Morehouse

measuring cpu time
        46949 by: Brian Hardwick
        46950 by: Plutarck
        46963 by: Chris Adams

Re: iODBC Mac OS X HOWTO
        46951 by: Michael Stearne

Re: Shell Programming with PHP, but where is the PHP?
        46953 by: Nuno Silva

Sneaky solution
        46954 by: Plutarck
        46964 by: Dallas K.
        46966 by: Les Neste
        46971 by: Plutarck
        46981 by: Chris Adams

Re: array in Session-Vars?
        46956 by: Plutarck

Re: sql looping problem??
        46957 by: Plutarck

testing
        46958 by: Wstsdblks.aol.com

Not important - Simple question about microsec()
        46959 by: SED
        46980 by: Chris Adams

Problem getting PHP 4 to work on Xitami Server on Windows NT
        46960 by: Wstsdblks.aol.com
        46973 by: Dell Coleman

Re: newbie@session - please help!
        46961 by: Plutarck

session_unregister and session_destroy
        46965 by: Jacky
        46968 by: Plutarck

pass variable to PHP
        46967 by: HK Woo
        46969 by: Plutarck
        46979 by: HK Woo
        46983 by: Plutarck

UDDI
        46970 by: Joseph Blythe

enclosing files into mail
        46974 by: Vlad

how to return strings from functions?
        46976 by: Vlad
        46977 by: David Robley
        46982 by: Jack Dempsey

Re: Bug in date() in version 4.0.4?
        46978 by: David Robley

Re: mysql
        46984 by: Plutarck

Sessions and <img src="...">
        46986 by: Lic. Rodolfo Gonzalez Gonzalez

previous and next actions
        46987 by: Angie Bauer
        46989 by: Angie Bauer

can't connect to mysql
        46988 by: Paul Juliano
        46991 by: Paul Juliano
        46992 by: B. van Ouwerkerk

Emails from database...
        46990 by: Dhaval Desai

read headers.
        46994 by: Geir Eivind Mork
        46997 by: Plutarck
        46999 by: Geir Eivind Mork
        47002 by: Andrew Braund

Oracle NVL equivalent for MySQL?
        46998 by: Dominick Vansevenant
        47006 by: Steve Werby

Session variables and register_global
        47000 by: Niklas Neumann

regexp question - extracting wanted ascii characters only?
        47001 by: Erick Papadakis

Re: problems with session_register()...
        47004 by: Yasuo Ohgaki

Monthly Drawing Winner!
        47005 by: news.mail.thecasino.com

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]


----------------------------------------------------------------------


I have register_globals on for some applications. This causes PHP to bring
all elements of the $HTTP_***_VARS arrays into the GLOBAL namespace.
Somehow, session_unset() does not unset these variables when it is called,
rather, it only unset()'s programmer-created session variables. I would like
to have a function that mimics session_unset(), except that it assigns
session variables to blank rather than unset()'s them (for security
reasons). Is there an *easy* way to access just the programmer-created
session variables? Even on the page where the variables are first
session_register()'d (so that they aren't yet in $HTTP_SESSION_VARS[])?

TIA

Kirk






 On Thu, 29 Mar 2001 [EMAIL PROTECTED] wrote:

 
 
 I'm having a problem with using cookies and flash.
 
 When I pointed that the problem was _with_ cookie and flash, is when I
 resolv the same program using a pure HTML interface.
 
 The exact problem, is that the session number, keep on changing when
 working with the flash interfase. This flash interfase, is not realising
 that it already has a session, a cookie, and a couple of varibles; and
 keep on creating again them every time it returns to the php code.
 
 Using a short example, lets say that I have a Flash that calls a php that
 executes a "print $session" when the user clicks on a flash button. Every
 time that the user clicks on the flash, the session variable keeps on
 changing.
 
 What I would like to know, if is some has had a similar problem, or point
 me in some direction where I can get some more information about working
 with cookie & flash.
 
 --
 Rodrigo Castro
 Universidad Latina de CR
  
 





It would help to know the database .... but in Mysql
you can just do this: if you connect to one databaseA, it is possible to
grab info from another databaseB by this format:
SELECT * FROM databaseA.TABLE
while at the same time running this query elsewhere in your functions
SELECT * FROM databaseB.TABLE
basically list thedatabase in front of the table, that should be it
Fabian

----- Original Message -----
From: "Michael Roark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 03, 2001 3:20 PM
Subject: [PHP] query 2 databases from one script


> I've a script has many functions in it all of which hit databaseA . I've
> added a new function which is to get data from databaseB how can I go
about
> this in one script when I try to connect to a database other than the one
> defined at the beginning of the script all the functions in the script
> break as if I am setting the wrong database at the top of the script. Any
> help would be greatly appreciated.
>
> Michael Roark
>
>
> --
> 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]





You might want to use the following function:

http://www.zend.com/manual/function.mysql-db-query.php



--
Plutarck
Should be working on something...
...but forgot what it was.


"Michael Roark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've a script has many functions in it all of which hit databaseA . I've
> added a new function which is to get data from databaseB how can I go
about
> this in one script when I try to connect to a database other than the one
> defined at the beginning of the script all the functions in the script
> break as if I am setting the wrong database at the top of the script. Any
> help would be greatly appreciated.
>
> Michael Roark
>
>
> --
> 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]
>






> "Michael Roark" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I've a script has many functions in it all of which hit databaseA . I've
> > added a new function which is to get data from databaseB how can I go
> about
> > this in one script when I try to connect to a database other
> than the one
> > defined at the beginning of the script all the functions in the script
> > break as if I am setting the wrong database at the top of the
> script. Any
> > help would be greatly appreciated.
> >
> > Michael Roark

I know this is not the direction you wanted to go, however, I have an
important question.  Why would you need 2 databases?  What is the stucture,
what are you trying to accomplish with the script, and why the need for 2
databases?

This sounds more like poor database design, and if solved, would avoid such
problems.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.







Hi

You dont say which db you are using, but I assume MYSQL

This may work -
When you log onto the second database it must be a different user (not all
root for example)
make sure you capture the database handle in two different variables


something like

$db1=mysql_connect($blah1,$blah2,$blah3);
$db2=mysql_connect($blah4,$blah5,$blah6);
 would be close

HTH

-----Original Message-----
From: Jason Lotito [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 1:06 AM
To: Plutarck; [EMAIL PROTECTED]
Subject: RE: [PHP] query 2 databases from one script


> "Michael Roark" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I've a script has many functions in it all of which hit databaseA . I've
> > added a new function which is to get data from databaseB how can I go
> about
> > this in one script when I try to connect to a database other
> than the one
> > defined at the beginning of the script all the functions in the script
> > break as if I am setting the wrong database at the top of the
> script. Any
> > help would be greatly appreciated.
> >
> > Michael Roark

I know this is not the direction you wanted to go, however, I have an
important question.  Why would you need 2 databases?  What is the stucture,
what are you trying to accomplish with the script, and why the need for 2
databases?

This sounds more like poor database design, and if solved, would avoid such
problems.

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.



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





This is going to be a silly question. I have written the following form to mail 
script, and it works. But it takes a good minute or so to process. Can any one shed 
some light?

I think it may have to do with the gethostbyaddr($REMOTE_ADDR) but if anyone else can 
help, that would be great.

Jon


<?php

if ($REQUEST_METHOD !="POST"){

 echo "<h1>Something unexpected happened</h1><br><br>User: There is nothing you can 
do<br>";
 echo "<br>Webmaster: You can only call this script with 'POST'";

} else {

 $datevar = date("F j, Y");
 $timevar = date("g:i a T");                 
 $message .= "The following message was received from $HTTP_REFERER\non $datevar at 
$timevar\n\n";

 if ($incall!=""){
  $allvars = explode(",",$incall);
   $incto = $allvars[0];
   $incsubject = $allvars[1];
   $incurl = $allvars[2];
   $incfrom = $allvars[3];
   $incinfo = $allvars[4];
 }
 
 if ($incinfo > 0 ){
  $message .= "User's IP Address: $REMOTE_ADDR\n";
 }

 if ($incinfo > 1 ){
  $message .= "User's Browser: $HTTP_USER_AGENT\n";
 }

 if ($incinfo > 2 ){
  $resolvedhost = gethostbyaddr($REMOTE_ADDR);
  $message .= "User's Host Name: $resolvedhost\n";
 }
  $message .= "\n";
 
 while(list($key,$val)=each($HTTP_POST_VARS)) {

  //DO NOT PRINT SYSTEM VARIABLES
  if(($key=="incto")  ||($key=="incsubject")||($key=="incurl")||($key=="incfrom")){
  }elseif(($key=="incinfo")||($key=="incall")){

  //PRINT ALL OTHER VARIABLES
  }else{
  $message .= "$key:     $val\n\n";
  }
  
 }

 if ($incto==""){
  echo "<h1>Something unexpected happened</h1><br><br>User: There is nothing you can 
do<br>";
  echo "<br>Webmaster: You did not specify an e-mail address to receive this message";
 }

 if ($incfrom==""){
  $incfrom = "From: jcMail@$SERVER_NAME";
 } else {
  $incfrom = "From: $incfrom";
 }

 if ($incsubject==""){
  $incsubject = "Message from jcMail: $datevar $timevar";
 }

 if ($incurl==""){
  $incurl = "$HTTP_REFERER";
 }
 
 $message .="=--\nThis message brought to you by jcMail!";

 mail("$incto", "$incsubject", $message, "$incfrom");
 echo "<html><head><title>Sending...</title>";
 echo "<META HTTP-EQUIV='refresh' content='0;URL=$incurl'></HEAD><BODY>";
 echo "Your message has been sent<br><a href='$url'>If you are not automatically 
redirected, click here</a>";

}
?>




"JCampbell" <[EMAIL PROTECTED]> wrote:
> I think it may have to do with the gethostbyaddr($REMOTE_ADDR)

Why not try commenting out the line with that function and reporting back
whether the performance changes.

> $resolvedhost = gethostbyaddr($REMOTE_ADDR);

You're not using $resolvedhost anywhere in the script so why are you
defining it?

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





Addressed to: "Steve Werby" <[EMAIL PROTECTED]>
              <[EMAIL PROTECTED]>

** Reply to note from "Steve Werby" <[EMAIL PROTECTED]> Tue, 3 Apr 2001 
15:24:29 -0400
>
>
> I should have said there's no *reliable* way to check whether an email
> address on an external server is valid.

There is one _reliable_ way to verify the email address is valid.

Generate a random password then send it to the email address they give
you. Then pop up a page that tells them to check their email for the
password.  I include the user name and a link to the site in the email I
generate.

No email address - no password - no access.





Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




<[EMAIL PROTECTED]> wrote:
> ** Reply to note from "Steve Werby" <[EMAIL PROTECTED]> Tue, 3 Apr
2001 15:24:29 -0400
> >
> >
> > I should have said there's no *reliable* way to check whether an email
> > address on an external server is valid.
>
> There is one _reliable_ way to verify the email address is valid.
>
> Generate a random password then send it to the email address they give
> you. Then pop up a page that tells them to check their email for the
> password.  I include the user name and a link to the site in the email I
> generate.

You got me.  <smile>  I think the original poster wanted a method to
validate an email address through a PHP script only with no human
intervention.  If that's not required your method certainly is a good one if
the user just entered the data and is patient enough to wait for the email.
You could even add a random code to the query string of the URL you email
and activate the user's record in a database after the the webpage with that
exact URL is viewed - saves typing in the password.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





Hello,

Sharat Hegde wrote:
> 
> Hello,
> 
> I am trying to validate the email address in my PHP program using the ereg
> function. I have different combinations of regular expressions to get the
> chunks of the email substring before and after the @ symbol and the dot (.)
> character. However, this does not seem to work.
> 
> Can anyone suggest a method using ereg or otherwise to validate the email
> address in a PHP program?

This PHP class does all you need:

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

Manuel Lemos




Hello,

Steve Werby wrote:
> > Only thing left is whether or not
> > the user exists on the given mailserver. But for as far as I know
> > you can't automatically check that.
> 
> Renze is correct.  Unless you're checking local email addresses which you
> control, there's no way to check down to that level.  And be happy there
> isn't.  Otherwise the amount of spam you get right now will increase ten
> fold.

That is not accurate. Although it is not guaranteed that you can verify
if a given e-mail address is valid, there are many circunstances that
you can verify that an e-mail is invalid because the end SMTP server
rejects messages sent to them. For many circunstances this is good
enough, because it is better than not verifying an address at all.

My experience while developing the PHP Classes site is that despite
there is a notice in the subscribe page that the users need to supply a
valid reachable address or else they won't be able to choose their
password to login, still many try to supply invalid addresses in the
hope to fool the system. It's pointless for those people but still many
try.

With my PHP e-mail address validation class I reduced the ammount of
trash subscriptions that users managed to create in the early days of
the site. Although it is not a perfect solution, that was worth a lot.

Manuel Lemos




[EMAIL PROTECTED] wrote:
> 
> Addressed to: "Steve Werby" <[EMAIL PROTECTED]>
>               <[EMAIL PROTECTED]>
> 
> ** Reply to note from "Steve Werby" <[EMAIL PROTECTED]> Tue, 3 Apr 2001 
>15:24:29 -0400
> >
> >
> > I should have said there's no *reliable* way to check whether an email
> > address on an external server is valid.
> 
> There is one _reliable_ way to verify the email address is valid.
> 
> Generate a random password then send it to the email address they give
> you. Then pop up a page that tells them to check their email for the
> password.  I include the user name and a link to the site in the email I
> generate.
> 
> No email address - no password - no access.
> 
> Rick Widmer
> Internet Marketing Specialists
> http://www.developersdesk.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]


Just for the record... You guys aren't validating an email-address.
You just send something to an address some gives. If the mail
doesn't arrive.... bad luck for that guy. That's no way of
validating an address. That's just sending an email to whatever
address someone gives. Realy validating the address is checking
whether or not it exists _WITHOUT_ sending an email. Sometimes you
just have to live with those things that aren't possible.... like
quickly and savely validating an email-address.

Like Steve and I already posted; you can check the domain and that's
it.

Everything that goes beyond that is just trail-and-error checking.
That's not the way. E.g. if you have some site and you want to
collect marketing information you want the email-addresses to be
correct. But _noone_ will ever fill out some form -> check his mail
-> come back to a given URL -> and validate some password. That's
only a possibility for sites where people can create an account of
some sort. When it just concerns some visitor information, there is
no reliable way of checking the complete address. Just like e.g. the
first- and lastname of the visitor. You just _cannot_ check that!
-- 

* R&zE:

***************************
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***************************




"Mauricio Junqueira" <[EMAIL PROTECTED]> wrote:
> does anyone knows how to retrive information about the columns names of a
> table?

In MySQL use mysql_field_name(), in PostgreSQL use pg_fieldname().

> I know that is possible to use show table mytable using isql but
> I need to get information about the columns using sql.
> that information is to be accessed with a php script. so, I'm looking
> for something resembling "select info from table...."

Check the online manual for more functions and other databases.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/






You can use something like this:

<?PHP
$strMimeType = "image/gif"æ
$strName = "myfile.gif";
$iFileSize = filesize($strName);

Header("Content-Type: $strMimeType; name=\"$strName\"");
Header("Content-Length: $iFileSize";
Header("Content-Disposition: inline; filename=\"$strName\"");
readfile($strName);
?>

this will change the mime type and filename of the content send to the browser.

- Frank

> On 4/3/01 12:34 PM, "Spunk S. Spunk III" <[EMAIL PROTECTED]> wrote:
> 
> > I've got a script that returns a smil file in a header but I'd like to
> > change the name of the file. The file is sent as blah.php (even though it is
> > a smil file) but I'd like to be able to name it something like blah.sml. Is
> > there a way to do this?
> > 
> > Spunk
> > 
> If you are using include() to send the file in the header, then it doesn't
> matter WHAT the extension is. All files sent through include() are parsed as
> if they were PHP, with or without the php extension. So, as long as nothing
> in your smil file looks like php, then it will just get passed through (as
> if it were html).
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 







Okay,
So here's what it looks like now:

header("Content-type: application/x-quicktimeplayer");
header("Content-Disposition: attachment; filename=blah.qtl" );
print(GenerateSMILAlbum($baseURL, $directory, $mp3Array, $albumCover));

This gets me two download dialogs on windows machines if I select "Open in
Place" and does not rename the file to blah.qtl when downloaded on a Mac...

Any suggestions? Thanks for the comments...

Spunk





I am having a problem getting php4.0.4pl1 to work will imap on my Mandrake 
7.2 linux system.
I am configuriging the system using the following configure options :-

./configure --with-apxs       \
            --with-oci8       \
            --without-mysql   \
            --with-pgsql      \
            --with-imap       \
            --with-ldap      

I have followed the instructions about c-client and have tried upgrading to 
imap-2000c and even imap-2001beta packages from ftp.cac.washington.edu/imap/

Evering seems to compile and install OK but when I try to start apache I 
get the following message :-

Cannot load /etc/httpd/modules/libphp4.so into server: 
/etc/httpd/modules/libphp4.so: undefined symbol: mxdriver

Any help would be appreciated.

-- 
Thanks,

Richard





        Is there an PHP equivalent to the javascript:
 $x= window.confirm("Click OK to continue. Click Cancel to stop.");

  if ($x)....

Thanks....




Javier Morquecho Morquecho wrote:
> 
>         Is there an PHP equivalent to the javascript:
>  $x= window.confirm("Click OK to continue. Click Cancel to stop.");
> 
>   if ($x)....
> 
> Thanks....
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


Ehhhh.... No!

PHP is server-side. Using PHP you can't do that. Only thing you can
do is have PHP generate the JavaScript that calls window.confirm().
-- 

* R&zE:

***************************
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***************************




I'm after some pointers on how to dump and load SQL files to and from mySQL
using a PHP/HTML form.

I've read the manual about "LOAD DATA INFILE", but as far as I can tell that
won't help in this case. Unfortunately, CSV files are not an option
(client's demands... go figure).

What I'm after is dumping/uploading SQL files of the form:

==========================================================
#
# PHP/MySQL Demo - Table Dump
# --------------------------------------------------------

#
# Structure
#

DROP TABLE IF EXISTS demo;
CREATE TABLE demo (
   id tinyint(2) unsigned zerofill NOT NULL auto_increment,
   name char(50) NOT NULL,
   logo_url char(50) NOT NULL,
   page_colour char(6) DEFAULT 'FFFFFF' NOT NULL,
   last_order datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   PRIMARY KEY (id),
   KEY id (id),
   UNIQUE id_2 (id)
);

#
# Data
#

INSERT INTO demo (id, name, logo_url, page_colour, last_order) VALUES (
'01', 'CompanyName', 'logo.gif', '99CCFF', '2001-04-06 13:21:31');
==========================================================

Complete with table creation and data inserts. In effect, it needs to be
standalone text files full of SQL commands.

I know it can be done, because phpMyAdmin has exactly this facility. But
even after studying the code of that carefully, I can't tell which specific
pieces are handling this enough to extract the facility.

Can anyone point me, or is willing to donate, any articles/code snippets/etc
that will help.

TIA

Andy Warwick





I think you want:
exec("/path/to/mysql -p$password -u$username $database < $filename");

On Wed, 04 Apr 2001 00:35:34 +0100, Andy Warwick
([EMAIL PROTECTED]) wrote:
>I'm after some pointers on how to dump and load SQL files to and
>from mySQL
>using a PHP/HTML form.
>
>I've read the manual about "LOAD DATA INFILE", but as far as I can
>tell that
>won't help in this case. Unfortunately, CSV files are not an option
>(client's demands... go figure).
>
>What I'm after is dumping/uploading SQL files of the form:
>
>==========================================================
>#
># PHP/MySQL Demo - Table Dump
># --------------------------------------------------------
>
>#
># Structure
>#
>
>DROP TABLE IF EXISTS demo;
>CREATE TABLE demo (
>   id tinyint(2) unsigned zerofill NOT NULL auto_increment,
>   name char(50) NOT NULL,
>   logo_url char(50) NOT NULL,
>   page_colour char(6) DEFAULT 'FFFFFF' NOT NULL,
>   last_order datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
>   PRIMARY KEY (id),
>   KEY id (id),
>   UNIQUE id_2 (id)
>);
>
>#
># Data
>#
>
>INSERT INTO demo (id, name, logo_url, page_colour, last_order)
>VALUES (
>'01', 'CompanyName', 'logo.gif', '99CCFF', '2001-04-06 13:21:31');
>==========================================================
>
>Complete with table creation and data inserts. In effect, it needs
>to be
>standalone text files full of SQL commands.
>
>I know it can be done, because phpMyAdmin has exactly this facility.
>But
>even after studying the code of that carefully, I can't tell which
>specific
>pieces are handling this enough to extract the facility.
>
>Can anyone point me, or is willing to donate, any articles/code
>snippets/etc
>that will help.
>
>TIA
>
>Andy Warwick
>
>
>--
>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: php-list-
>[EMAIL PROTECTED]






Hello,

I have an array from an ftp nlist.  Is there any way I can alphabetize the
array?

thanks,
Brandon





have a look on zend.com saw some Alphabetical scripts in there just b4

-----Original Message-----
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 9:45 AM
To: PHP User Group
Subject: [PHP] Alphabetize array,.. please?


Hello,

I have an array from an ftp nlist.  Is there any way I can alphabetize the
array?

thanks,
Brandon


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





On Tue, 03 Apr 2001 16:44:36 -0700, Brandon Orther
([EMAIL PROTECTED]) wrote:
>Hello,
>
>I have an array from an ftp nlist.  Is there any way I can
>alphabetize the
>array?

sort($array);





Hello.

I posted something about this a few days ago, and am
reiterating my request again.  We're looking for
PHP case studies that we can use in an upcoming project.
Interested parties should contact me directly at [EMAIL PROTECTED]

and we'll give you more information at that point.

Thanks.  :)






Refer to the PHP Manual for details. http://www.php.net/manual/en/language.variables.external.php The Manual is worth to read :) (Don't forget to read FAQ also, it seems FAQ is updated recently) Regards, -- Yasuo Ohgaki ""hi"" <[EMAIL PROTECTED]> wrote in message 9acn9h$bgp$[EMAIL PROTECTED]">news:9acn9h$bgp$[EMAIL PROTECTED]... > Hi, > > Could someone explain what the following passage in php.ini means: > > You should do your best to write your scripts so that they do not require > ; register_globals to be on; Using form variables as globals can easily > lead > ; to possible security problems, if the code is not very well thought of. > > If register_globals is off, does that mean you cannot access form variables > by just referring to their name? And, if that is so, how do you pass > information from forms to your action script? > > > > -- > 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] >



Hiya i've got a script that basically draws values from a db and will display them, as 
i have multiple records in there and want to display them all i'm using a 
while ( ($myrow = mysql_fetch_array($result) ) ) 
statement this is all good as far as it will display them all how ever when i go to 
update the fields i get id=++ instead of the actual id value ie 1, 2, 3, etc ..

any suggestions would be apreciated 

Peter Houchin
[EMAIL PROTECTED]

<snip> 
$rs = "UPDATE main SET system='$system',"; 
$rs .= "part='$part',"; 
$rs .= "monthly='$monthly',"; 
$rs .= "WHERE id=$id"; 


$result = mysql_query($rs,$db); 
?> 
<form name="update" method="get" action="../../ben.php"> 
<? 
$foo = "SELECT * FROM main"; 

$result = mysql_query($foo); 
while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 

$id = $myrow["id"]; 
$system = $myrow["system"]; 
$part = $myrow["part"]; 
$config = $myrow["monthly"]; 

?> 
<!--form elements with echo on $myrow, and id hidden--> 
<? 
} 
?> 
<input type="submit" name="submit" value="Submit">
<snip>





On Wed,  4 Apr 2001 09:27, Peter Houchin wrote:
> Hiya i've got a script that basically draws values from a db and will
> display them, as i have multiple records in there and want to display
> them all i'm using a 
 while ( ($myrow = mysql_fetch_array($result) ) )
> statement this is all good as far as it will display them all how ever
> when i go to update the fields i get id=++ instead of the actual id
> value ie 1, 2, 3, etc ..
 
> any suggestions would be apreciated 
> 
> Peter Houchin
> [EMAIL PROTECTED]
> 
> <snip> 
> $rs = "UPDATE main SET system='$system',"; 
> $rs .= "part='$part',"; 
> $rs .= "monthly='$monthly',"; 
> $rs .= "WHERE id=$id"; 
> 
> 
> $result = mysql_query($rs,$db); 
> ?> 
> <form name="update" method="get" action="../../ben.php"> 
> <? 
> $foo = "SELECT * FROM main"; 
> 
> $result = mysql_query($foo); 
> while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 
> 
> $id = $myrow["id"]; 
> $system = $myrow["system"]; 
> $part = $myrow["part"]; 
> $config = $myrow["monthly"]; 
> 
> ?> 
> <!--form elements with echo on $myrow, and id hidden--> 

This ^^^^ might be the place to start - what do you get when you view the 
source??

> <? 
> } 
> ?> 
> <input type="submit" name="submit" value="Submit">
> <snip>

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA




> 
> <snip> 
> $rs = "UPDATE main SET system='$system',"; 
> $rs .= "part='$part',"; 
> $rs .= "monthly='$monthly'"; 
> $rs .= "WHERE id='$id'"; 
> 
> 
> $result = mysql_query($rs,$db); 
> ?> 
> <form name="update" method="get" action="../../ben.php"> 
> <? 
> $foo = "SELECT * FROM main"; 
> 
> $result = mysql_query($foo); 
> while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 
> 
> $id = $myrow["id"]; 
> $system = $myrow["system"]; 
> $part = $myrow["part"]; 
> $config = $myrow["monthly"]; 
> 
> ?> 
> <!--form elements with echo on $myrow, and id hidden--> 

This ^^^^ might be the place to start - what do you get when you view the 
source??

> <? 
> } 
> ?> 
> <input type="submit" name="submit" value="submit">
> <snip>

i get all id numbers for the records in the hidden id fields as well as all data that 
was originally in the db ...

just a thought when i do a print $rs; i get this  

UPDATE main SET system='A33',part='cpu/mem',monthly='6000'WHERE id=''

 which is that last record in the db .. so for some reason it's not picking up any id 
numbers :<




On Wed,  4 Apr 2001 11:23, Peter Houchin wrote:
> > 
> > <snip> 
> > $rs = "UPDATE main SET system='$system',"; 
> > $rs .= "part='$part',"; 
> > $rs .= "monthly='$monthly'"; 
> > $rs .= "WHERE id='$id'"; 
> > 
> > 
> > $result = mysql_query($rs,$db); 
> > ?> 
> > <form name="update" method="get" action="../../ben.php"> 
> > <? 
> > $foo = "SELECT * FROM main"; 
> > 
> > $result = mysql_query($foo); 
> > while ( ($myrow = mysql_fetch_array($result,$db) ) ) { 
> > 
> > $id = $myrow["id"]; 
> > $system = $myrow["system"]; 
> > $part = $myrow["part"]; 
> > $config = $myrow["monthly"]; 
> > 
> > ?> 
> > <!--form elements with echo on $myrow, and id hidden--> 
>
> 
> This ^^^^ might be the place to start - what do you get when you view
> the 
 source??
> 
>
> > <? 
> > } 
> > ?> 
> > <input type="submit" name="submit" value="submit">
> > <snip>
>
> 
> i get all id numbers for the records in the hidden id fields as well as
> all data that was originally in the db ...
 
> just a thought when i do a print $rs; i get this  
> 
> UPDATE main SET system='A33',part='cpu/mem',monthly='6000'WHERE id=''
> 
>  which is that last record in the db .. so for some reason it's not
> picking up any id numbers :<

OK - how are you passing (or trying to pass) the value for id? When I do 
this, I usually show the ID for each record as a link, and pass the ID 
via the link.

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA






Joseph Blythe wrote:

> hello,
> 
> does anyone know if set_nonblock() works, what paramaters it takes 
> and  what it returns?
> 
> there is only one mention of it in the manual under accept_connect, 
> and  I can not seem to  set the socket to non block??
> 
> also has anybody successfully written a way to time out a read with 
> the  new socket fuctions I can not get this to work eithier.
> 
> any help would be appreciated,
> 
> regards,
> 
> joseph

Well after no response from this list I can assume that this function is 
indeed dead, I had to go back to the generic network functions to get a 
non blocking socket to work and be able to wrap a loop around the socket 
read to time it out after so many seconds. If anyone knows any different 
please let me know.

Regards

Joseph







Did you read the Manual?

>From PHP Manual
=========
socket_set_blocking

Description
int socket_set_blocking (int socket descriptor, int mode)

If mode is false, the given socket descriptor will be switched to non-blocking
mode, and if true, it will be switched to blocking mode. This affects calls like
fgets() that read from the socket. In non-blocking mode an fgets() call will
always return right away while in blocking mode it will wait for data to become
available on the socket.
This function was previously called as set_socket_blocking() but this usage is
deprecated.
=========

There is note that says it does not work with PHP4/Win32. I may need to check
BugDB to find out status of this problem.

I compile with --enable-sockets, so I don't know if it available without it.

Regards,
--
Yasuo Ohgaki


"Joseph Blythe" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Joseph Blythe wrote:
>
> > hello,
> >
> > does anyone know if set_nonblock() works, what paramaters it takes
> > and  what it returns?
> >
> > there is only one mention of it in the manual under accept_connect,
> > and  I can not seem to  set the socket to non block??
> >
> > also has anybody successfully written a way to time out a read with
> > the  new socket fuctions I can not get this to work eithier.
> >
> > any help would be appreciated,
> >
> > regards,
> >
> > joseph
>
> Well after no response from this list I can assume that this function is
> indeed dead, I had to go back to the generic network functions to get a
> non blocking socket to work and be able to wrap a loop around the socket
> read to time it out after so many seconds. If anyone knows any different
> please let me know.
>
> Regards
>
> Joseph
>
>
>
>
> --
> 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]
>





So close and yet so far away... is there an "odbcping" type program? If we
run "odbcping" on the SQL2000 server, it works fine (to itself of course,
but using the ODBC settings AFAIK).

[root=pts/1]2:08pm@content:{/usr/local/openlink/bin}> setenv
        LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib
        ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini
        ODBCINI=/usr/local/openlink/bin/odbc.ini

[root=pts/1]2:08pm@content:{/usr/local/openlink/bin}> cat odbc.ini
        [ODBC Data Sources]
        OpenLink       = OpenLink Generic ODBC Driver
        TattooReader   = Tattoo Database on SQL2000 server

        [TattooReader]
        Driver          = /usr/local/openlink/lib/oplodbc.so.1
        Description     = TattooReader
        Host            = 10.2.3.11
        ServerType      = SQLServer 2000
        FetchBufferSize = 99
        UserName        = Tattoo_reader
        Password        = a4w59
        Database        = wt_updater_checkin
        ServerOptions   =
        ConnectOptions  =
        Options         =
        ReadOnly        = yes
        Trace           = 0
        TraceFile       = /tmp/iodbc.trace

        [OpenLink]
        Driver          = /usr/local/openlink/lib/oplodbc.so.1
        Description     = Sample OpenLink DSN
        Host            = 10.2.3.11
        ServerType      = SQLServer 2000
        FetchBufferSize = 99
        UserName        = Tattoo_reader
        Password        = a4w59
        Database        = wt_updater_checkin
        ServerOptions   =
        ConnectOptions  =
        Options         =
        ReadOnly        = yes
        Trace           = 0
        TraceFile       = /tmp/iodbc.trace

        [Default]
        Driver = /usr/local/openlink/lib/oplodbc.so.1

[root=pts/1]2:08pm@content:{/usr/local/openlink/bin}> cat odbcinst.ini
        [ODBC Drivers]
        OpenLink Generic ODBC Driver = Installed
        TattooReader = Installed

        [OpenLink Generic ODBC Driver]
        Driver = /usr/local/openlink/lib/oplodbc.so.1
        Setup  = /usr/local/openlink/lib/oplodbc.so.1

        [TattooReader]
        Driver = /usr/local/openlink/lib/oplodbc.so.1
        Setup  = /usr/local/openlink/lib/oplodbc.so.1


[root=pts/3]3:59pm@content:{/usr/local/openlink/bin}> ./odbctest
OpenLink ODBC Demonstration program
This program shows an interactive SQL processor
Enter ODBC connect string (? shows list): ?
DSN                            | Description
---------------------------------------------------------------
OpenLink                       | OpenLink Generic ODBC Driver
TattooReader                   | Tattoo Database on SQL2000 server

Enter ODBC connect string (? shows list): DSN=TattooReader
select * from blah



exit

the only way to exit this is to kill the process, "exit" doesn't work.
So, I'm not getting any errors anymore, but it's not doing anything either.

Now we haven't ruled out the firewall as a possible problem here, however I
can:
[root=pts/3]3:59pm@content:{/usr/local/openlink/bin}> telnet 10.2.3.11 1433
Trying 10.2.3.11...
Connected to 10.2.3.11.
Escape character is '^]'.
^[
^[^[
^[^[^[
^[^[
^[
^[
but as you can see, ^] doesn't Escape. In fact, the only way to stop it is
to kill the telnet process from another shell. SHOULD I be able to do
anything from the telnet prompt? Like with HTTP, you can get it to spew out
a web page, is there some command to run to make sure the connection is all
good in both directions?

[root=pts/2]4:03pm@content:{/root}> netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 xxx.xxx.xxx.xxx:1096     10.2.3.11:1433
ESTABLISHED

notice that the ports don't line up. should they? my MIS guy says that's
normal and there's just a pool of ports the OS picks from and will 'map'
them correctly (in lay terms).

and FWIW, the PHP example STILL segfaults. I would expect it to through up
an error, not segfault... that can't be good can it?

daevid.com

> -----Original Message-----
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 8:08 PM
> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General
> Subject: Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect
>
>
> Daevid,
>
>
> connection script snipped (looked fine)
>
> > $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini
>
> > //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","","");
> > ?>
> > ----------------------
> >
> > [OpenLink]
> > Driver          = /usr/local/openlink/lib/oplodbc.so.1
> > Description     = Sample OpenLink DSN
> > Host            = 10.2.3.11
> > ServerType      = Oracle 8.1.x
> > FetchBufferSize = 99
> > UserName        = daevid
> > Password        = secret
> > Database        = mydatabase
> > ServerOptions   =
> > ConnectOptions  =
> > Options         =
> > ReadOnly        = yes
> > Trace           = 0
> > TraceFile       = /tmp/iodbc.trace
> >
> > [Default]
> > Driver = /usr/local/openlink/lib/oplodbc.so.1
> >
> > Is "ServerType = Oracle 8.1.x" right?
> > I'm trying to connect to a MS SQL2000 server on a Win2k box:
>
> No, that is just a sample DSN - you will want to edit it to match your
> configureation or add an additional one wiht server type SQLServer 2000
> Database is the sqlserver catalog, e.g. northwind, pubs, or yours.
>
> When adding a DSN, add a matching section at the top as well:
>
> [ODBC Data Sources]
>     OpenLink       = OpenLink Generic ODBC Driver //o
>     SQLServer2k
>
> [SQLServer2k]
> Driver          = /usr/local/openlink/lib/oplodbc.so.1
> Host            = 10.2.3.11
> FetchBufferSize = 99
> ServerType      = SQLServer2000
> UserName        = daevid
> Password        = secret
> Database        = mydatabase
>
> You can add the other options as you see fit, or even override these by
> setting the RulesBook on the server side.
>
> Everything else looks fine.
>
> This assumes you have the server-side components of our Multi-Tier driver
> installed on the SQLServer box.  It might be wise to add a DSN on
> the server
> using the OpenLink driver, to test you have the server-side components
> installed properly.
>
> If you've not yet installed them, the SQLServer agent / Request Broker
> components are at: http://www.openlinksw.com/software/open40/ntadmzzz.zip
>
> Checking the docs out for configuring OpenLink Drivers might not hurt
> either, and might have saved you time setting up your initial connection:
> http://www.openlinksw.com/info/docs/rel4doc/index.html
> >
> > [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbcinst.ini
> > [ODBC Drivers]
> > OpenLink Generic ODBC Driver = Installed
> >
> > [OpenLink Generic ODBC Driver]
> > Driver = /usr/local/openlink/lib/oplodbc.so.1
> > Setup  = /usr/local/openlink/lib/oplodbc.so.1
> >
> > [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> ./odbctest
> > OpenLink ODBC Demonstration program
> > This program shows an interactive SQL processor
> >
> > Enter ODBC connect string (? shows list): ?
> >
> > DSN                            | Description
> > ---------------------------------------------------------------
> > OpenLink                       | OpenLink (MT)
> >
> > Enter ODBC connect string (? shows list): OpenLink
> > [iODBC][Driver Manager]Dialog failed, SQLSTATE=IM008
>
> Syntax problem here - odbctest takes the argument "DSN=DSN_Name", not just
> the DSN_Name
> >
> > Have a nice day.
> >
>
> You obviously have the ODBCINI set properly in the environmnet,
> or odbctest
> wouldn't show your DSNs.
>
> So fix the ServerType, ensure working server-side components, and change
> your connection syntax for odbctest - you actually are just about there.
>
> Let me know if you need additional assistance.
>
> Best regards,
> Andrew
> ---------------------------------------
> Andrew Hill - OpenLink Software
> Director Technology Evangelism
> eBusiness Infrastructure Technology
> http://www.openlinksw.com
>






I have tried putting \n and a header command with no help.  My current
theory is that php is manipulating the socket options in some way,
making Java drop the connection ( since Perl or sh CGI script works with
the same Java code).  I have tried to modify the applet to use read
method in place of readLine with the same results - it reads fine from
Perl or SH but not from PHP - I have written a large quantity of PHP
code and want to stick to using only PHP ( makes support easier ).  My
last option is running a tcpdump on the connection and see what is
flowing on the cable and look for differences, or looking through code
and trying to find the php - apache interface code  :-(

Bye,
Peter





Works for me!
I don't think PHP is the problem.
I first tried this with PHP as cgi and it worked fine, then retested
with PHP as module and still worked fine.

Platform;
NT4 SP6
Server Version: Apache/1.3.19(Win32) mod_jk PHP/4.0.4pl1 DAV/1.0.2

applet code;
======================8<================================
package testrd;

import java.applet.*;
import java.io.*;
import java.net.*;

public class Applet1 extends Applet {

  public Applet1() {
  }

  public void init() {
    try {

      String line;
      URL u=new URL("http://192.168.0.22/tst.phpm");
      URLConnection uc=u.openConnection();
      DataInputStream d=new DataInputStream(uc.getInputStream());
      while ( (line=d.readLine()) != null ) {
        System.out.println(line);
      }
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
}
======================8<================================

tst.php;
======================8<================================
<?php
   print "some module text ...\n";
   print "some more text ...\n";
?>
======================8<================================



> -----Original Message-----
> From: Peter Choynowski [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 4 April 2001 10:09
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Java applet can't read PHP output !!
>
>
>
> I have tried putting \n and a header command with no help.
> My current
> theory is that php is manipulating the socket options in some way,
> making Java drop the connection ( since Perl or sh CGI
> script works with
> the same Java code).  I have tried to modify the applet to use read
> method in place of readLine with the same results - it
> reads fine from
> Perl or SH but not from PHP - I have written a large quantity of PHP
> code and want to stick to using only PHP ( makes support
> easier ).  My
> last option is running a tcpdump on the connection and see what is
> flowing on the cable and look for differences, or looking
> through code
> and trying to find the php - apache interface code  :-(
>
> Bye,
> Peter
>
>
> --
> 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]
>






Andrew - thanks for testing it - I have done more tests, and yes it does
look like the minimal Java code does work in my setup ( Linux, Apache
1.3.19, php 4.04pl1 ) - now I have to understand why my additional Java
code to make it into a POST type connection is throwing an exception :-(

Bye,
Peter





this code isnt parsing like I expect..

<?php 
if ($HTTP_USER_AGENT = "Mozilla")
{
print ("This site best viewed with IE 4 or
better!\n");
print ("<center>\n");
print ("<a href='http://www.microsoft.com'>\n");
print ("<img src='lgoIE.gif'></a>\n");
print ("</center>\n");
}
?>


heres what is result in IE...which shouldnt show up at
all...

\n"); print ("\n"); print ("\n"); print ("
\n"); } ?> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




this code isnt parsing like I expect..

<?php 
if ($HTTP_USER_AGENT = "Mozilla")
{
print ("This site best viewed with IE 4 or
better!\n");
print ("<center>\n");
print ("<a href='http://www.microsoft.com'>\n");
print ("<img src='lgoIE.gif'></a>\n");
print ("</center>\n");
}
?>


heres what is result in IE...which shouldnt show up at
all...

\n"); print ("\n"); print ("\n"); print ("
\n"); } ?> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/







heres what is result in IE...which shouldnt show up at
this code isnt parsing like I expect..

<?php 
if ($HTTP_USER_AGENT = "Mozilla")
{
print ("This site best viewed with IE 4 or
better!\n");
print ("<center>\n");
print ("<a href='http://www.microsoft.com'>\n");
print ("<img src='lgoIE.gif'></a>\n");
print ("</center>\n");
}
?>all...

\n"); print ("\n"); print ("\n"); print ("
\n"); } ?> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




> heres what is result in IE...which shouldnt show up at
> this code isnt parsing like I expect..
> 
> <?php 
> if ($HTTP_USER_AGENT = "Mozilla")

                       ^ This needs to be "=="

Jason




> > <?php 
> > if ($HTTP_USER_AGENT = "Mozilla")
> 
>                        ^ This needs to be "=="

Actually, it needs to be " if(substr($HTTP_USER_AGENT, "Mozilla"))".

*slap.self*

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




ugh, ok, I was without php support for a bit, ok the script works, except
that it doesnt work...it prints even when browser is IE.


-----Original Message-----
From: Jason Murray <[EMAIL PROTECTED]>
To: Jason Murray <[EMAIL PROTECTED]>; 'WD'
<[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, April 03, 2001 7:54 PM
Subject: RE: [PHP] help with parse


>> > <?php
>> > if ($HTTP_USER_AGENT = "Mozilla")
>>
>>                        ^ This needs to be "=="
>
>Actually, it needs to be " if(substr($HTTP_USER_AGENT, "Mozilla"))".
>
>*slap.self*
>
>Jason
>
>--
>Jason Murray
>[EMAIL PROTECTED]
>Web Design Team, Melbourne IT
>Fetch the comfy chair!
>
>--
>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]





well, this actually worked the way i had it ie. if ($HTTP_USER_AGENT =
"Mozilla") before I added the html outputs.


-----Original Message-----
From: Jason Murray <[EMAIL PROTECTED]>
To: Jason Murray <[EMAIL PROTECTED]>; 'WD'
<[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, April 03, 2001 7:54 PM
Subject: RE: [PHP] help with parse


>> > <?php
>> > if ($HTTP_USER_AGENT = "Mozilla")
>>
>>                        ^ This needs to be "=="
>
>Actually, it needs to be " if(substr($HTTP_USER_AGENT, "Mozilla"))".
>
>*slap.self*
>
>Jason
>
>--
>Jason Murray
>[EMAIL PROTECTED]
>Web Design Team, Melbourne IT
>Fetch the comfy chair!
>
>--
>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]





WD wrote:
> 
> heres what is result in IE...which shouldnt show up at
> this code isnt parsing like I expect..
> 
> <?php
> if ($HTTP_USER_AGENT = "Mozilla")
> {
> print ("This site best viewed with IE 4 or
> better!\n");
> print ("<center>\n");
> print ("<a href='http://www.microsoft.com'>\n");
> print ("<img src='lgoIE.gif'></a>\n");
> print ("</center>\n");
> }
> ?>all...
> 
> \n"); print ("\n"); print ("\n"); print ("
> \n"); } ?>
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.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]

Have you ever checked the $HTTP_USER_AGENT value from IE?

IE says:

"Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)"
(for example)

So, you shouldn't be checking for Mozilla. IE says that to.
-- 

* R&zE:

***************************
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***************************




Hi,

Renze Munnik wrote:

> Have you ever checked the $HTTP_USER_AGENT value from IE?
>
> IE says:
>
> "Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)"
> (for example)
>
> So, you shouldn't be checking for Mozilla. IE says that to.

You should first check for the existence of "IE" in $HTTP_USER_AGENT. If that
doesn't exist, then and only then can you know that the browser is _not_ IE.

--
Regards,
Harshdeep Singh Jawanda.






I need a way to encode my scripts so that others can not read them. But  I dont want 
to use the zend encoder? Is there anything else out there that can do what I need?




I forget what it is called but I think there is an OpenSource one, check 
the archives on this subject.  Also chack out APC 
http://apc.communityconnect.com/ , it is an OpenSource version of the 
cache tool that may in the future provide encoding I believe.

Michael

On Tuesday, April 3, 2001, at 11:41 PM, Dallas K. wrote:

> I need a way to encode my scripts so that others can not read them. 
> But  I dont want to use the zend encoder? Is there anything else out 
> there that can do what I need?




I think my php server is not good.

I did "copy($arqcliente, "/home/httpd/html/admin/$arqcliente_name");"

It didn't work. Then I tried to print both variables, and $arqcliente
printed "C:\\Augusto\\temp.txt" and the $arqcliente_name printed nothing!

echo "arqcliente      =$arqcliente<br>";
echo "arqcliente_name =$arqcliente_name<br>";

It's strange because I read the same thing that you told before.

I have the right permissions for httpd that folder. Because I can write in a
file in this server folder.

regards,

Augusto


-----Mensagem original-----
De: Andrew Rush [mailto:[EMAIL PROTECTED]]
Enviada em: terça-feira, 3 de abril de 2001 18:05
Para: Augusto Cesar Castoldi
Assunto: Re: [PHP] file upload


on 4/3/01 4:51 PM, Augusto Cesar Castoldi at [EMAIL PROTECTED] wrote:

> hehe, I forgot.
>
> I'm getting this error messagem:
> ---------------------
> Warning: Unable to open 'F:\\Augusto\\Augusto.wri' for reading: No such
> file or directory in /home/httpd/html/admin/upload.php3 on line 5


sounds like you are trying to copy a file that doesn't exist. PHP doesn't
upload the file data with the name from the uploader's local filesystem, it
creates a temporary name which is available as a variable with the same name
as the file input on the form. so if you have:

<input type="file" name="myFile">

when handling the form there will be a variable name "$myFile". this will
contain the file data. the original name of the file is available as the
name of the file input with "_name" appended. in the case given the value
for "$myFile_name" would be "Augusto.wri". so you will want to do:

copy($myFile, "path/to/my/folder/for/$myFile_name");

you should end up with the file data in the proper place.

one last thing- make sure that the user who runs the webserver has write
permission for the folder you want to copy into. i can't tell you how many
times this step trips people up- myself included.



have a great day
andy

--
*******************************************************
Andrew Rush :: Lead Systems Developer :: MaineToday.com
*******************************************************

"A friend of the devil is a friend of mine" - R. Hunter









Does anyone know where I can get the basic pear class file from?  I'm
using the omni webserver on a windows machine.  It has php built into
it, but doesn't know anything about pear.

--
--------------------------------------------------
Homepage: http://www.sfu.ca/~gpalmer
ICQ#: 4930151
NH Off topic page: http://equestrianpleasures.da.ru/offtopic






I think the PEAR class file comes with PHP4... si that correct?

-----Original Message-----
From: glenn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 4 April 2001 11:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PEAR


Does anyone know where I can get the basic pear class file from?  I'm
using the omni webserver on a windows machine.  It has php built into
it, but doesn't know anything about pear.

--
--------------------------------------------------
Homepage: http://www.sfu.ca/~gpalmer
ICQ#: 4930151
NH Off topic page: http://equestrianpleasures.da.ru/offtopic



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






look at the PHP source code you've installed

Maxim Maletsky
PHPBeginner.com
www.phpbeginner.com


-----Original Message-----
From: glenn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PEAR


Does anyone know where I can get the basic pear class file from?  I'm
using the omni webserver on a windows machine.  It has php built into
it, but doesn't know anything about pear.

--
--------------------------------------------------
Homepage: http://www.sfu.ca/~gpalmer
ICQ#: 4930151
NH Off topic page: http://equestrianpleasures.da.ru/offtopic



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




thank you guys,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
it worked with php4 not php3


-JUANG-





OK,
Here is my LAST shot at this, I mean it this time

I used the code that Lindsay Adams was nice enough to give me, THANKS
AGAIN.
I have made few minor adjustments and one question.
Should I be calling out the PHOTOID field I have in my database for
storing?
It is my primary key set to auto increment and not null. Shouldn't it
count on its own?

Back to this other problem....

It will not insert more than ONE description.
(When you run it like I have pasted here, this version returns values to
the screen)

<?
if(isset($submit)):

$query = "INSERT INTO pictures (photono, photodesc, photodate) VALUES";
for($I=0;$I < count($photono); $I++) {
    if(!($I == 0)) {
       if(!($photodesc[$I] =="") ) {
         $query .="('$photono','$photodesc[$I]','$photodate')";
         }
      }

      else {
        if(!($photodesc[$I] =="") ) {
          $query .=",('$photono','$photodesc[$I]','$photodate')";
        }
      }
}
print $query;

print("<h2>The data has been entered</h2>\n");

endif;
?>

<form action="http://localhost/pic2.phtml" method="post">
Picture Number:<br><input type="text" size="20" name="photono"><p>
Picture Description:<br><input type="text" size="40" name="photodesc[
]"><p>
Picture Description:<br><input type="text" size="40" name="photodesc[
]"><p>
Picture Description:<br><input type="text" size="40" name="photodesc[
]"><p>
Picture Description:<br><input type="text" size="40" name="photodesc[
]"><p>
Picture Date:<br><input type="text" size="8" name="photodate"><p>
<input type="submit" name="submit" value="Submit Picture">
</form>
</body>
</html>

After I get this attempt, I am going back to my other job "Brain
Surgery"

Thanks in advance
"Sorry to be such a pain"
Curtis






Hello,

John Lim wrote:
> 
> Hi Jason,
> 
> Metabase is a library that tries to hide 99% of the differences between all
> databases. In that sense
> it is a thick abstraction layer.
> 
> The other school of thought is to provide a thin layer that doesn't do very
> much so that it runs fast.

That is yet to be proven. The truth is that in most cases, the real
bottleneck is the communication between PHP and the database server and
the actual queries that run there. If you really believe that the you
gain a lot by not adding the database abstraction features that Metabase
offers, maybe you need to run some tests yourself to prove that any
extra thickness that may attribute to Metabase really make it noticeably
slower.


> PS: ADODB is modelled on Microsoft's ADO, so it's popular among converted
> ASP programmers. If you
> one of these people, ADODB might be attractive to you.

Metabase was modeled after the real needs of Web programmers that need
to develop applications that may run different databases on different
platforms, not just Microsoft's.

Microsoft designed ADO because they realized that ODBC was too limited
to be useful to develop portable applications. Some day they will
realize that Web applications need more than they are abstracting with
ADO and invent yet another API that supports the abstraction features
that ADO doesn't.

Metabase was pioneer in providing highly desirable features for Web
developers like database schema management, database independent
sequences (auto-incremented unique identifier numbers), selecting a
limited range of rows (LIMIT start,limit), etc... For that Metabase has
been a source of inspiration of some PHP database abstraction packages.

Metabase was only released publically after 1 year of private
development when it was already supporting many of the most popular
databases. This is important because it means that it is not susceptible
to API changes that may break the compatibility of the applications that
developers that adopted Metabase may write. This means that Metabase is
a mature package that developers may trust right now as it is.

All this to say that I suspect, that some day, when other PHP database
abstraction packages reach the level of maturity of Metabase, they will
provide the same features that Metabase offers now, despite the
criticisms of those that decided to go their own way and develop their
own database abstraction packages despite they knew Metabase when they
start.

For this I regret the fact that unlike other languages like Perl, Java,
Python, etc.., PHP suffers of not being known as a language that has a
good standard database abstraction package, despite we know that is not
true. Be sure that some developers do not adopt PHP because of that.

It's a shame that a lot of people, including PHP core developers, fail
to reckon that this lack of unification constitutes a real loss of
credibility for PHP as a serious Web development language. The solution
would be to unite forces and merge the development of one and only one
database abstraction package, but unfortunately there seems to not be
will to move in that direction. :-(

Manuel Lemos




hi,

it's happened before, but it's happening again, and it's giving me the s**ts!!!

I get this error:
Parse error: parse error in
/home/clients/jfrench/public_html/indent/tests/simple2/login4.php on
line 88

Problem is, line 88 is the last line of the file, which 
simply has "</HTML>"


My question is in two parts:

1. Is it possible it's to do with unix/macintosh line breaks , carrige
returns and end-of-files.  I thought this at first, but i've opened the
file on a PC and shifted a few things around (which usually fixes a line
break problem).  I've also opened the file in different text editors and re-saved.

2. Is it possibly a bug in php4 (according to phpinfo() i'm running "PHP
Version 4.0.4pl1", on a FreeBSD box with MySQL and PHP3 as well.

Since the last line of the file has NO PHP CODE, and all the php code
prior to that has been closed off (?>), or is it more likely a bug in my
code, but PHP4 isn't reporting the correct line?


Either way, I'm sick of it!!!!


Thanks in advance, and I can psot the code if people think it will help...


Justin French




your missing a } most likely some where in your code

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 11:14 AM
To: php
Subject: [PHP] error on last line of file (tearing hair out)


hi,

it's happened before, but it's happening again, and it's giving me the s**ts!!!

I get this error:
Parse error: parse error in
/home/clients/jfrench/public_html/indent/tests/simple2/login4.php on
line 88

Problem is, line 88 is the last line of the file, which 
simply has "</HTML>"


My question is in two parts:

1. Is it possible it's to do with unix/macintosh line breaks , carrige
returns and end-of-files.  I thought this at first, but i've opened the
file on a PC and shifted a few things around (which usually fixes a line
break problem).  I've also opened the file in different text editors and re-saved.

2. Is it possibly a bug in php4 (according to phpinfo() i'm running "PHP
Version 4.0.4pl1", on a FreeBSD box with MySQL and PHP3 as well.

Since the last line of the file has NO PHP CODE, and all the php code
prior to that has been closed off (?>), or is it more likely a bug in my
code, but PHP4 isn't reporting the correct line?


Either way, I'm sick of it!!!!


Thanks in advance, and I can psot the code if people think it will help...


Justin French

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





"Justin French" <[EMAIL PROTECTED]> wrote:
> Problem is, line 88 is the last line of the file, which
> simply has "</HTML>"
> Since the last line of the file has NO PHP CODE, and all the php code
> prior to that has been closed off (?>), or is it more likely a bug in my
> code, but PHP4 isn't reporting the correct line?

Maybe you have a missing closing bracket "}".

> Thanks in advance, and I can psot the code if people think it will help...

If it's not a missing closing bracket, post the code.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





In article <148501c0bcad$35052e70$6501a8c0@workstation7>,
 [EMAIL PROTECTED] ("Steve Werby") wrote:

> "Justin French" <[EMAIL PROTECTED]> wrote:
> > Problem is, line 88 is the last line of the file, which
> > simply has "</HTML>"
> > Since the last line of the file has NO PHP CODE, and all the php code
> > prior to that has been closed off (?>), or is it more likely a bug in my
> > code, but PHP4 isn't reporting the correct line?
> 
> Maybe you have a missing closing bracket "}".

Some other common causes (I've been caught by 'em all <g>): using a here 
doc that either has trailing whitespace on the opening line or leading 
whitespace on the closing line, a missing semicolon on a last or 
near-to-last line, ditto for a closing parenthesis, a non-missing bracket 
or parenthesis that's turned in the wrong direction...etc.  Somewhere along 
there was a syntax error that didn't look like a syntax error, so the PHP 
parser kept going.  And going.  Until it reached the last line with 
something still left open.  Just comment out chunks of code, working 
backwards from the end, until the error goes away.  Then narrow down until 
you find the problem line(s).

-- 
CC




http://www.php.net/manual/en/function.mail.php

In article <9ad5le$p7n$[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
wrote:

> The subject explains all. I need to send  html emails unsing php Thanks
> 
> 
> 
>




Im trying to optimize some php/mysql code.  Does anyone know a way to
measure the amount cpu time a php script consumes?

- Brian Hardwick
Tangible Networks





The closest I know of is using microtime at the start and end of a piece of
code to see how long it took.

You'll want to run the script through a loop, usually around 10 times at
least if it's not a big script, and then average together 10 tests.



--
Plutarck
Should be working on something...
...but forgot what it was.

""Brian Hardwick"" <[EMAIL PROTECTED]> wrote in message
000501c0bcb1$130f7fb0$0200a8c0@brianslaptop">news:000501c0bcb1$130f7fb0$0200a8c0@brianslaptop...
> Im trying to optimize some php/mysql code.  Does anyone know a way to
> measure the amount cpu time a php script consumes?
>
> - Brian Hardwick
> Tangible Networks
>
>
> --
> 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]
>






On 3 Apr 2001 19:29:14 -0700, Brian Hardwick <[EMAIL PROTECTED]>
wrote:
>Im trying to optimize some php/mysql code.  Does anyone know a way to
>measure the amount cpu time a php script consumes?

Check out the POSIX functions - in particular the posix_times() function, which
not only shows CPU time but also breaks it down into user (PHP's code)
time and system (time spent by the kernel) time.




Thanks a lot, this will be a big help.

Michael

On Tuesday, April 3, 2001, at 02:58 PM, Andrew wrote:

> Hi all,
>
> In the past couple of weeks, many people have asked me about compiling 
> PHP /
> Apache under Mac OS X, so I've updated my iODBC HOWTO specifically for 
> Mac
> OS X.
>
> This walks through the process of enabling ODBC support in PHP, so your 
> Mac
> OS X PHP applications can pull data from any relational database.  I'll 
> be
> uploading it to the www.iodbc.org site, but if anyone would like to 
> comment
> on the initial draft, it's attached to the post.
>
> Any and all feedback is welcome - tell me anything is not clear!
>
> Best regards,
> Andrew
> --------------------------------------
> Andrew Hill - OpenLink Software
> Director Technology Evangelism
> eBusiness Infrastructure Technology
> http://www.openlinksw.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]





Hi,
full instructions follow:

download the latest php tarball from:
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_site=www.php.net

then extract it:
tar xzf php*tar.gz

then cd to it:
cd php*

then configure it:
./configure

the compile it:
make

then install it (as root do:)
make install

this should give you a command line php in:
/usr/local/bin

please note that ./configure may need some options for database access 
and stuff, just don't use --with-apache or --with-apxs

good luck,
Nuno Silva




Brandon Orther wrote:

> When I type: make it does nothing??? What am I supposed to be typing?
> 
> -----Original Message-----
> From: Nuno Silva [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 03, 2001 9:19 AM
> To: Brandon Orther
> Cc: PHP User Group
> Subject: Re: [PHP] Shell Programming with PHP, but where is the PHP?
> 
> 
> 
> :)
> yes,
> 
> just
> ./configure (don't use --with-apache or --with-apxs) [other options]
> make
> cp php /usr/local/bin (or whatever)
> 
> regards,
> Nuno Silva
> 
> Brandon Orther wrote:
> 
> 
>> Hello,
>> 
>> It is installed as a module,  Is there a way I can keep it installed as a
>> module but install it so I can use it to shell script also?
>> 
>> Thanks Ahead Of Time
>> Brandon
>> 
>> -----Original Message-----
>> From: Renze Munnik [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, April 03, 2001 8:32 AM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Shell Programming with PHP, but where is the PHP?
>> 
>> 
>> Brandon Orther wrote:
>> 
>> 
>>> Hello,
>>> 
>>>         I am looking for the path to my php so I can put it on the top of
>> 
>> my php
>> 
>> 
>>> script.  Like this: #!/path/to/php
>>> 
>>> All I can find that looks like this is libphp4.so  Does anyone know where
>> 
>> to
>> 
>> 
>>> look for the binary?
>>> 
>>> Thanks
>>> Brandon
>>> 
>>> --
>>> 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]
>> 
>> 
>> Try locate and/or whereis.
>> And you should make sure PHP isn't installed as module.
>> --
>> 
>> * R&zE:
>> 
>> ***************************
>> **  Renze Munnik
>> **
>> **  E: [EMAIL PROTECTED]
>> **  M: +31 6 218 111 43
>> ***************************
>> 
>> --
>> 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]





> How do you check to make sure that any
> form submissions originate from your site?

You basically can't.

...well that was easy ;)


All you can do is assume that every single piece of data sent from the
client is an attempt to screw up your application. After stripping non-valid
characters and using strlen to ensure the data is of a valid size, there
isn't much you can do. But if you know ahead of time that the date should
_NOT_ be 1998, just encode such a validator.


But if you want to be really sneaky, make something like this:

value1=vally|val2=vooly

Then run it through some encryption feature or a home-brewed scrambler, and
make the whole thing one single "hidden" value.

In your script you decode it, split it apart into proper variables, and
continue along as normal.


Still not fool proof, but I use it when I have no other better method. And
it basically thwarts 99% of casual tinkerers, and an equal amount of script
kiddies, and it allows you to be really creative in your data validation,
plus you can screw with people's heads...which of course is the most
important function ;)



--
Plutarck
Should be working on something...
...but forgot what it was.






If you want to check where your submit is comming from, then you need to
check the REFERER url..... do so by useing the global $HTTP_REFERER
variable.


global $HTTP_REFERER;

if($HTTP_REFERER == "YOUR_FORM_PAGE_HERE")
{
    //PROCESS CODE.
}
else
{
    echo"Your a hacker, so BITE ME!!!";
}




----- Original Message -----
From: "Plutarck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 03, 2001 7:58 PM
Subject: [PHP] Sneaky solution


> > How do you check to make sure that any
> > form submissions originate from your site?
>
> You basically can't.
>
> ...well that was easy ;)
>
>
> All you can do is assume that every single piece of data sent from the
> client is an attempt to screw up your application. After stripping
non-valid
> characters and using strlen to ensure the data is of a valid size, there
> isn't much you can do. But if you know ahead of time that the date should
> _NOT_ be 1998, just encode such a validator.
>
>
> But if you want to be really sneaky, make something like this:
>
> value1=vally|val2=vooly
>
> Then run it through some encryption feature or a home-brewed scrambler,
and
> make the whole thing one single "hidden" value.
>
> In your script you decode it, split it apart into proper variables, and
> continue along as normal.
>
>
> Still not fool proof, but I use it when I have no other better method. And
> it basically thwarts 99% of casual tinkerers, and an equal amount of
script
> kiddies, and it allows you to be really creative in your data validation,
> plus you can screw with people's heads...which of course is the most
> important function ;)
>
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
>
> --
> 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]
>





Correct me if I'm wrong, but isn't it possible to fake the referrer?  

This may not matter for your application -- are you writing a financial app
or a personal portfolio? -- but if you really need to authenticate the
source of data that comes from some other IP address (as is the case with a
web browser) then you're into PGP keys and signed certificates.


At 11:18 PM 4/3/2001 -0700, Dallas K. wrote:
>If you want to check where your submit is comming from, then you need to
>check the REFERER url..... do so by useing the global $HTTP_REFERER
>variable.
>
>
>global $HTTP_REFERER;
>
>if($HTTP_REFERER == "YOUR_FORM_PAGE_HERE")
>{
>    //PROCESS CODE.
>}
>else
>{
>    echo"Your a hacker, so BITE ME!!!";
>}
>
>
>
>
>----- Original Message -----
>From: "Plutarck" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, April 03, 2001 7:58 PM
>Subject: [PHP] Sneaky solution
>
>
>> > How do you check to make sure that any
>> > form submissions originate from your site?
>>
>> You basically can't.
>>
>> ...well that was easy ;)
>>
>>
>> All you can do is assume that every single piece of data sent from the
>> client is an attempt to screw up your application. After stripping
>non-valid
>> characters and using strlen to ensure the data is of a valid size, there
>> isn't much you can do. But if you know ahead of time that the date should
>> _NOT_ be 1998, just encode such a validator.
>>
>>
>> But if you want to be really sneaky, make something like this:
>>
>> value1=vally|val2=vooly
>>
>> Then run it through some encryption feature or a home-brewed scrambler,
>and
>> make the whole thing one single "hidden" value.
>>
>> In your script you decode it, split it apart into proper variables, and
>> continue along as normal.
>>
>>
>> Still not fool proof, but I use it when I have no other better method. And
>> it basically thwarts 99% of casual tinkerers, and an equal amount of
>script
>> kiddies, and it allows you to be really creative in your data validation,
>> plus you can screw with people's heads...which of course is the most
>> important function ;)
>>
>>
>>
>> --
>> Plutarck
>> Should be working on something...
>> ...but forgot what it was.
>>
>>
>>
>> --
>> 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]
>
>

............................................................................
Les Neste  678-778-0382  http://www.lesneste.com




You are right. It's painfully easy to fake the referer to make it say
anything you want it to.

I do it occasionally to screw with people's heads ;)

Making the referer become something like www.fbi.gov is always a hoot.


So using referer really isn't a very good solution, and many browsers just
screw it up or ignore it anyway. Early versions of AOL did this alot, and
konqueror apparently has problems too.

And anyone who uses Proxomitron can set their referer to anything they'd
like, so that's not good either.

However, you can just log the referer of anyone that posts to your app, so
you can go back in and look to see if any mysterious referer's are being
used. But never hard-code a forced referer as you're only going to set
yourself up for nasty emails and a false sense of security.

As I said, assume any piece of data coming from outside your script to be
both faulty and possibly malicious. Just because your paranoid doesn't mean
they aren't out to get you...


--
Plutarck
Should be working on something...
...but forgot what it was.




"Les Neste" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Correct me if I'm wrong, but isn't it possible to fake the referrer?
>
> This may not matter for your application -- are you writing a financial
app
> or a personal portfolio? -- but if you really need to authenticate the
> source of data that comes from some other IP address (as is the case with
a
> web browser) then you're into PGP keys and signed certificates.
>
>
> At 11:18 PM 4/3/2001 -0700, Dallas K. wrote:
> >If you want to check where your submit is comming from, then you need to
> >check the REFERER url..... do so by useing the global $HTTP_REFERER
> >variable.
> >
> >
> >global $HTTP_REFERER;
> >
> >if($HTTP_REFERER == "YOUR_FORM_PAGE_HERE")
> >{
> >    //PROCESS CODE.
> >}
> >else
> >{
> >    echo"Your a hacker, so BITE ME!!!";
> >}
> >
> >
> >
> >
> >----- Original Message -----
> >From: "Plutarck" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, April 03, 2001 7:58 PM
> >Subject: [PHP] Sneaky solution
> >
> >
> >> > How do you check to make sure that any
> >> > form submissions originate from your site?
> >>
> >> You basically can't.
> >>
> >> ...well that was easy ;)
> >>
> >>
> >> All you can do is assume that every single piece of data sent from the
> >> client is an attempt to screw up your application. After stripping
> >non-valid
> >> characters and using strlen to ensure the data is of a valid size,
there
> >> isn't much you can do. But if you know ahead of time that the date
should
> >> _NOT_ be 1998, just encode such a validator.
> >>
> >>
> >> But if you want to be really sneaky, make something like this:
> >>
> >> value1=vally|val2=vooly
> >>
> >> Then run it through some encryption feature or a home-brewed scrambler,
> >and
> >> make the whole thing one single "hidden" value.
> >>
> >> In your script you decode it, split it apart into proper variables, and
> >> continue along as normal.
> >>
> >>
> >> Still not fool proof, but I use it when I have no other better method.
And
> >> it basically thwarts 99% of casual tinkerers, and an equal amount of
> >script
> >> kiddies, and it allows you to be really creative in your data
validation,
> >> plus you can screw with people's heads...which of course is the most
> >> important function ;)
> >>
> >>
> >>
> >> --
> >> Plutarck
> >> Should be working on something...
> >> ...but forgot what it was.
> >>
> >>
> >>
> >> --
> >> 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]
> >
> >
>
>
............................................................................
> Les Neste  678-778-0382  http://www.lesneste.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]
>






On 3 Apr 2001 21:02:34 -0700, Les Neste <[EMAIL PROTECTED]> wrote:
>Correct me if I'm wrong, but isn't it possible to fake the referrer?  

Quite easily, even when doing it by hand using telnet or netcat.

>This may not matter for your application -- are you writing a financial app
>or a personal portfolio? -- but if you really need to authenticate the
>source of data that comes from some other IP address (as is the case with a
>web browser) then you're into PGP keys and signed certificates.

s/PGP/SSL/. Although it's not anywhere near as common, SSL supports client
certificates. Normally, we only see the server certificate which lets you know
who the server is - client certificates allow the server to do the same thing.
I've been meaning to setup a demo of this for awhile, but you should be able to
read the verified certificate info from the webserver environment, which makes
controlling access rather simple for your scripts.  

The downside is the need to get client certificates on every client system,
which is expensive and inconvenient. While setting up your own CA eliminates
the former concern, there's little which can be done about the latter.




Do the same thing your doing, but insert the following after where it should
be set to see if it was:

print_r($HTTP_SESSION_VARS);

If it worked, you'll see it.

If not, you'll see it. Then you can progress from there.



--
Plutarck
Should be working on something...
...but forgot what it was.

""Thomas Häger"" <[EMAIL PROTECTED]> wrote in message
9acqfe$v9a$[EMAIL PROTECTED]">news:9acqfe$v9a$[EMAIL PROTECTED]...
> Hi all,
>
> i need to use an array in a session variable.
> On a page i fill the Sessionvar :
>     $HTTP_SESSION_VARS["xy"] []=$whatever
>     (The var is registered with session_register("xy"))
> I mean that the entry would made at the end of the array, is it not so?
>
> But evrey time i proove the entries with count($HTTP_SESSION_VARS["xy"]) ,
> there are only one entry.
>
>
> Have somebody an idea?
>
> Thank,
>
> Thomas
>
>
>
>
>
> --
> 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]
>






It's probably not the cause of your problem (I know little to nothing about
Interbase), but why the if... loop in your code?

Your if:

 if ($val < $NumCases)

does the same thing as your for:

for ($val = 0;  $val < $NumCases; ++$val)

Unless of course you wanted it that way...



--
Plutarck
Should be working on something...
...but forgot what it was.

""Wade Halsey"" <[EMAIL PROTECTED]> wrote in message
002e01c0bc4d$2ebfcf80$256410ac@wadeh">news:002e01c0bc4d$2ebfcf80$256410ac@wadeh...
Hi

I have the following code

/*number of times to run*/
$NumCases = $HTTP_POST_VARS['txtNumCases'];
/*execute the sql*/
$sqlLargeRequest = sqlexecute($LargeRequest);

for ($val = 0;  $val < $NumCases; ++$val){
 if ($val < $NumCases) {


$details = sqlFetchObject( $sqlLargeRequest );

$AccNo = $details ->ACCNO;
etc etc


It executes the correct number of times but doesnt move to the next
record.Im using an Interbase DB.  Any ideas??

TIA
Wade







12





Hi,

I was wandering what the result from microsec() means:

I tested the time in the begin and in the end of my code and got the
following result:

        Begin:  0.70278800 986354975

        End:            0.08970900 986354975

I think the latter part of the value is Unix-time in sec (right?), but what
does the former part say like: 0.25576700 ?!?

I read in the manual it should be the 1/1000000 of seconds but it does not
compute in my brain, how come is the End time lower than the Begin time?
Probably I'm thinking of it the wrong way, but I hope you can light me :)

Regards,
SED





On 3 Apr 2001 20:31:28 -0700, SED <[EMAIL PROTECTED]> wrote:
>I think the latter part of the value is Unix-time in sec (right?), but what
>does the former part say like: 0.25576700 ?!?

For some reason, microtime() returns results backwards - the first part is the
decimal portion of the second part.

As for the time being returned in properly, are you by any chance running this
on Windows? I seem to recall reading something in bugs.php.net about that when
I ran into some benchmark problems with code which worked properly on Unix and
returned results like you showed on Windows ("Wow! This sure is a fast computer
- it finished before it started!").




I've been trying to Install PHP 4 for Xitami Web Server. I downloaded the Windows 
installer for PHP 4 and installed it. I edited the Filters for Xitami in default.cfg 
so that .php=D:\Php\php.exe (which is where php exists on my server) and I made sure 
that the folder which holds php.exe has execute permissions. I also put in "doc_root  
= D:\InetPub\wwwroot" and "extensions_dir = D:\Php" in the php.ini file and put that 
in the WinNT folder. I put my file 'test.php' in my cgi-bin folder inside my website 
root. When I go to test.php in the url, it shows the little loading thing in the 
corner for a bit, and then i get a blank page. I tried running php.exe on the file 
from the command line and it displays the results correctly in the dos prompt, so the 
file is written correctly. Any idea what i'm doing wrong? Thanks.




Hi

Web pages in Xitami live at c:\Xitami\webpages\  if you installed on C:
unless you specifically installed it so they are at d:\InetPub\wwwroot  (the
PWS default)

Try putting the php script in the document root - not the cgi-bin. PHP
scripts usually go in the
sub-directories under the document root

Make a script called phpinfo.php and put in the document root - it should
contain one line

<? phpinfo();?>

Access the document root from your browser - (ie http://localhost) you
should see the Xitami welcome
then  do http://localhost/phpinfo.php

If that works you will see details of your php install

HTH



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 8:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem getting PHP 4 to work on Xitami Server on Windows
NT


I've been trying to Install PHP 4 for Xitami Web Server. I downloaded the
Windows installer for PHP 4 and installed it. I edited the Filters for
Xitami in default.cfg so that .php=D:\Php\php.exe (which is where php exists
on my server) and I made sure that the folder which holds php.exe has
execute permissions. I also put in "doc_root  = D:\InetPub\wwwroot" and
"extensions_dir = D:\Php" in the php.ini file and put that in the WinNT
folder. I put my file 'test.php' in my cgi-bin folder inside my website
root. When I go to test.php in the url, it shows the little loading thing in
the corner for a bit, and then i get a blank page. I tried running php.exe
on the file from the command line and it displays the results correctly in
the dos prompt, so the file is written correctly. Any idea what i'm doing
wrong? Thanks.

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





In your code, if $PHPSESSID is set then you'll need to invoke
session_start() anyway.

session_start() initializes all session variables to what they should be so
that you can access them.

Note: If someone submits the variable $name which is "Ted", and in their
session they have a variable called $name which equals "Bob", then the
following will end up weird:

$name1 = $name;
session_start();
$name2 = $name;


session_start declares all session variables as global, and it over-writes
any pre-existing variables of the same name.


--
Plutarck
Should be working on something...
...but forgot what it was.


""David Tandberg-Johansen"" <[EMAIL PROTECTED]> wrote in message
9aaumn$o69$[EMAIL PROTECTED]">news:9aaumn$o69$[EMAIL PROTECTED]...
> Hello!
>
> After confering with the this group earlier I got some hints on where to
> find som tutorials on sessions. But I am still confused about some things.
>
> Have I under stood it right:
>
>
> #session.php
>
> <?
> if (!$PHPSESSID) {
>
>     session_start();
>
>     #Then if some variables to register
>     session_register(lang);
>     session_register(name);
>
>     setcookie (PHPSESSID, $PHPSESSID,time()+3600);
>     setcookie (lang, $lang,time()+3600);
>     setcookie (name, $name,time()+3600);
>
> } elseif ($PHPSESSID) {
>
>     #I DON'T HAVE A CLUE TODO HERE, ANY HINTS?
>
> }
>
> ?>
>
> #END session.php
>
> And then I include the session.php in all the files I need to use session
> in?
> And I can get the variables from the cookie?
>
> David
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi people
What is the different between session_unregister and session_destroy? If i want to 
delete session, which one should I used?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




First of all, in sessions you have two different things. You have the
session itself, which is basically a "container" for variables. Then you
have the variables themselves, which is what is inside your container.

session_unregister removes the variable from the container (you have to say
which one you want removed). session_unset clears off the values of all the
variables inside the container.

session_destroy however destroys the container itself plus everything inside
of it.

So when killing a session, use session_destroy. I personally use
session_unset right before session_destroy to ensure all the variables go
either bye bye or become false.


--
Plutarck
Should be working on something...
...but forgot what it was.



""Jacky"" <[EMAIL PROTECTED]> wrote in message
019101c0bd20$afc1f120$[EMAIL PROTECTED]">news:019101c0bd20$afc1f120$[EMAIL PROTECTED]...
Hi people
What is the different between session_unregister and session_destroy? If i
want to delete session, which one should I used?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"







Hi,

I have written a html which contains a form and then I use a "GET" method to
pass a variable to PHP program with
http://xxx.xxx.xxx.xxx/test.php?testing=testing. However, I can't get the
variable testing by using "echo $testing".

I don't know what is the problem.

Thank You!

HK Woo






Try using a print_r($HTTP_GET_VARS) and see what comes up.

It could be that PHP has been set not to turn GET/POST variables into
seperate values.

If so you'll need to use:

echo $HTTP_GET_VARS[testing];


--
Plutarck
Should be working on something...
...but forgot what it was.



""HK Woo"" <[EMAIL PROTECTED]> wrote in message
9ae7ba$9n3$[EMAIL PROTECTED]">news:9ae7ba$9n3$[EMAIL PROTECTED]...
> Hi,
>
> I have written a html which contains a form and then I use a "GET" method
to
> pass a variable to PHP program with
> http://xxx.xxx.xxx.xxx/test.php?testing=testing. However, I can't get the
> variable testing by using "echo $testing".
>
> I don't know what is the problem.
>
> Thank You!
>
> HK Woo
>
>
>
> --
> 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]
>






Hi, Plutarck

Thank You for your help.

I would like to know how to turn on the feature to let PHP to separate the
variable by GET/POST

Thank You!

HK Woo
""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9ae7sf$f96$[EMAIL PROTECTED]">news:9ae7sf$f96$[EMAIL PROTECTED]...
> Try using a print_r($HTTP_GET_VARS) and see what comes up.
>
> It could be that PHP has been set not to turn GET/POST variables into
> seperate values.
>
> If so you'll need to use:
>
> echo $HTTP_GET_VARS[testing];
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
>
> ""HK Woo"" <[EMAIL PROTECTED]> wrote in message
> 9ae7ba$9n3$[EMAIL PROTECTED]">news:9ae7ba$9n3$[EMAIL PROTECTED]...
> > Hi,
> >
> > I have written a html which contains a form and then I use a "GET"
method
> to
> > pass a variable to PHP program with
> > http://xxx.xxx.xxx.xxx/test.php?testing=testing. However, I can't get
the
> > variable testing by using "echo $testing".
> >
> > I don't know what is the problem.
> >
> > Thank You!
> >
> > HK Woo
> >
> >
> >
> > --
> > 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]
>






Yup, as Chris said it's register.globals that's the entry in your php.ini
file.

In my php.ini it's on line 200 (without wordwrap), and it will probably look
like:

register_globals = Off  ; Whether or not to register the EGPCS variables as
global

In yours. Change the value to On and you should be all set.

If it's an older version of PHP you also need track_vars enabled, but in
4.0.3 and up it's automatically enabled.


--
Plutarck
Should be working on something...
...but forgot what it was.



""HK Woo"" <[EMAIL PROTECTED]> wrote in message
9aeb6e$ecn$[EMAIL PROTECTED]">news:9aeb6e$ecn$[EMAIL PROTECTED]...
> Hi, Plutarck
>
> Thank You for your help.
>
> I would like to know how to turn on the feature to let PHP to separate the
> variable by GET/POST
>
> Thank You!
>
> HK Woo
> ""Plutarck"" <[EMAIL PROTECTED]> wrote in message
> 9ae7sf$f96$[EMAIL PROTECTED]">news:9ae7sf$f96$[EMAIL PROTECTED]...
> > Try using a print_r($HTTP_GET_VARS) and see what comes up.
> >
> > It could be that PHP has been set not to turn GET/POST variables into
> > seperate values.
> >
> > If so you'll need to use:
> >
> > echo $HTTP_GET_VARS[testing];
> >
> >
> > --
> > Plutarck
> > Should be working on something...
> > ...but forgot what it was.
> >
> >
> >
> > ""HK Woo"" <[EMAIL PROTECTED]> wrote in message
> > 9ae7ba$9n3$[EMAIL PROTECTED]">news:9ae7ba$9n3$[EMAIL PROTECTED]...
> > > Hi,
> > >
> > > I have written a html which contains a form and then I use a "GET"
> method
> > to
> > > pass a variable to PHP program with
> > > http://xxx.xxx.xxx.xxx/test.php?testing=testing. However, I can't get
> the
> > > variable testing by using "echo $testing".
> > >
> > > I don't know what is the problem.
> > >
> > > Thank You!
> > >
> > > HK Woo
> > >
> > >
> > >
> > > --
> > > 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]
>






Hey,

Is anyone using php and UDDI together, if so I would appreciate some 
comments, insights,  recommendations etc...

I really don't feel like selling my soul to Microsoft yet :-)

Regards,

Joseph






Hi all

How can I enclose files into my letter & send it from the php script (using
for example mail() function)

Thanks, Vlad








Hi all

script example:

function smth(){
 $result = '1234 - the number';
return $result;
}
...
  $res = smth();
...
After this $res takes value of 1234 not the actual string.
Is any soolution here?

Thanks, Vlad







On Wed,  4 Apr 2001 15:44, Vlad wrote:
> Hi all
>
> script example:
>
> function smth(){
>  $result = '1234 - the number';
> return $result;
> }
> ...
>   $res = smth();
> ...
> After this $res takes value of 1234 not the actual string.
> Is any soolution here?
>
> Thanks, Vlad

If you do
 function smth(){
 $result = '1234 - the number';
 return $result;
 }
  $res = smth();
echo $res;

The output is

1234 - the number

What else is in your script?

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA




i just test that code and i got the full string fine...check and see if
what you typed here is the same as your original code...

jack

Vlad wrote:
> 
> Hi all
> 
> script example:
> 
> function smth(){
>  $result = '1234 - the number';
> return $result;
> }
> ...
>   $res = smth();
> ...
> After this $res takes value of 1234 not the actual string.
> Is any soolution here?
> 
> Thanks, Vlad
> 
> --
> 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]




On Wed,  4 Apr 2001 04:24, Boget, Chris wrote:

> > echo date( "r h:ia" );
>
> returns:
>
> Tue, 3 Apr 2001 13:45:46 +0500 12:875903540pm
>
> What's up with the minutes?  Does anyone else get
> this problem?  It seems the minutes are only screwed
> up with the "r" format specifier is used...
>
> Chris

Mine looks even worse:

Wed, 4 Apr 2001 14:52:00 +091800 12:809120309pm

where +091800 should be +0930

Bug report time, perhaps?
-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA




If you "have" to you can use phpMyAdmin's dump feature to copy out your
database, along with the data inside of it.

As I don't always have access to more than the browser-based phpMyAdmin
program I often have to just do it that way. Works pretty well, though it
can become hard for very large tables.


--
Plutarck
Should be working on something...
...but forgot what it was.



""Glenda Robalino"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
> I have created my database in mysql in linux, but i nedd my aplication,
> including the database in windows, I tryied to copy, but i had problems
with
> the database...
> all the tables are copie.. i could see the tables, but i cant make
selects,
> inserts....
>
> what could i do to copy well the database??
>
> thanks ciao
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]
>






Hi there,

I have a problem. I am trying to use a simple php script to display a JPEG
from a "protected" catalog (the image files are out of the web tree). It's
called from an IMG tag, like this:

--- main file ---

<?php
   session_start();
?>
<html>
...

<?php
session_register("imgname");
$HTTP_SESSION_VARS[imgname] = "something.jpg";
print "<img src=\"viewer.php?".session_name()."=".session_id()."\">";
?>

---

In viewer.php I use session_start() to resume the current session. However
this doesn't work at all. Is there any restriction for sessions when you
call the script like I'm doing?:

--- viewer.php --

<?php

session_start();

function LoadJPEG($imgname1) {
   $im = @ImageCreateFromJPEG ($imgname1);
   if (!$im) {
      $im = ImageCreate (150, 30);
      $bgc = ImageColorAllocate ($im, 255, 255, 255);
      $tc  = ImageColorAllocate ($im, 0, 0, 0);
      ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
      ImageString($im, 1, 5, 5, "Error loading $imgname1", $tc);
   }
   return $im;
}

Header("Content-type: image/jpeg");

// here $HTTP_SESSION_VARS[imgname] is empty... :(

$im = LoadJPEG("/cat/$HTTP_SESSION_VARS[imgname]");

ImageJPEG($im);
ImageDestroy($im);

?>

---

Any help is appreciated.

Regards.
Rodolfo.






I really hope someone can help me.  I select mulitiple values from a dropdown list and 
then display them 3 at a time on a next page.  They're displayed as hyperlinks so the 
on I click on get displayed on the next page with it's details.  Then I need to be 
able to move forward and backward through the selected ones (on the page I am on 
currently displaying the clicked one).

Any ideas or examples?
REGARDS
Angie Bauer





I really hope someone can help me.  I select mulitiple values from a
dropdown list and then display them 3 at a time on a next page.  They're
displayed as hyperlinks so the one I click on gets displayed on the next
page with it's details.  Then I need to be able to move forward and backward
through the selected ones (on the page I am on currently displaying the one
I selected).

Any ideas or examples?
REGARDS
Angie Bauer








Hello,

I have a simple question when connecting through mysql.  It seems that php
is trying to connect to /tmp/mysql.sock, but it's not in the /tmp directory.
It's in /var/lib/mysql/mysql.sock.  I can connect throught mysql through the command
line just fine, but php functions cannot.  It gives the error:
Warning:  MySQL Connection Failed: Can't connect to local MySQL server through 
socket '/tmp/mysql.sock' (111)


What could be wrong?



__________________________________
www.edsamail.com




$link = mysql_connect ("localhost","root","mypassword")
                or die ("Could not connect");

I'm pretty sure that the username/password is correct.  I can connect
from the linux shell using mysql -u root -p



Dan Cleveland wrote:

>What does your mysql_connect statement look like?
>
>Dan
>
>+-------------------------------------------------------------------+
>|                                                                   |
>|                  If Yoda so strong in force is,                   |
>|             why words in proper order he cannot put?              |
>|                                                                   |
>+-------------------------------------------------------------------+
>|                                                                   |
>+-------------------------------------------------------------------+
>| Daniel J. Cleveland                                               |
>|                                  e-mail: [EMAIL PROTECTED]     |
>+-------------------------------------------------------------------+
>
>
>
>

__________________________________
www.edsamail.com




 >Warning:  MySQL Connection Failed: Can't connect to local MySQL 
server >through
>socket '/tmp/mysql.sock' (111)

Did you read the FAQ???? Did you check the archive??

Edit your php.ini to match the location of the mysql.sock

Bye,


B.





Hi!


This is my code for sending email to all the emails in
my database:

$connect = mysql_connecT();
$query = "select email from table";
$execute = mysql_db_query("database", $query);

while($r=mysql_fetch_array($execute))
{
$email .= $r('email')

mail("$email", "My Subject", "Line 1\nLine 2\nLine
3");
}



Will this send email to all the emails in the
database?
Is there any otehr wya of doing it?


Thank You

Dhaval Desai


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




Is there any 'easy' way I can get the html headers receved when making a
http connect? 


-- 
 php developer / CoreTrek AS        | Moody bitch with attitude, seeks nice,
 Sandnes / Rogaland / Norway        | good-looking guy to dump on. 
 web: http://www.moijk.net/         | 




As in when you pull up a site in your browser, or when you use a script to
make an http connection to another site?


If you are using your browser on a windows box you can use a program called
Proxomitron. Just use it's log window to see all the HTTP connection fun.

It's available at:

http://www.zdnet.com/downloads/stories/info/0,,000YBS,.html

I use it all the time when debugging an app that makes use of headers.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Geir Eivind Mork" <[EMAIL PROTECTED]> wrote in message
986371002.10286.3.camel@maria">news:986371002.10286.3.camel@maria...
> Is there any 'easy' way I can get the html headers receved when making a
> http connect?
>
>
> --
>  php developer / CoreTrek AS        | Moody bitch with attitude, seeks
nice,
>  Sandnes / Rogaland / Norway        | good-looking guy to dump on.
>  web: http://www.moijk.net/         |
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






On 04 Apr 2001 03:15:25 -0500, Plutarck wrote:
> As in when you pull up a site in your browser, or when you use a script to
> make an http connection to another site?

I want to make a connection to a foreign webserver and fetch the headers
as well as the content. I was wondering of a 'painless' way instead of
messing around on a lower level.

> If you are using your browser on a windows box you can use a program called
> Proxomitron. Just use it's log window to see all the HTTP connection fun.

I haven't access to a windows computer. beside, that wouldn't help me
anyway.

-- 
 php developer / CoreTrek AS        | Be careful when a loop exits to the same
 Sandnes / Rogaland / Norway        | place from side and bottom. 
 web: http://www.moijk.net/         | 




wget -s apache.org

works on *nix or windows, puts all headers and content to a file
eg saves to index.html which contains;
======8<============
HTTP/1.1 200 OK
Date: Wed, 04 Apr 2001 09:13:58 GMT
Server: Apache/2.0.16 (Unix)
Cache-Control: max-age=0
=======8<===========
etc
then content

PS Apache 2.0.16 could be beta, have four +1's :-)

> -----Original Message-----
> From: Geir Eivind M?rk [mailto:[EMAIL PROTECTED]]On Behalf Of Geir
> Eivind Mork
> Sent: Wednesday, 4 April 2001 18:22
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] read headers.
> 
> 
> On 04 Apr 2001 03:15:25 -0500, Plutarck wrote:
> > As in when you pull up a site in your browser, or when 
> you use a script to
> > make an http connection to another site?
> 
> I want to make a connection to a foreign webserver and 
> fetch the headers
> as well as the content. I was wondering of a 'painless' way 
> instead of
> messing around on a lower level.
> 
> > If you are using your browser on a windows box you can 
> use a program called
> > Proxomitron. Just use it's log window to see all the HTTP 
> connection fun.
> 
> I haven't access to a windows computer. beside, that 
> wouldn't help me
> anyway.
> 
> -- 
>  php developer / CoreTrek AS        | Be careful when a 
> loop exits to the same
>  Sandnes / Rogaland / Norway        | place from side and bottom. 
>  web: http://www.moijk.net/         | 
> 





Maybe a bit offtopic, but is there an equivalent for the NVL function in
Oracle for MySQL?

NVL is a function that returns a given result when a value is null

Thanks,

Dominick






"Dominick Vansevenant" <[EMAIL PROTECTED]> wrote:
> Maybe a bit offtopic, but is there an equivalent for the NVL function in
> Oracle for MySQL?
>
> NVL is a function that returns a given result when a value is null

You do know there's a MySQL list, don't you?  There's no such beast in
MySQL, but you can do this:

IF( my_field IS NULL, your_expression, my_field)

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





Hello,

is it meant that

session_register("test");
$GLOBALS['HTTP_SESSION_VARS']['test'] = 'Hello World!';

does not work properly (session variable test is not initialized with the 
value 'Hello World!') if register_globals is turned on, but when it is 
turned off?

Best regards
  Niklas 




Hi,

I need to do a simple thing. I want to read a binary
file (e.g., microsoft word, excel etc) and then
extract only the text from it. I am using simple
fopen() and fread() and when I print out the contents
of the file, it returns me the text but apart from the
text, there is some junk which is probably because of
the file being binary. 

Is it possible through the regexp to specify that I
only want some of the ASCII characters from the binary
stream? Here is the perl equivalent: 

    /([\040-\176\s]{3,})/g

I want only those words that are minimum 3 characters
and I want the characters to match the ASCII numbers
from 40 to 176. 

Would really appreciate any help 

Thanks!




__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




Try to use $HTTP_SESSION_VARS, it may work for  you.
There are many number of notes in Annotated PHP Manual. Some of them may help.

By the way, you don't need to serialize Array/Object for PHP4 session.

Regards,
--
Yasuo Ohgaki


"Christian Dechery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Why does one variable gets registered and the other don't (the order
> doesn't alter anything.. I've tried)...
>
> <snip>
> $script_total_time=(float)$total_time;
> session_register("script_total_time");
> $step_times_array[$step]=$total_time;
> $step_times=serialize($step_times_array);
> //echo "step_times=\"$step_times\"";
> session_register("step_times");
> </snip>
>
> after that (and there are no mentions to either of those vars after that),
> these are the contents of the session-cookie:
> script_total_time|d:4.8891049623489;!step_times|
>
> step_times simply doesn't get registered...
>
> BTW... the commented echo above outputs:
> step_times="a:1:{s:8:"download";d:4.8891049623489;}"
>
> what is wrong with my code?
>
> ____________________________
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
>






Dear PHP Group [EMAIL PROTECTED],

Congratulations! You just won US$10.00!!

We just gave away US$25,000.00!!  And you PHP Group [EMAIL PROTECTED] are 
among the lucky 2500 people
randomly selected to receive a FREE US$10.00 Trial Account at TheCasino.com - the
Internet's Premier Online Casino!

Account Status for PHP Group [EMAIL PROTECTED]:
Live Account Balance: US$5.00  (your cash account)
Live Buffer Balance:  US$5.00  (for extended play!)

To access your "Winning Account", please go to:

http://special.TheCasino.com/drawing.cs?winner=PHP&[EMAIL PROTECTED]&[EMAIL PROTECTED]


Again, congratulations to you PHP Group [EMAIL PROTECTED], and to the rest of 
our
most recent instant money winners!!

Enjoy your VIP visit to TheCasino.com!

Sincerely,

Ms. Kaara Moore
Director of Relations
[EMAIL PROTECTED]
http://www.TheCasino.com

TheCasino.com - Better Than Life!! (TM)
Serving Winners since 1999 - Now with 100% Bonus on Every Deposit!


==========================================================================
If you no longer wish to be considered for future Prize Give-Aways, please click on the
following link to remove yourself from our drawings:

http://www.TheCasino.com/remove.me?[EMAIL PROTECTED]
==========================================================================



Reply via email to