php-general Digest 27 Jan 2001 04:41:46 -0000 Issue 478

Topics (messages 36740 through 36952):

Invoke PHP script from onLoad handler?
        36740 by: Chuck Mayo
        36924 by: Richard Lynch

max size of array
        36741 by: Giancarlo
        36742 by: Giancarlo

URGENT:Passing input type file
        36743 by: Tan JH
        36898 by: Chris Hayes

Accessing variables from other Apache modules
        36744 by: Andreas 'Count' Kotes

Re: Splitting at word count
        36745 by: Christian Reiniger
        36768 by: Richard Lynch
        36800 by: Jose Casal-Gimenez
        36803 by: Dustin Butler

Uninstallation of CGI Version of PHP
        36746 by: [ rswfire ]

AUTH_PW & External Authentication
        36747 by: Chen Shiyuan
        36927 by: Richard Lynch
        36947 by: Chen Shiyuan

Re: Search for the documentation
        36748 by: Philip Olson
        36783 by: Brian Clark
        36797 by: Brian Clark

mirroring of databases with mysql
        36749 by: Markus H. Maussner

Re: HELP!!! PDFLIB FOR PHP!!!!!
        36750 by: webbie.server.deanox.com

phpinfo ?
        36751 by: kaab kaoutar
        36781 by: TV Karthick Kumar
        36880 by: Wayne Topa
        36884 by: Shane McBride
        36886 by: April
        36887 by: Robert Collins
        36897 by: John Guynn
        36905 by: H. Wade Minter
        36907 by: John Guynn
        36912 by: Philip Olson

Echo and Print
        36752 by: php4.mailbr.com.br
        36780 by: Nathan Cassano
        36792 by: SED
        36836 by: Philip Olson
        36840 by: kaab kaoutar
        36841 by: John Guynn
        36843 by: Philip Olson

where is -> and <<< in the manual
        36753 by: Noel Akins
        36878 by: Toby Butzon

PHP 4.0.3 on Debian?
        36754 by: Thomas Wentzel

Re: pdflib: unable to generate on the fly, need to write to file
        36755 by: webbie.server.deanox.com
        36799 by: Dominic Schanen

Authentication through a login form
        36756 by: Patrick Dunford
        36925 by: Richard Lynch

Was I'm confused, figured it out
        36757 by: Noel Akins

Re: Post without submit?
        36758 by: Max A. Derkachev

Re: How to make links?
        36759 by: Richard Lynch

Re: Date -1
        36760 by: Richard Lynch

Re: Zend hit (Encoder price)
        36761 by: Richard Lynch
        36762 by: Richard Lynch
        36808 by: Christopher Allen
        36929 by: Richard Lynch

Re: Urgent answers needed for FILE UPLOAD problem....
        36763 by: Richard Lynch
        36809 by: Rasmus Lerdorf

Re: can't upload files if extension has more than one dot.
        36764 by: Richard Lynch

Re: trouble with updating the id numbers
        36765 by: Richard Lynch

Re: Read Vs. Include
        36766 by: Richard Lynch
        36787 by: Daniel Grace

Re: Anyone who can help me making a loop of this?
        36767 by: Richard Lynch

Re: number_format() buggy round when usind database resultset
        36769 by: Richard Lynch

Re: Fopen
        36770 by: Richard Lynch
        36773 by: Klepto

Re: session without cookies
        36771 by: Richard Lynch
        36814 by: Chris Lee

Couldn't open stream error when accessing IMAP mailbox. PLEASE HELP!
        36772 by: Dezider Góra

can't upload files with more than one dot in the file name.
        36774 by: david klein

Re: Get rid of da Zero's
        36775 by: Art Wells
        36776 by: Christian Reiniger

test
        36777 by: Brian V Bonini

Re: Persistent connections and transactions
        36778 by: Nuno Silva
        36829 by: Frank Joerdens

Circle using GD
        36779 by: Piotr Duszynski
        36926 by: Richard Lynch

Flash/PHP
        36782 by: Kent Wang
        36834 by: jeremy brand
        36835 by: Rasmus Lerdorf
        36837 by: Mike Chambers

Conditional include based on virtual host ?
        36784 by: Alain Fontaine
        36928 by: Richard Lynch

Re: Ideas?? (OT- MySQL)
        36785 by: Website4S.aol.com

Re: How do I see the data in list()?
        36786 by: Scott Fletcher

array size
        36788 by: Giancarlo
        36815 by: Christian Reiniger

Re: how do you erase quotes from variable?
        36789 by: Dustin Butler

Re: sleep and usleep not working ??
        36790 by: Benny Nissen

PHP on MAC OS9
        36791 by: iGuru
        36930 by: Richard Lynch

PHP on MAC
        36793 by: iGuru
        36816 by: lou
        36862 by: Michael A. Peters

How can I specify connection timeout when open IMAP mailobox?
        36794 by: Dezider Góra

updating time fields
        36795 by: Kurth Bemis
        36817 by: Christian Reiniger

Premature end of script headers error
        36796 by: pil.topmail.de
        36931 by: Richard Lynch

I'm confused about..reffering vars &$
        36798 by: Noel Akins
        36934 by: Richard Lynch

posting plain/text with CURL?
        36801 by: Mathijs Homminga

update db
        36802 by: Kurth Bemis
        36932 by: Richard Lynch

Why the Change in Ver 4?
        36804 by: Karl J. Stubsjoen
        36933 by: Richard Lynch

form validation :ereg ()
        36805 by: kaab kaoutar
        36903 by: Felipe Lopes

disregard last two questions
        36806 by: Kurth Bemis

Do they like shut this list down at night or what?
        36807 by: Dallas Kropka
        36935 by: Richard Lynch

You can have a  visa card .. no deposit
        36810 by: garey

Re: zend ide & debugger
        36811 by: Terrence Chay

Re: Greek PHP mailing list
        36812 by: Chris Hayes
        36831 by: Chris Hayes

if ... else ...
        36813 by: Chakravarthy K Sannedhi
        36911 by: Toby Butzon

Looking for Code Example: Telneting to server to verify password
        36818 by: Scott Brown
        36895 by: Lic. Rodolfo Gonzalez Gonzalez

sessions without cookies?
        36819 by: Noel Akins
        36913 by: Chris Lee
        36936 by: Richard Lynch

which syntax?
        36820 by: kaab kaoutar
        36937 by: Richard Lynch

Using a variable to select what variable to use...???
        36821 by: Brandon Orther
        36863 by: Steve Edberg

arg....
        36822 by: Kurth Bemis
        36824 by: Krznaric Michael
        36825 by: Kurth Bemis
        36828 by: Shawn Blaylock
        36830 by: Shawn Blaylock
        36832 by: Iván Sánchez Ortega \"MR\"

Modulus
        36823 by: Mike P
        36842 by: Teodor Cimpoesu
        36909 by: Chris Lee

include_path in windows
        36826 by: Shane McBride
        36899 by: Chris Hayes

Announcement: Smarty template engine 1.2.0 released
        36827 by: Monte Ohrt

include_path again
        36833 by: Shane McBride
        36938 by: Richard Lynch

php_oracle.dll
        36838 by: kaab kaoutar
        36939 by: Richard Lynch

common.inc probs.
        36839 by: Shane McBride
        36850 by: Mark Maggelet

CGI ERROR on IIS4 and PHP 4.0.4pl1
        36844 by: Angel Behar

mod_php4 + mod_python + apache 1.3.14: no workie!
        36845 by: Aaron Faby

Re: how to rename a database
        36846 by: Dominic Schanen
        36847 by: Philip Olson

Uninstallation of CGI Version of PHP --> ISAPI Module Wanted Instead
        36848 by: rswfire

Display progress in browser using flush();   IE versus NS
        36849 by: Spallek, Heiko
        36908 by: Chris Lee
        36916 by: Sander Pilon
        36917 by: Sander Pilon
        36951 by: Chris Carbaugh

Using PHP to do centralized site authentication
        36851 by: Aaron D. Turner
        36852 by: Rasmus Lerdorf

PHP on FreeBSD 3.2
        36853 by: Julia A . Case
        36854 by: Rasmus Lerdorf
        36864 by: Julia A . Case

header problems
        36855 by: Kurth Bemis
        36859 by: Teodor Cimpoesu

File upload error
        36856 by: Data Driven Design
        36865 by: Robert Collins

Re: setting register_globals off
        36857 by: Alex Black

Re: Best way to describe Doc as HTML
        36858 by: Alex Black

Sybase
        36860 by: Rick Ridgeway

Re: Compiler? (Was Re: [PHP] PHP site on CD-ROM)
        36861 by: Alex Black

rand(), mt_rand(), and my inability to make either of them random.
        36866 by: April
        36868 by: Robert Collins
        36874 by: Philip Olson
        36875 by: April
        36877 by: April

Check for Page
        36867 by: Karl J. Stubsjoen
        36869 by: Robert Collins

PHP Library for currency conversions
        36870 by: Boget, Chris
        36889 by: Philip Olson

Help Please, MySQL is driving me insane
        36871 by: Chris
        36876 by: Jason Bouwmeester
        36879 by: Chris
        36881 by: Shane McBride
        36882 by: Shane McBride
        36883 by: Jason Bouwmeester
        36888 by: Chris

Use of exec() in windows
        36872 by: Shane McBride
        36941 by: Richard Lynch

PHP.INI
        36873 by: Steve Haemelinck
        36940 by: Richard Lynch

Detect if Header has been written
        36885 by: Karl J. Stubsjoen
        36890 by: Philip Olson

Nesting Classes?
        36891 by: Clarence Kwei

HTTP_COOKIE_VARS["htscallerid"] and url_rewriter.tags
        36892 by: Trevor DeVore

Detect directory
        36893 by: Marx Gomes
        36906 by: Chris Lee
        36923 by: Marx Gomes

Installing PHP on Windows Command Line?
        36894 by: Jonathan Sharp

move_uploaded_file - getting furthur ..still need help
        36896 by: Shane McBride
        36942 by: Richard Lynch

telnet timeout
        36900 by: Paul DN

mail()
        36901 by: TraXter
        36902 by: Toby Butzon

really need help...
        36904 by: Shane McBride
        36910 by: Iván Sánchez Ortega \"MR\"

Microsoft SQL server 7
        36914 by: Brandon Orther
        36915 by: Michael Kimsal
        36943 by: Thor M. Steindorsson
        36945 by: Michael Kimsal

Problems
        36918 by: David I Wolf

LYNX !!/ Help
        36919 by: Trunkz Santai
        36921 by: Philip Olson

Re: aborted connections? (fwd)
        36920 by: tc lewis

Where is my contrab file located?
        36922 by: Trunkz Santai

mail problems in windows2000
        36944 by: seojuyung

expressions
        36946 by: Kumanan
        36949 by: Stephan Ahonen

Re: <- functions returning multiple values Followup
        36948 by: Jerry Artman

Hello
        36950 by: Graduate

readline_completion_function enhancement
        36952 by: August Zajonc

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]


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


Sorry if this has come up before.

I want to update a select list from a mySql database whenever the
browser window gets the focus. This is because I anticipate that the
user will frequently use a second window to make additions to the
database that holds the list values while filling in the form, and I
want those additions to be in the select list when the user returns.

At present I have PHP querying the db before I output the body tag, and
an onLoad() handler passes the returned records to a Javascript which
populates the list box with the query results, but I have only figured
out how to query the db when the page initially loads. I really need to
query the db and invoke the Javascript every time the window gets focus.

So, I guess my question is twofold: can I invoke a php function with an
onLoad handler, and if so, how can I have onLoad do both things - run
the php function to query the database, then run the Javascript to
populate the list box? Or is there another way?

TIA,
Chuck Mayo





You *can* have a JavaScript handler invoke PHP -- but it requires accessing
a URL and waiting for the web-server to respond, so your response time will
not be so hot.

I'm afraid I don't recall how, but it has been posted here before...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Chuck Mayo <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:10 AM
Subject: [PHP] Invoke PHP script from onLoad handler?


> Sorry if this has come up before.
>
> I want to update a select list from a mySql database whenever the
> browser window gets the focus. This is because I anticipate that the
> user will frequently use a second window to make additions to the
> database that holds the list values while filling in the form, and I
> want those additions to be in the select list when the user returns.
>
> At present I have PHP querying the db before I output the body tag, and
> an onLoad() handler passes the returned records to a Javascript which
> populates the list box with the query results, but I have only figured
> out how to query the db when the page initially loads. I really need to
> query the db and invoke the Javascript every time the window gets focus.
>
> So, I guess my question is twofold: can I invoke a php function with an
> onLoad handler, and if so, how can I have onLoad do both things - run
> the php function to query the database, then run the Javascript to
> populate the list box? Or is there another way?
>
> TIA,
> Chuck Mayo
>
>
> --
> 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]
>





what is the max number of elements into an array?




what is the max number of elements into an array?




Hi, how can I pass an input type of file? I can get the value & I am able to open the 
specified file when I pass it from the original form to the second form but when I 
pass the value from the second form to the third form using the hidden type, the file 
cannot be found... please help. 

Thanks.

Rgds,
  JH
___________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.






> Hi, how can I pass an input type of file? I can get the value & I am able to
> open the specified file when I pass it from the original form to the second
> form but when I pass the value from the second form to the third form using
> the hidden type, the file cannot be found... please help. 

It's somewhere in the PHP manual. The uploaded file gets a temporary name, 
not the original name, and makes several vars for you, if i remember well 
they are $file.name $file.user or $file_user and $file.size but have a look 
at the manual. The name of the file input field if you called it $upl_file 
would have the file_name on the server.
So anyways you have to pass something else on than just the hidden $upl_file

Chris


--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




Hi!

I'd like to get SSL_CLIENT_S_DN from mod_ssl but don't seem to be able
to get it using getenv() or apache_note(), it doesn't even show up when
doing phpinfo() .. any hints?

   Count




On Thursday 25 January 2001 21:06, H. Wade Minter wrote:
> Does anyone have a good idea on how to split after a certain number of
> words?

Attached is code that semi-intelligently limits strings to a certain 
number of characters. Perhaps that helps you.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)
<?php

function LimitString ($TheString, $MaxChars, $Threshold = 5)
{
	if (strlen ($TheString) <= $MaxChars)
                return $TheString;

        // (1) hard upper limit is $MaxChars
        $Work = substr ($TheString, 0, $MaxChars);

	// (2) try to find a word boundary at the end to make it look nicer
	$Pos = strrpos ($Work, ' ');
	if ($Pos >= ($MaxChars - $Threshold))
		$Work = substr ($Work, 0, $Pos);

	$Work .= ' ...';

        return $Work;
}


?>




> I'm doing a page where the front page will show "news" stories.  What I'd
> like is if the story is longer than X words/chars/etc, the index page will
> show the first X words, then a link for the full story.
>
> Does anyone have a good idea on how to split after a certain number of
> words?

<?php
    if (strlen($story) > 50){
        $start = 50;
        #You may want to add "\t" and "-" and suchlike as "break" chars:
        while (isset($story[$start]) && $story[$start] != ' ' &&
$story[$start] != "\n")){
            $start++;
        }
        echo substr($story, 0, $start);
        #We may have managed to squeeze out the last word...
        if ($start < strlen($story)){
            echo "<A HREF=fullstory.php?story_id=$story_id>M O R E</A>";
        }
    }
    else{
        echo $story;
    }
?>

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







> I'm doing a page where the front page will show "news" > 
stories.  What I'd > like is if the story is longer than X 
> words/chars/etc, the index page will > show the first X 
> words, then a link for the full story. >
> Does anyone have a good idea on how to split after a > 
certain number of > words?
> 

We have a "news" section with an index page that shows the 
first 3 articles in our queue. These articles are limited 
to their first 29 words. We then add a link to the full 
article.

You can view this live: http://www.ukc.ac.uk/news/index.php

   $article = fgets($fd, 8192)
   /* Full text of your article. We get it from a file 
      using fgets($fd, 8192) */

   /* remove tags if there are any */
   $newscontent = strip_tags($article) ; 
   $pattern = " " ;
   $arr = split($pattern, $newscontent, 50);
   $story .=  ("<p>") ;
   for ($i = 0 ; $i < 29 ; $i++)
   {
      $story .= (" " . $arr[$i]) ;
   } 
   $story .= (" (cont.) <a 
href=\"yourarticlefilename.html\">Full article</a></p>\n");


We use this PHP in the <HEAD> of our document, so whenever 
we want it to be published we just use <? echo $story ; ?> 

It may not be very elegant, but it does work fine!

Hope it helps

Jose

Jose Casal-Gimenez <[EMAIL PROTECTED]>
University Web Support Officer
Communications & Development Office
G17, The Registry, University of Kent, CT2 7NZ
Tel: (01227) 823102





> I'm doing a page where the front page will show "news" 
> stories.  What I'd
> like is if the story is longer than X words/chars/etc, the 
> index page will
> show the first X words, then a link for the full story.
> 
> Does anyone have a good idea on how to split after a certain number of
> words?
> 
> Thanks,
> Wade

Put the story in an array and grab the first x elements?  Say you want 50
words you would do:

$num_of_words = 50;
$story_array = explode(" ", $story, $num_of_words);
$story_preview = implode(" ", array_pop($story));

Assuming all words are seperated by a space.

Dustin





Hello...

I just upgraded my computer to NT5.  When doing so, I accidentally installed 
the wrong version of PHP.  =(

I installed the CGI version...  I want to use the ISAPI module.  How can I 
effectively undo what the installation program did to install the CGI 
version?  What should I do to install the ISAPI module now?

Thanks in advance for your help.

Sincerely,
rswfire
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





Hello everyone!

I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled statically 
into it and running on RedHat Linux 6.2 . Apache is configured to do 
authentication for certain URLs via a auth_ldap module which is 
dynamically loaded when Apache starts.

I noticed that when I access the protected URL, PHP_AUTH_PW will give me 
the password for the user who is currently logged to the protected site. 
If I recall correctly, earlier versions of PHP4 and PHP3 didn't have 
this "feature" .

This "feature" creates a problem when the protected URL is shared by 
many parties with each party providing it's own services under the 
protected URL as any party would be able to "steal" the 
username/password without the end user knowing. The username/password is 
used to control who has access to the protected URL and the parties are 
not required to make use of the password.

Is there anyway to disable this "feature" or is the disclosure of the 
password a bug?

Many thanks for any advice!




> I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled statically
> into it and running on RedHat Linux 6.2 . Apache is configured to do
> authentication for certain URLs via a auth_ldap module which is
> dynamically loaded when Apache starts.
>
> I noticed that when I access the protected URL, PHP_AUTH_PW will give me
> the password for the user who is currently logged to the protected site.
> If I recall correctly, earlier versions of PHP4 and PHP3 didn't have
> this "feature" .

Hmm.  It was always there if PHP was doing the authentication -- but I dunno
if auth_ldap always had it.

You may be able to configure auth_ldap to not put it into the environment.

Now, I could be grossly mistaken, but you're only seeing your own password,
not somebody else's, right?...

> This "feature" creates a problem when the protected URL is shared by
> many parties with each party providing it's own services under the
> protected URL as any party would be able to "steal" the
> username/password without the end user knowing. The username/password is
> used to control who has access to the protected URL and the parties are
> not required to make use of the password.

Oh...  I'm not sure I follow this...  You're giving them access to a URL,
using a password shared by a group somehow, but they don't actually know
their own password?   How does the password get into the picture to start
with?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






On Fri, 26 Jan 2001 17:36:57 -0600, Richard Lynch <[EMAIL PROTECTED]> 
wrote :

> > I am currently using Apache-1.3.14 with php-4.0.4pl1 compiled
> statically
> > into it and running on RedHat Linux 6.2 . Apache is configured
> to do
> > authentication for certain URLs via a auth_ldap module which
> is
> > dynamically loaded when Apache starts.
> >
> > I noticed that when I access the protected URL, PHP_AUTH_PW
> will give me
> > the password for the user who is currently logged to the
> protected site.
> > If I recall correctly, earlier versions of PHP4 and PHP3 didn't
> have
> > this "feature" .
> 
> Hmm.  It was always there if PHP was doing the authentication --
> but I dunno
> if auth_ldap always had it.

errmm.. PHP wasn't doing the authentication. Basically I am using the 
basic Apache .htaccess authentication which calls auth_ldap to do 
authentication to a backend LDAP server. PHP is just used for "simple" 
website scripting and such.

previously when using earlier versions of PHP3 and PHP4 (can't really 
recall the versions number), I am quite certain PHP_AUTH_PW doesn't hold 
the user's password (under exactly the same configuration) as back then 
I was *trying* to find means and ways to get out the password so as to 
automate certain processess without the user having to enter the 
password multiple times but it was not successful. Only after upgrading 
to 4.0.3 then I noticed that PHP_AUTH_PW is now holding the user's 
password.

> Now, I could be grossly mistaken, but you're only seeing your own
> password,
> not somebody else's, right?...

yeap... i am seeing my own password.

> > This "feature" creates a problem when the protected URL is
> shared by
> > many parties with each party providing it's own services under
> the
> > protected URL as any party would be able to "steal" the
> > username/password without the end user knowing. The
> username/password is
> > used to control who has access to the protected URL and the
> parties are
> > not required to make use of the password.
> 
> Oh...  I'm not sure I follow this...  You're giving them access
> to a URL,
> using a password shared by a group somehow, but they don't
> actually know
> their own password?   How does the password get into the picture
> to start
> with?

errm not really. each person has his/her own username/password which is 
unique and personal to each person and is also used for other purposes.

The situation is that I have this main site which requires each person 
to "login" using their own username/password before gaining access so as 
to prevent unauthorised access to the site. And then within the site 
itself, there are different groups of developers (which may or may not 
be the same as the users, they can be outsiders too) which write their 
own programs for different purposes, i.e. forum, chatroom etc.

So the problem arises as these developers will be able to capture the 
password of the user who is accessing the program for good or for bad 
without the user knowing at all as the developer can just save the 
PHP_AUTH_USER and PHP_AUTH_PW into somewhere and this could constitute a 
security problem.

Erm... do you have any idea how to overcome this problem?

Many thanks in advance for your help!




Hi Brian,

This is a good idea.  I just played with it a bit and notice for it
to work "properly" one must space out the function so (pretending that |
is our cursor) :

This works :

    |mysql_pconnect ('...');

This does not :

    |mysql_pconnect('...');

As it interpets it all together as one CurWord.  Is there a way around
this?  Like creating an alphanumeric form of "CurWord" ? Hmm.  Anyway,
this is pretty cool and should be exploited by all editplus users.  At
some point everyone should look into doing this for other editors too.

Regards,

Philip

On Thu, 25 Jan 2001, Brian Clark wrote:

> 
> Hello Philip, 
> 
> (PO == "Philip Olson") [EMAIL PROTECTED] forecasted:
> 
> PO> http://www.php.net/tips.php
> 
> PO> it will turn your browser into a search machine.
> 
> Even better, for people who use EditPlus (sorry, unsure about other
> editors) you can do this with just one shortcut from within EditPlus
> itself.
> 
> Since IE 5 is my primary browser:
> 
> Follow the instructions on http://www.php.net/tips.php for adding the
> Quick Search add-on. (I named my shortcut php, but you could use
> anything you wanted.)
> 
> Then in EditPlus, go to:
> 
>  Tools -> Configure User Tools
>  Click on the 'Add Tool >>' button.
>  Choose 'Program' from the pop-out.
>  I named mine 'PHP Search'
>  Command: C:\Program Files\Internet Explorer\Iexplore.exe
>  Argument: php $(CurWord)
> 
>  (Where 'php' in the above is the same shortcut name you entered in IE
>  Quicksearch)
>  
>  Initial Directory: leave it blank or you'll get the the 'Launch
>  Window' MS-DOS box along with the browser.
> 
>  Click 'Apply' then 'OK'
> 
> Now, when you need to consult the manual for a specific function (or
> heck, any term), just hit Ctrl+[number] where [number] is the shortcut
> displayed beside 'PHP Search' in the Tools menu.
> 
> For example, if I placed my cursor right before the 'm' in:
> 
>  @mysql_pconnect($host, $username, $password)
> 
> And hit Ctrl+6, it opens IE and takes me straight to:
> 
> http://www.php.net/manual/en/function.mysql-pconnect.php
> 
> For the 'Argument' line in 'Configure User Tools' you could also use
> php $(CurSel) but you'll have to highlight a word before you hit
> Ctrl+[number].
> 
> If you're not using IE, this should still be pretty easy to configure.
> 
> If anyone can't get this to work, let me know off-list. I'll be glad
> to help.
> 
> -Brian
> 
> 
> 
> -- 
> 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]
> 






Hello Philip, 

(PO == "Philip Olson") [EMAIL PROTECTED] ciphered:

PO> This is a good idea. I just played with it a bit and notice for it
PO> to work "properly" one must space out the function so (pretending
PO> that | is our cursor) :

<snip>

Both examples work with my version of EditPlus (see below).

PO> As it interpets it all together as one CurWord. Is there a way
PO> around this? Like creating an alphanumeric form of "CurWord" ?
PO> Hmm. Anyway, this is pretty cool and should be exploited by all
PO> editplus users. At some point everyone should look into doing this
PO> for other editors too.

Ah, well it depends one which version you're using. Ack, in that case
you could always use $(CurSel) and highlight the function name and it
would work OK in all versions (but an upgrade would be better).

I'm using Beta 2.10a (I'm in the Beta program), but I'm not completely
sure when this new feature was added (some where between 2.00 and
2.10a):

If you go into settings and syntax for PHP in Preferences, I see a
'function pattern' text field which has:

^[ \t\s]*function[ \t\s].*\([^;]*$

And I'm now guessing that's why $(CurWord) is smart enough to "figure
it out" :-)

-Brian
--
In computing, the mean time to failure keeps getting shorter.







(BC == "Brian Clark") [EMAIL PROTECTED] betokened:

BC> I'm using Beta 2.10a (I'm in the Beta program), but I'm not
BC> completely sure when this new feature was added (some where
BC> between 2.00 and 2.10a):

BC> If you go into settings and syntax for PHP in Preferences, I see a
BC> 'function pattern' text field which has:

BC> ^[ \t\s]*function[ \t\s].*\([^;]*$

BC> And I'm now guessing that's why $(CurWord) is smart enough to
BC> "figure it out" :-)

No, that's not right either. That shouldn't have anything to do with
it. Because it still works with something like:

$GLOBALS['|HTTP_HOST'] for HTTP_HOST and $|GLOBALS['HTTP_HOST'] for
the word globals.

Where | is the cursor.

Ahh! It's because of the new (?) 'Word Delimiters' field in Prefs ->
General where you have: ,.?!;:/<>(){}[]"'

Spiffy.

-Brian






hi..

are there anny functions / tools to "syncronize" or "mirror" two
databases.. ?

like i have one database (mysql) at my isp and one local here at my
development server, and i want to start every xx h a scripte who compares
the two databases and makes them "the same"..

thanks a lot







Quoting Bruno Freire <[EMAIL PROTECTED]>:

> I need learn how to install this library to create pdf files
> dinamicaly.!!!

There are three ways to generate PDF files in PHP.
1. PDFlib
2. ClibPDF
3. Adobe FdfTk (which is really Forms Data Format and not PDF and may require 
one of the above in addition to itself)

I use pdflib, haven't tried using ClibPDF, and have been unsuccessful in my 
attempts to integrate FdfTk with PHP 4.0.4 and 4.0.4pl1.

You get pdflib from http://www.pdflib.com.  You need to read the instructions 
found in the source and compile it accordingly.  You'll find additional help on 
the PHP.net website (search for phplib).  Then, after installing phplib, you 
need to compile and reinstall PHP to use pdflib by adding --with-phplib to your 
configure command.  Also see the instructions on the PHP.net website.


Lee Howard




Hi there!

I'm sure it's a stupid problem but the phpinfo does work while trying the 
following html code:

<html><head><title>PHP Test</title></head>
<body>
<?php phpinfo() ?>

</body></html>

the result is a blank page!

And when i create an php file with only: <?php phpinfo() ?>
i have a dos window where a list of information is listed quickly then 
shut!(i can hardly see it)
by the way is it the same to put php code between <?php ?>
and <? ?> and <script language=php> </script> ?

thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





It works for me !. No probs !.

~ Karthick

----- Original Message -----
From: kaab kaoutar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 3:23 PM
Subject: [PHP] phpinfo ?


> Hi there!
>
> I'm sure it's a stupid problem but the phpinfo does work while trying the
> following html code:
>
> <html><head><title>PHP Test</title></head>
> <body>
> <?php phpinfo() ?>
>
> </body></html>
>
> the result is a blank page!
>
> And when i create an php file with only: <?php phpinfo() ?>
> i have a dos window where a list of information is listed quickly then
> shut!(i can hardly see it)
> by the way is it the same to put php code between <?php ?>
> and <? ?> and <script language=php> </script> ?
>
> thanks
> _________________________________________________________________________
> 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]
>
>






        Subject: [PHP] phpinfo ?
        Date: Fri, Jan 26, 2001 at 03:23:16PM -0000

In reply to:kaab kaoutar

Quoting kaab kaoutar([EMAIL PROTECTED]):
> Hi there!
> 
> I'm sure it's a stupid problem but the phpinfo does work while trying the 
> following html code:
> 
> <html><head><title>PHP Test</title></head>
> <body>
> <?php phpinfo() ?>
> 
> </body></html>
> 
> the result is a blank page!

I'm just getting into PHP but I think your messing a ;.
ie <?php phpinfo(); ?>

:-) HTH, YMMV, HAND :-)

-- 
A bug in the code is worth two in the documentation.
_______________________________________________________




Try this:

<html>
<body>

<?php
  phpinfo();
?>

</body>
</html>

-Shane
----- Original Message -----
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:23 AM
Subject: [PHP] phpinfo ?


> Hi there!
>
> I'm sure it's a stupid problem but the phpinfo does work while trying the
> following html code:
>
> <html><head><title>PHP Test</title></head>
> <body>
> <?php phpinfo() ?>
>
> </body></html>
>
> the result is a blank page!
>
> And when i create an php file with only: <?php phpinfo() ?>
> i have a dos window where a list of information is listed quickly then
> shut!(i can hardly see it)
> by the way is it the same to put php code between <?php ?>
> and <? ?> and <script language=php> </script> ?
>
> thanks
> _________________________________________________________________________
> 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]
>





Look at your source, also.  Do you still see the <? phpinfo(); ?> part of
the page?  If you do, it's not being processed.  (configuration is wrong,
you named it .htm, something like that).

----- Original Message -----
From: "Shane McBride" <[EMAIL PROTECTED]>
To: "kaab kaoutar" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 3:30 PM
Subject: Re: [PHP] phpinfo ?


> Try this:
>
> <html>
> <body>
>
> <?php
>   phpinfo();
> ?>
>
> </body>
> </html>
>
> -Shane
> ----- Original Message -----
> From: "kaab kaoutar" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 10:23 AM
> Subject: [PHP] phpinfo ?
>
>
> > Hi there!
> >
> > I'm sure it's a stupid problem but the phpinfo does work while trying
the
> > following html code:
> >
> > <html><head><title>PHP Test</title></head>
> > <body>
> > <?php phpinfo() ?>
> >
> > </body></html>
> >
> > the result is a blank page!
> >
> > And when i create an php file with only: <?php phpinfo() ?>
> > i have a dos window where a list of information is listed quickly then
> > shut!(i can hardly see it)
> > by the way is it the same to put php code between <?php ?>
> > and <? ?> and <script language=php> </script> ?
> >
> > thanks
> >
_________________________________________________________________________
> > 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]
> >
>
>
> --
> 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]
>





looks like you forgot the semi-colon (;) at the end of phpinfo();

Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com

----- Original Message -----
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:23 AM
Subject: [PHP] phpinfo ?


> Hi there!
>
> I'm sure it's a stupid problem but the phpinfo does work while trying the
> following html code:
>
> <html><head><title>PHP Test</title></head>
> <body>
> <?php phpinfo() ?>
>
> </body></html>
>
> the result is a blank page!
>
> And when i create an php file with only: <?php phpinfo() ?>
> i have a dos window where a list of information is listed quickly then
> shut!(i can hardly see it)
> by the way is it the same to put php code between <?php ?>
> and <? ?> and <script language=php> </script> ?
>
> thanks
> _________________________________________________________________________
> 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]
>




Actually what you need is <?php echo phpinfo(); ?> otherwise you're never
going to get anything on the screen.

John Guynn

This email brought to you by RFCs 821 and 1225.


-----Original Message-----
From: Robert Collins [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 3:30 PM
To: kaab kaoutar; [EMAIL PROTECTED]
Subject: RE: [PHP] phpinfo ?


looks like you forgot the semi-colon (;) at the end of phpinfo();

Robert W. Collins
[snip]
----- Original Message -----
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:23 AM
Subject: [PHP] phpinfo ?


> Hi there!
>
> I'm sure it's a stupid problem but the phpinfo does work while trying the
> following html code:
>
> <html><head><title>PHP Test</title></head>
> <body>
> <?php phpinfo() ?>
>
> </body></html>
>
> the result is a blank page!
[snip]




That's incorrect, at least under PHP4.  I've got the following file that
does the phpinfo stuff perfectly:

#### BEGIN FILE
<?  phpinfo() ?>
#### END FILE

On Fri, 26 Jan 2001, John Guynn wrote:

> Actually what you need is <?php echo phpinfo(); ?> otherwise you're never
> going to get anything on the screen.
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>
>
> -----Original Message-----
> From: Robert Collins [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 3:30 PM
> To: kaab kaoutar; [EMAIL PROTECTED]
> Subject: RE: [PHP] phpinfo ?
>
>
> looks like you forgot the semi-colon (;) at the end of phpinfo();
>
> Robert W. Collins
> [snip]
> ----- Original Message -----
> From: "kaab kaoutar" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 10:23 AM
> Subject: [PHP] phpinfo ?
>
>
> > Hi there!
> >
> > I'm sure it's a stupid problem but the phpinfo does work while trying the
> > following html code:
> >
> > <html><head><title>PHP Test</title></head>
> > <body>
> > <?php phpinfo() ?>
> >
> > </body></html>
> >
> > the result is a blank page!
> [snip]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





I've always used the echo and it does work under PHP4...just tested it on
www.teamkaos.org before I made my post.

John Guynn

This email brought to you by RFCs 821 and 1225.


-----Original Message-----
From: H. Wade Minter [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 4:47 PM
To: John Guynn
Cc: Php (E-mail)
Subject: RE: [PHP] phpinfo ?


That's incorrect, at least under PHP4.  I've got the following file that
does the phpinfo stuff perfectly:

#### BEGIN FILE
<?  phpinfo() ?>
#### END FILE

On Fri, 26 Jan 2001, John Guynn wrote:

> Actually what you need is <?php echo phpinfo(); ?> otherwise you're never
> going to get anything on the screen.
>
> John Guynn
[snip]
> -----Original Message-----
> From: Robert Collins [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 3:30 PM
> To: kaab kaoutar; [EMAIL PROTECTED]
> Subject: RE: [PHP] phpinfo ?
>
>
> looks like you forgot the semi-colon (;) at the end of phpinfo();
>
> Robert W. Collins
> [snip]
> ----- Original Message -----
> From: "kaab kaoutar" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 10:23 AM
> Subject: [PHP] phpinfo ?
>
>
> > Hi there!
> >
> > I'm sure it's a stupid problem but the phpinfo does work while trying
the
> > following html code:
> >
> > <html><head><title>PHP Test</title></head>
> > <body>
> > <?php phpinfo() ?>
> >
> > </body></html>
> >
> > the result is a blank page!
> [snip]





> Actually what you need is <?php echo phpinfo(); ?> otherwise 
> you're never going to get anything on the screen.

Some functions do act this way yes but not phpinfo, phpinfo() spits out
information and has no need for a print or echo.

    function bar()
    {
       Return 'blah';
    }

    function foo()
    {
       print 'blah';
    }

Now, bar() alone will not spit out the information but print bar() will.
People create functions this way for many reasons, one of which is to
allow for :

    $var = bar();

Where $var is now equal the output of bar() which is 'blah'.  Now if one
does just this :

    foo();

It will spit out 'blah' and no echo or print is needed.  But doing :

   print foo();

Will also work but is not at all needed.  

This is sorta how phpinfo works, it just spits out information for us.
Why am I using the word spit?  Not sure :)  Return can be read about here
:

    http://www.php.net/manual/en/functions.returning-values.php

Regarding the semi-colon discussion within this thread, it is not required
to make this work, see :

http://php.net/manual/en/language.basic-syntax.instruction-separation.php

Regards,

Philip

On Fri, 26 Jan 2001, John Guynn wrote:

> Actually what you need is <?php echo phpinfo(); ?> otherwise you're never
> going to get anything on the screen.
> 
> John Guynn
> 
> This email brought to you by RFCs 821 and 1225.
> 
> 
> -----Original Message-----
> From: Robert Collins [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 3:30 PM
> To: kaab kaoutar; [EMAIL PROTECTED]
> Subject: RE: [PHP] phpinfo ?
> 
> 
> looks like you forgot the semi-colon (;) at the end of phpinfo();
> 
> Robert W. Collins
> [snip]
> ----- Original Message -----
> From: "kaab kaoutar" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 10:23 AM
> Subject: [PHP] phpinfo ?
> 
> 
> > Hi there!
> >
> > I'm sure it's a stupid problem but the phpinfo does work while trying the
> > following html code:
> >
> > <html><head><title>PHP Test</title></head>
> > <body>
> > <?php phpinfo() ?>
> >
> > </body></html>
> >
> > the result is a blank page!
> [snip]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






I know it is a kind of stupid question but I was trying to figure out 
the difference between "Echo" and "Print" and I didn't find it...Could 
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!





As I understand it, echo is somewhat of an language construct and print is a
function.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Echo and Print


I know it is a kind of stupid question but I was trying to figure out
the difference between "Echo" and "Print" and I didn't find it...Could
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

--
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, I cut & paste this from an earlier e-mail from this list, hope it helps:

----------------------------------------------------------------------------
-
The print() function returns a boolean indicating the status of the call. If
the write was successful, print() returns 1. If not, it returns 0. This can
be used to detect when the client has closed the connection, and appropriate
measures taken. The builtin echo does not provide this same service.

This may be handy for you, though there's probably a lot more to it.

HTH
Jon
----------------------------------------------------------------------------
-

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 26. janúar 2001 11:37
To: [EMAIL PROTECTED]
Subject: [PHP] Echo and Print


I know it is a kind of stupid question but I was trying to figure out
the difference between "Echo" and "Print" and I didn't find it...Could
anybody explain that to me??
Thank you

Felipe Lopes


MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

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







What is the difference between echo and print             ?
-----------------------------------------------------------
http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41

Philip

On 26 xxx -1 [EMAIL PROTECTED] wrote:

> I know it is a kind of stupid question but I was trying to figure out 
> the difference between "Echo" and "Print" and I didn't find it...Could 
> anybody explain that to me??
> Thank you
> 
> Felipe Lopes
> 
> 
> MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
> Faça já o seu. É gratuito!!!
> 
> -- 
> 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]
> 






print is a function where u can add html tags like
print("<br><b> hello $name") however echo is a command where we can't 
include html tags ! echo "hello".$name


>From: Philip Olson <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] Echo and Print
>Date: Fri, 26 Jan 2001 18:29:27 +0000 (GMT)
>
>
>
>What is the difference between echo and print             ?
>-----------------------------------------------------------
>http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41
>
>Philip
>
>On 26 xxx -1 [EMAIL PROTECTED] wrote:
>
> > I know it is a kind of stupid question but I was trying to figure out
> > the difference between "Echo" and "Print" and I didn't find it...Could
> > anybody explain that to me??
> > Thank you
> >
> > Felipe Lopes
> >
> >
> > MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
> > Faça já o seu. É gratuito!!!
> >
> > --
> > 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]
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





WOW, I'm surprised to learn this as I display MANY html tags using echo and
it works great.

The info below is totally incorrect, echo will send out html tags no
problem.

John Guynn

This email brought to you by RFCs 821 and 1225.


-----Original Message-----
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 12:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Echo and Print



print is a function where u can add html tags like
print("<br><b> hello $name") however echo is a command where we can't 
include html tags ! echo "hello".$name




> print is a function where u can add html tags like
> print("<br><b> hello $name") however echo is a command where we can't 
> include html tags ! echo "hello".$name

This is VERY incorrect, please read this :

> >What is the difference between echo and print             ?
> >-----------------------------------------------------------
> >http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/41

And then try this :

$name = 'fred';

echo  "<br><b>$name</b><br>" . $name;
print "<br><b>$name</b><br>" . $name

Then try this     :

echo  'sup','yo';
print 'sup','yo'; // Parse error!

But that FAQ explains it better then I can so ...

Philip

> >On 26 xxx -1 [EMAIL PROTECTED] wrote:
> >
> > > I know it is a kind of stupid question but I was trying to figure out
> > > the difference between "Echo" and "Print" and I didn't find it...Could
> > > anybody explain that to me??
> > > Thank you
> > >
> > > Felipe Lopes






where is -> and <<< in the manual? I see -> used with vars and <<< with 
doc. I assume that they are operators of some kind, but didn't find them in 
the operators section of the manual. Are there any other items like these 
found in php4?
thanks





The -> operator is used with class objects. See the manual
section on classes & objects ;)

The <<< is used with here-doc strings. I believe you'll find
it in the strings section of the manual.

Examples:
$myObj = new myClass;
$myObj->somevar = "This is some var";

$str = <<<END_STRING
This is my string.
END_STRING;

echo <<<END_ECHO
This is my text and my string says '$str'.
END_ECHO;

--Toby

----- Original Message -----
From: "Noel Akins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 25, 2001 6:19 PM
Subject: [PHP] where is -> and <<< in the manual


> where is -> and <<< in the manual? I see -> used with vars
and <<< with
> doc. I assume that they are operators of some kind, but
didn't find them in
> the operators section of the manual. Are there any other
items like these
> found in php4?
> 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]
>
>





Hi again,

Okay! I am now able to compile (and use) Lerdorfs stocks example on 
my Laptop which runs RedHat... But I still can't get it to work on 
my Debian (work machine).

I use the following configure string on both machines - only differences
is the paths to pgsql and apxs
configure --enable-module=so --without-mysql --with-pgsql=/usr/local
--with-stocks=shared

On my RedHat (which has PHP 4.0.4) I get a nice little stocks.so...
On my Debian (which has PHP 4.0.3) I get a not so nice little stocks.a

I just noticed... That I get a warning when compiling on my Debian - I
guess it's nothing, but I'm grasping for straws here...
The warning is:
Thomas:/usr/local/src/php4-4.0.3pl1# make install > fisse2
In file included from sapi_apache.c:58:
/usr/local/src/php4-4.0.3pl1/php_version.h:3: warning: `PHP_VERSION'
redefined
/usr/local/src/php4-4.0.3pl1/main/php_version.h:3: warning: this is the
location of the previous definition

Is anybody able to compile .so files on Debian??

Thomas




Quoting Dominic <[EMAIL PROTECTED]>:
> 
> Any reason why I have to write the pdf to disk instead of just sending
> it to the browser? Am I missing an output function? Thanks.
> 

I don't know, but I'd love to know the answer to this, too.  I currently have 
to do the same as you: output to file and then direct the browser to the disk-
based file.  (Then I have to bother about file cleanup.)

Thanks.

Lee Howard




On Thu, 25 Jan 2001 18:42:41 -0700 (MST), [EMAIL PROTECTED]
wrote:

>I don't know, but I'd love to know the answer to this, too.  I currently have 
>to do the same as you: output to file and then direct the browser to the disk-
>based file.  (Then I have to bother about file cleanup.)

I had pdflib version 3.03 and found the patch that Uwe talked about and
that fixed my problem with the creating pdfs out of memory. However,
with IE, you will need to create it from file so you can get the
document length so that IE displays the document appropriately. What I
do to get around this is create the document in a tmp folder with the
time stamp and then unlink the same file after I have appropriately
fpassthru() the file to the browser with the appropriate headers for IE
(Content-length).

--
Dominic





I want to replace the popup dialog box that occurs when a user accesses a
password protected area, with a login screen. How do I do that?

Someone told me I had to use a cookie to say the person is logged on and
read it whenever I needed to verify their access.

Is it possible to trap the request made to the browser for a
username/password and then pass these back to the server whenever the server
requires authentication?

=======================================================================
Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/

   Blessed is the man who does not walk in the counsel of the
wicked or stand in the way of sinners or sit in the seat of
mockers.
    -- Psalm 1:1
http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010125
=======================================================================
Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/





By definition, if you want to use HTTP Authentication with the browser
taking care of username/password automagically, you get that popup box.

If you don't want the popup box, you need to "roll your own" with cookies
etc.

Fortunately, "roll your own" now mainly consists of doing this:

<?php
    session_start();
    session_register('foo');
    session_register('bar');
    #etc for each variable that is about to appear
    #in the script that you want to be "saved"
    #for other pages.
    #Other pages need session_start() at the top
    #and can register any "new" variables to add to the "save" list
?>

Then, you just need a form with username/password and a submit button, and
some way to look up who is or isn't valid so you can accept or reject their
entry into the system.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Patrick Dunford" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:23 AM
Subject: [PHP] Authentication through a login form


> I want to replace the popup dialog box that occurs when a user accesses a
> password protected area, with a login screen. How do I do that?
>
> Someone told me I had to use a cookie to say the person is logged on and
> read it whenever I needed to verify their access.
>
> Is it possible to trap the request made to the browser for a
> username/password and then pass these back to the server whenever the
server
> requires authentication?
>
> =======================================================================
> Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/
>
>    Blessed is the man who does not walk in the counsel of the
> wicked or stand in the way of sinners or sit in the seat of
> mockers.
>     -- Psalm 1:1
> http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010125
> =======================================================================
> Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/
>
>
> --
> 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]
>





parse lines right to left
thanks anyway





Hello Chris,

Friday, January 26, 2001, 8:23:27 AM, you wrote:

C> is there anyway to post without clicking a submit button?

You can, e.g. using javascript event.
on<Something>="document.forms['formname'].submit()"

-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 






> How do make admin site that lists htm documents from directory and i can
> define link name to each of these?
> So when user comes, he sees link list to these documents, with names i
> defined.

Something not unlike this might work:
[Untested code]

create table links(
    linkid int(11) auto_increment unique not null,
    title text,
    directory text,
    filename text
);

<?php
    exec("/usr/bin/pwd", $results, $error);
    if ($error){
        die("Error $error executing pwd.  Usually path/permissions.<BR>\n");
    }
    $directory = $results[0];
    $query = "select title, filename from links where directory =
'$directory'";
    $links = mysql_query($query) or die(mysql_error());
    while(list($title, $filename, $url) = mysql_fetch_row($links)){
        $link[$filename] = $title;
    }
    $dir = opendir($directory);
    $urldir = substr($directory,
strlen("/full/path/to/your/web/root/htdocs/"));
    while($filename = readdir($dir)){
        if (isset($link[$filename])){
            echo "<A HREF=$urldir/$filename>$link[$filename]</A><BR>\n";
        }
        else{
            echo "<A HREF=$urldir/$filename>$filename</A><BR>\n";
        }
    }
?>

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






>I am trying to show the records created from the previous day. How can I
make it show the date before today? My date field is like 2001-01-24
16:13:51. Below shows the current day...
>
>
>$FileDate = date ("Y-m-d");
>
>$connection = mysql_connect ("localhost", "*****", "******");
>if ($connection == false){
>  echo mysql_errno().": ".mysql_error()."<BR>";
>  exit;
>}
>
>$query = "select * from warbirds_db WHERE FileDate LIKE '%$FileDate%' ORDER
BY FileID DESC";
>$result = mysql_db_query ("combatfs", $query);

Might be easier/better to use MySQL's date_add() and/or date_format() or
whatever they called it.
http://mysql.org

You'll just do:

$query = "select ... where date_format("Y-m-d", FileDate) =
date_format("Y-m-d", date_sub(now(), '1 day'))";

Only odds are really got I got the function names/syntax wrong since I don't
use MySQL.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> > Well, without the Encoder the entire *possibility* of "seriously
proprietary
> > kickass scripts" that people distribute and sell is out of the question.
>
> If there are some things you really need to hide, and perhaps also really
> need to make fast, then write yourself a PHP extension in C that

I dunno...  Once you start writing chunks of it in C code, it doesn't really
seem like a script to me...

And let's not forget why you started PHP in the first place -- Not everybody
who has a cool idea can wrap their brain around the monster that is C.

I daresay anybody that can afford the $6000 can probably afford to hire a C
hacker for the bits they can maybe figure out as modular and critical enough
to go that route... If they can even modularize the "critical" bits from the
rest at all.

But at that point, it starts to look a lot more like a C program with some
interface widgets in PHP, rather than a PHP script really.

I *do* see your point though, and it's perfectly valid.  Some people *can*
write extensions in C and go that route, so Jim's statement was a bit
strong.

But you'd sure have to pay me way more than $6000 to hack in C again. :-)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> You are entirely correct.  However, I (personally) feel that by pricing it
so
> high you're targeting a very small niche market at a higher rate.  Pricing
it
> in the "$300.00" range would not cost you that niche - but it would gain
you
> the "x-million" users/freelance developers.  Sure, $6,000 is 20x $300, but
> it's ONLY x20.  When you're talking about a userbase on the 'net, x20 is
> NOTHING.  "Go big and expensive" seems the "old way" and "go small and
> dominate the market" seems the new...um, paradigm.  (Yes, I just wanted
> to say that word.  For all it's overuse, I think it just looks neat.)

Unfortunately, it's not that simple.

You haven't factored in Support costs nor administrative overhead nor...
Well, I don't know what else the Marketing folks do when they figure these
things out, but that's why I'm not in Marketing, eh?

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







> Unfortunately, it's not that simple.
>
> You haven't factored in Support costs nor administrative overhead nor...
> Well, I don't know what else the Marketing folks do when they figure these
> things out, but that's why I'm not in Marketing, eh?


Right it's not my game either (marketing), but perhaps Zend would be willing
to supply why the price is at $6,000.
As you said above , it doesn't just stop when I buy the encoder. Whose going
to do the encoding and continue doing the encoding
with continued releases etc? A graphic designer? A consultant? I  have
listened to the arguments, 6000 is steep when you compare it with a download
from freshmeat. Writing  a c-module is not *that* far away from writing some
of the more complicated php/perl/python scripts.
Indeed this is what furthers php. I would rather see Zend charging for
support contracts, rather than the actual product....






> > Unfortunately, it's not that simple.
> >
> > You haven't factored in Support costs nor administrative overhead nor...
> > Well, I don't know what else the Marketing folks do when they figure
these
> > things out, but that's why I'm not in Marketing, eh?
>
>
> Right it's not my game either (marketing), but perhaps Zend would be
willing
> to supply why the price is at $6,000.
> As you said above , it doesn't just stop when I buy the encoder. Whose
going
> to do the encoding and continue doing the encoding
> with continued releases etc? A graphic designer? A consultant? I  have
> listened to the arguments, 6000 is steep when you compare it with a
download
> from freshmeat. Writing  a c-module is not *that* far away from writing
some
> of the more complicated php/perl/python scripts.
> Indeed this is what furthers php. I would rather see Zend charging for
> support contracts, rather than the actual product....

The Unlimited Encoder comes with "First-year software maintenance and
support services free" as stated on
http://www.zend.com/store/products/zend-encoder.php not 60 days, as
mistakenly reported in various threads.

The 60 days Support is for other Zend Products

Now, we're not going to come over to your house and encode your files for
you, not even for $6000 :-)

So, if you like, you can think of a big chunk of that $6000 being for the
year of Support, and then it may seem more reasonable.

Also, I wouldn't expect a new version of PHP nor any Zend products to
require you to re-encode all your files.  There might be some exceptions,
say if function parameters are altered or functions are deprecated, but not
on a wholesale basis.

Still, if the Freshmeat projects are more suitable for your needs and
budget, by all means use them.  I've heard no reviews of any encoder-like
projects, though, so can't help you with the performance/reliability etc for
those.  Sorry.

I'd be interested in any references to objective comparisons or reviews,
however.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Hello all. I've spent the past month or two implementing a file upload
> utility for the web based on PHP's http upload method. It works fine for
> smaller files, and it's been working fine for files I've tried up to and
> including 400 megs at a time. The problem I'm having is that we want to
> roll this out on a center-wide scale, but that would most likely mean
files
> up to 1Gig being uploaded at a time. Is this possible through the http
> upload process. I've been unsuccessful thus far to upload a file this
large
> for some reason. Upon checking the Apache error_log, I found the following
> message:
>
> FATAL: erealloc(): Unable to allocate 112568001 bytes
> [error] PHP Warning: File Upload Error - No Mime boundary found after
start
> of file header in unknown line 0

Woof!

Okay, I can't even imagine somebody sitting through a 1Gig upload, but let's
assume that it really is reasonable for your application.

If you are conking out at ~400 M, I'm going to make a SWAG that maybe the
file upload procedure basically tries to suck it all in through RAM and
isn't paging it to disk and dumping RAM as it goes.  You go past 256 okay,
cuz you got swap space (standard swap of 1:1 for real RAM).

So, as a test, make your swap partition + RAM = 800M and see if you get
around 700M before it conks out.

You may also want to read the PHP source code involving the file upload
functions and see if there's anything you can puzzle out about them and how
they work.

You may just need to add some code to page the upload to disk as it comes in
and free up the RAM that's the beginning of the "file" for usage.

[I say that so blithely not being the one that has to do the coding, don't I
:-)]

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Because of the way the code is currently written, a file upload ends up in
RAM before it gets written to disk.  If you want to upload 1Gig files, you
need >1Gig of RAM.  That's crap, we know, and Jim Winstead has volunteered
to fix this.  Not sure what the timeline is on it yet though.

-Rasmus


On Thu, 25 Jan 2001, Tim Meader wrote:

> Hello all. I've spent the past month or two implementing a file upload
> utility for the web based on PHP's http upload method. It works fine for
> smaller files, and it's been working fine for files I've tried up to and
> including 400 megs at a time. The problem I'm having is that we want to
> roll this out on a center-wide scale, but that would most likely mean files
> up to 1Gig being uploaded at a time. Is this possible through the http
> upload process. I've been unsuccessful thus far to upload a file this large
> for some reason. Upon checking the Apache error_log, I found the following
> message:
>
> FATAL: erealloc(): Unable to allocate 112568001 bytes
> [error] PHP Warning: File Upload Error - No Mime boundary found after start
> of file header in unknown line 0
>
> Now, am I correct in thinking that the second line is merely a result of
> the failed upload? If so, then I suppose that can be disregarded, but which
> program is generating the erealloc(), Apache or PHP?
>
> I've been following threads on File Upload for quite a while now, and all
> relevent settings in the php.ini are set correctly to allow file uploads of
> this size (at least in theory). All settings having to do with upload
> limits are set at "2000000000", however, no documentation states what value
> this setting stands for (kb, Mb, etc.), so this SHOULD roughly be equal to
> 2Gigs, assuming that it defaults to bytes. Also the timeout has been set to
> 86400 seconds, ie a 24hour period.
>
> The current box this is running on is a Ultra 5 running Solaris 7, Apache
> 1.3.14, with PHP 4.0.4. It has 256 megs of ram, and the partition being
> used for this test phase is 18 gigs, so size shouldn't be an issue. The
> temp upload directory in the php.ini has also been set to use a temp folder
> on this same partition.
>
> PLEASE, any suggestions you have would be MUCH appreciated. Thank you in
> advance for any and all replies. Hope to hear something soon!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





> I am trying to upload the files to the sever. For files that has only one
> dot such as abc.txt and 123.doc, it works fine. But when uploading files
> that have more than one dot such as 123.txt.pdf, there's problem, and I
> tried to echo the $userfile[i], and it is "none". Codes are attached as
> following:
>
> <FORM  name="test" method="post" action="meeting_addDocs.php"

You'll need to post or provide a URL to the source for meeting_addDocs.php
probably

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> Hi all.  In the project I'm working on, I've got a table with ids that are
> written based on how many records are in the table.  i.e., the first
record
> has an ID of 1, the 50th is 50, etc.  When a row gets deleted (I created a
> web interface, I don't want all these members using phpMyAdmin), the ID's
of
> all the records after it are supposed to be decremented by one.  I thought
> it was working, but yesterday it didn't.  Can anyone see what I'm doing
> wrong?

Like, doing what you are doing is just a Bad Idea in general...

I know it offends your organizational sensibilities to have holes in your ID
scheme, but it's really better in the long run...

You see, at some point, you may have another table with things in it that
need to be cross-referenced to the things in this table.  When that happens,
you really don't want to run around trying to update all those tables at
once -- Because while you're still halfway through that process, somebody
will be surfing to look at record #42 -- And whatevery is associated with
#42 in the other table, well, you haven't updated that yet, because they are
surfing at the same exact instant that your updates are taking place...  So
they are going to get the old 42's cross-references and be all confused.

Still, just in case you really, really need this 1-50 thing, you can do
it -- Just keep the *real* ID internally and when you delete, don't mess
with that.

Probably the easiest way to renumber them is like this:

$query = "update $tablename set fields[0] = fields[0] - 1 where fields[0] >
$editval";

> ***********
> if ($delete == 1){
>      #delete the row
>      $worked = mysql_query("delete from $tablename where
> $fields[0]=\"$editval\" ", $database);
>      if (!$worked){
>           echo "couldn't delete anything<p>";
>      }//end if
>
>      $connection =
@mysql_connect("localhost",$PHP_AUTH_USER,$PHP_AUTH_PW);
>      $database = @mysql_select_db($databasename, $connection);
>      $del = mysql_query("select * from $tablename where RestID =
> $restidval", $database);
>      while ($Info_Array = mysql_fetch_array($del)){
>            #update the ids of each record
>            if($Info_Array[$v] > $editval){ #v is a fieldname (specifically
> the id) defined above
>                  mysql_query("update $tablename set $fields[0] =
> ($fields[0]-1) where $fields[0] = \"$Info_Array[$v]\" ", $database);
>            }//end if
>       }//end while
>
>       $delete=0; #reset the delete flag
> }//end if
>
> ***********
>
> Assume that all the variables have the values they're supposed to (cuz
last
> I checked, they do. :))
>
> Thanks for your help. Again.
>
> Jason
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





> I want to *read* a file into a page and not process any PHP.  I'm just
> reading an HTML file.  I though it was simple, I thought I had it figured
> out, but now when I try, I get the following error:

Unless there is PHP code in there that you want to make sure it doesn't get
executed, 'include' will work just fine.

If you need to read the file and splat it to the browser, I think passthru()
is what you want.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Any of these will work:

echo implode("\n", file($filename));

fpassthru(fopen($filename, "r"));

readfile($filename);

You probably want readfile().
http://www.php.net/manual/en/function.readfile.php

--
 - Daniel Grace <http://dewin.oldbattery.com/>

  "Space may be the final frontier but its made in a Hollywood basement."
    - Red Hot Chili Peppers - Californication
""Karl J. Stubsjoen"" <[EMAIL PROTECTED]> wrote in message
005b01c086fa$ec53ba30$0afc020a@kstubsjoen">news:005b01c086fa$ec53ba30$0afc020a@kstubsjoen...
> Hello,
>
> I want to *read* a file into a page and not process any PHP.  I'm just
> reading an HTML file.  I though it was simple, I thought I had it figured
> out, but now when I try, I get the following error:
>
> Fatal error: Call to unsupported or undefined function read() in
> /var/www/wherever.com/betastore/iscookies.php on line 41
>
> Here is the code (line 41 is superceded by a +):
>
> 37: # display no cookies message
> 38: function NoCookies() {
> 39: global $DOCUMENT_ROOT;
> 40: $LocalScript = $DOCUMENT_ROOT . "/betastore";
> 41:  read ($LocalScript . "/thispage.html");
> 42: }
>
> Thanks for any help.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






The "easiest" way to do that kind of output is "recursion"

It's a kind of iteration/looping thing where a function calls itself.

Sample:

function fact($x){
    if ($x == 0){
        return 1;
    }
    else{
        return $x * fact($x - 1);
    }
}

Basically the function eats itself rather like those Russion porcelain dolls
nestled inside each other.

It's easier to "reverse" your data structure to get it to work though:

$tingtang[0] = array(1, 7);
$tingtang[1] = array(2, 4);
$tingtang[2] = array(3);
.
.
.

IE, each tingtang knows its "children", rather than the parent.

In your case it would be something like:

function tingtang($tt, $depth = 0){
    global $tingtang;
    echo str_repeat("&nbsp;", $depth * 4), "tingtang$tt<BR>\n";
    while (list(,$child) = each($tingtang[$tt])){
        tingtang($child, $depth+1);
    }
}
tingtang(0);

Note:  Recursion has an overhead at each function call -- So very "deep"
trees can become performance problems.

For a much more in-depth look at this sort of thing, check out the rather
long threads about "forums" and "recursion" in the PHP Mailing List
archives.  (Probably back in version 3 archives, actually)

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Christian Sakshaug <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, January 25, 2001 12:34 PM
Subject: [PHP] Anyone who can help me making a loop of this?


> Anyone who can help me making a loop of this?
>          http://www.sakshaug.net/phps/loop.txt
>
> I have tried many things, but I can't get it perfect...
>
>
>
>
>
> Best Regards, Christian Sakshaug
> --
> Email: [EMAIL PROTECTED]
> Web:   www.sakshaug.net
> Tel:     +47 913 95 618
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





> I'm finding some problems on using number_format($value, $decimal, ",",
> ".") when I have a value comming from a resultset (database query
> results)...
> If I had something like '123.45', using number_format it will return
> '123,00'.
> I think this happens because my value is a string and PHP rounds it
> before using it on number_format. If I try to change the data type like
> (double) $value, I will also have a '123.00' result.
> I could do something on database like 'to_char(FIELD, '999G999D99') but
> database default is '.' for decimal separator and ',' for thousand
> separator...and I want the opposite.
> Suggestions/Solutions? :)

Your database may have a number_format() function that can better interact
with the internal data of the database.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






> <?
>  $fp = fopen("http://www.parentprofiles.com/clicker.php?profile_id=" .
$this->profile_id
> . "&code=1","r");
> echo $fp;
> ?>
>
> to do it. however when I do all I get is a response that says:
> Resource id #1
> instead of giving me the page. Any ideas?

Basically, that Resource id # 1 is like a paper receipt at the lumber yard.

You need to take the piece of paper 'round back and pick up your lumber.

We do it that way cuz you might be picking up a lot of lumber :-)

Or, in the case of web sites, you might only need the first few lines of the
HTML, so there's no point in shoving the whole thing through if you're not
going to read it all.

while (!feof($fp)){
    $html = fread($fp, 1024); #Reads 1K max at a time.
    echo htmlEntities($html);
}

You can increase the 1024 to whatever number you find works best to get the
page the fastest.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Yeah, in the following fragment...

 $fp = fopen("http://www.parentprofiles.com/clicker.php?profile_id=" .
$this-profile_id
 . "&code=1","r");

You set up $fp to be a pointer to the object, in this case, a file.  Now you
need to pull data out of it.  Um, unfortunately, I don't remember how to do
this.  If this were a pointer to a MySQL connection, it would look like
this...

mysql_fetch_row($fp)

So, when you echoed the $fp, you are echoing the pointer position in the
file.

Hope that helps...

Jaks





> i use the session-functions with php4 and everything works fine.
> but if a visitor turns off cookies nothing seems to work..
>
> is there a way to support a sessionid with cookies and thru the url ?

Yes.  Compile PHP --with-trans-id (?) or just echo $PHP_SESSID (or whatever
it is) into all your URLs and FORMs.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






compile with --enable-trans-sid

works great for me :)

Chris Lee
Mediawaveonline.com




<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi..
>
> i use the session-functions with php4 and everything works fine.
> but if a visitor turns off cookies nothing seems to work..
>
> is there a way to support a sessionid with cookies and thru the url ?
>
> thanks
>
> markus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I have problem I can't solve for last month.

Everytime I try to open user's mailbox, I get this error. I tried
everything I can think of.
I upgraded php to 4.04pl1, apache is 1.13.14, upgraded wu-imap server to
2000-3 ( when upgrading don't forget to upgrade kerberos shared
libraries to 1.1.1.25, othwerwise imapd failed to start - learnt today
).
Now I just can't imagine what to do next.
Would recompiling of php change anything?

What else can prevent php from accessing mail folders? Directory
restrictions or what??? I dunno.
If anyone can help me to fix this I will be veeeery greatfull.

TIA

    Dezider.




Hello!

I am trying to upload the files to the sever. For files that has only one
dot such as abc.txt and 123.doc, it works fine. But when uploading files
that have more than one dot such as 123.txt.pdf, there's problem, and I
tried to echo the $userfile[i], and it is "none". Codes are attached as
following:

<FORM  name="test" method="post" action="meeting_addDocs.php"
enctype="multipart/form-data">
            <tr align="center">
              <td valign="top" colspan="2">
                  <input type="file" name="userfile[]" size="18">
              </td>
              <td valign="top" colspan="2">
                  <input type="file" name="userfile[]" size="18">
              </td>
           </tr>
</FORM>


Thank you very much in advance.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





preg_replace("/0+$/","",$number);

On Thu, 25 Jan 2001, Ethan Nelson wrote:

> Almost there... actually this creates one problem...
>
> It turns 40.00 into 4
>
> It needs to quit shaving zero's when it hits the decimal point.
>
> 40.00 into 40
> 45.50 into 45.5
> 40.25 into 40.25
>
> Thanks
>
> -----Original Message-----
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 25, 2001 12:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Question about dopping zeros
>
>
> ereg_replace("[0\.]*$", "", $number)
>
> should do it.  I'm not sure you need the slash in front of the dot or
> not. try it and see.
>
> In article
> <[EMAIL PROTECTED]> you
> write:
> >I need to format decimals that are percise to the second place in the
> >following format:
> >
> >4.00 to 4
> >4.50 to 4.5
> >4.25 to 4.25
> >
> >As you can see, I just want to drop the trailing zeros, and if necessary
> the
> >decimal.
> >
> >Thanks
> >
> >___________________________________
> >Ethan Nelson, Systems Administrator
> >Net Solutions, LLC
> >840 Lawrence Street
> >Eugene, OR 97401
> >[EMAIL PROTECTED]
> >http://www.netsolutionsllc.com
> >Voice +1 541 345-7087
> >Fax   +1 541 485-5519
> >
> >
> >--
> >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]
> >
>
>

-- 
http://www.artwells.com/
That which indicates nothing
introduces everything.





On Thursday 25 January 2001 23:27, Ethan Nelson wrote:

> It needs to quit shaving zero's when it hits the decimal point.
>
> 40.00 into 40
> 45.50 into 45.5
> 40.25 into 40.25

Hmm,
$ValWithoutZ = (double) $ValWithZ;

should work fine (i.e. interpreting the number as floating-point value 
instead of as string)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)




test




Frank Joerdens wrote:

> On Thu, Jan 25, 2001 at 05:10:54PM -0300, Martin A. Marques wrote:
> [ . . . ]
> 
>> OK, lets see if we can understand what each other is saying (maybe I'm not 
>> getting your point here).
>> Lets say browser A connects to the apache server, to a page using php code. 
>> Lets say the code is OK (no bugs). Apache opens a persistent connection to 
>> the database and starts executing the queries. Now the connection between the 
>> apache server and the web browser doesn't close until the queries are all 
>> finished and the output is send back to the browser.
>> Now, how about if browser B connects to the apache server just in the middle 
>> of the execution of the queries that browser A asked for?
>> Well, the connection between Browser A and the web server is still opened, so 
>> another httpd child process answers the request.
> 
> 
> I thought one of the points being raised (can't find the mail/thread I'm
> referring to now) was that somehow confusion might ensue from a mix-up,
> on the Apache/PHP level, regarding the client identity, thus corrupting a
> transaction in progress. It seemed to make sense but now that we've
> discussed it, I can't see anymore how it might happen.
> 
>  . . . [ goes away to search mail archives ] . . .
> 
> Ah, here we go. A post from Rod Taylor on pgsql-hackers on Dec 27:
> 
> ------------------ begin quote ------------------
> The *real* problem with persistent connections is:
> 
> Script1:  BEGIN;
> Script1:  UPDATE table set row = 'things';
> Script2:  Insert into table (id) values ('bad data');
> Script1: COMMIT;
> 
> Since script2 managed to do a BAD insert in the middle of script1's
> transaction, the transaction in script1 fails.  Obvious solution?  Don't
> do
> connection sharing when a transaction is enabled.  The whole persistent
> connection thing is only valid for mysql as it's the only thing that
> doesn't
> really support transactions (and even thats partially changed).
> 
> They need to look for stuff going through (keywords like BEGIN) and
> 'lock'
> that connection to the single entity that opened it.
> 
> It's much easier to write your own.  I wrote a few functions like:
> 
> get_connection('DB PARMS');
> begin_transaction();
> 
> commit_transaction();
> close_connection();
> ------------------ end quote ------------------
> 
> [ . . . ]
> 
>> My question would be, and seeing Adams thoughts, wouldn't it be the best 
>> optimization configuration of php.ini to have only one persistent conection? 
>> Wouldn't there be one per-child? Any way, you can't have two connections to 
>> the same httpd child.
> 
> 
> Those where my thoughts too (or, rather, Adams thoughts ;)), and this is
> what I am trying at the moment.
> 
> Regards, Frank
> 
hi,
i ran across this transaction problem vs. persistent conn in pgsql some time ago.

I found two workaround methods:
- don't use persistent conn's :-) or;
- start every conn with the usual pg_pconnect and then query a rollback to the server:
$query="ROLLBACK work;"

(this will kill any supposed transaction in ABORT STATE that some child had left).

postgres don't support nested transactions (yet), but when it does maybe you should 
add multiple "ROLLBACK WORK;" queries :-)

Regards,
Nuno







On Fri, Jan 26, 2001 at 11:01:14AM +0000, Nuno Silva wrote:
[ . . . ]
> i ran across this transaction problem vs. persistent conn in pgsql some time ago.
> 
> I found two workaround methods:
> - don't use persistent conn's :-) or;
> - start every conn with the usual pg_pconnect and then query a rollback to the 
>server:
> $query="ROLLBACK work;"
> 
> (this will kill any supposed transaction in ABORT STATE that some child had left).
> 
> postgres don't support nested transactions (yet), but when it does maybe you should 
>add multiple "ROLLBACK WORK;" queries :-)

Ah. Very cool. What I _still_ don't quite understand, though, is _how_
exactly this situation could come about. And what the worst case would
be. What if you don't kill the transaction in ABORT STATE?

Ta, Frank




I need to draw circle using GD library. Can you get me some function doing
this? 
Thanks.

-- 

                                                Piotr Duszynski
                                                
http://www.softomat.com.pl
http://filmomat.3miasto.pl 
http://www.3miasto.pl




Not sure, but...

Look for an Ellipse drawing function, and give it an equal whatsit and
thingamabob.

IE, a circle is an ellipse that happens to be round.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Piotr Duszynski <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:29 AM
Subject: [PHP] Circle using GD


> I need to draw circle using GD library. Can you get me some function doing
> this?
> Thanks.
>
> --
>
> Piotr Duszynski
>
> http://www.softomat.com.pl
> http://filmomat.3miasto.pl
> http://www.3miasto.pl
>
> --
> 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]
>





What kind of integration exists for Flash/MySQL/PHP system? The only thing 
I've seen so far is PHP code that will write flash movies, but it was 
really complex code.

Kent Wang





You can use premade flash movies just as you would in HTML. Therefore
everything that is normally available is available in PHP, plus if you
want, you get to use the wonderful libswf!  :)

Jeremy

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "LINUX is obsolete"  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       http://www.JEEP-FOR-SALE.com/ -- I need a buyer
  Get your own Free, Private email at http://www.smackdown.com/

On Thu, 25 Jan 2001, Kent Wang wrote:

> Date: Thu, 25 Jan 2001 22:22:29 -0600
> From: Kent Wang <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP] Flash/PHP
> 
> What kind of integration exists for Flash/MySQL/PHP system? The only thing 
> I've seen so far is PHP code that will write flash movies, but it was 
> really complex code.
> 
> Kent Wang
> 
> 
> -- 
> 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 can use premade flash movies just as you would in HTML. Therefore
> everything that is normally available is available in PHP, plus if you
> want, you get to use the wonderful libswf!  :)

libswf isn't maintained anymore though.  We will soon have the ming
library in PHP, but it works already.  Go to freshmeat.net and search for
"ming".  You can see an example of it on slide 33 of the presentation at
http://conf.php.net/nordu2001

-Rasmus





I have created a Generator / PHP library which makes it easy to create Flash
content from PHP using Macromedia Generator.

Unfortunately, do to some bugs in PHP with the System() command on Windows,
I am not going to release the library until the next PHP update (assuming
they fix the bugs).

mike chambers

[EMAIL PROTECTED]

http://www.markme.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]
>
>






Hello,

I have developed a large web application the contents of which (language and
data) depends on the URL the site is accessed from, e.g. en.site.com would
display the "english" site, and "fr.site.com" would display the french site,
and so on.

The whole thing is "parameterized" through a set of global variables (or
defines) that reside in a file called settings.php. The question is: how can
I include the "right" settings.php file, depending on the virtual host used
to access the site? This is an Apache server on Linux, and I thought setting
the "include_path" for every virtual host in the <vhosts> section of
httpd.conf would maybe do the trick ?

Thanks !






Should work, I think.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Alain Fontaine" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:36 AM
Subject: [PHP] Conditional include based on virtual host ?


> Hello,
>
> I have developed a large web application the contents of which (language
and
> data) depends on the URL the site is accessed from, e.g. en.site.com would
> display the "english" site, and "fr.site.com" would display the french
site,
> and so on.
>
> The whole thing is "parameterized" through a set of global variables (or
> defines) that reside in a file called settings.php. The question is: how
can
> I include the "right" settings.php file, depending on the virtual host
used
> to access the site? This is an Apache server on Linux, and I thought
setting
> the "include_path" for every virtual host in the <vhosts> section of
> httpd.conf would maybe do the trick ?
>
> 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]
>





Thanks for the input, I have turned it around now as you said and recorded 
the projectID in the bid table rather than the other way round.

Cheers

Ade




    Yes, I can see that I didn't put the ";" after "$test1=array()".
Fortunately, I just type up the code example to this newsgroup.  So, excuse
my typo error.
    Thanks for the clarification and offering of the use of PHP code such as
print_r() or var_dump().  They are new to me.  So, it was a great help when
I was debugging the missing data in the huge array (containing several more
arrays).

Thanks,
 Scott
""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
94pkll$516$[EMAIL PROTECTED]">news:94pkll$516$[EMAIL PROTECTED]...
> Hi!
>
>     When I use the echo to see what is inside the list().  Instead I got
the
> message on screen saying "ArrayArray".
>
>     The array are being assigned first then then list come second.  ie.
>
>         $test = array();
>         $test1 = array()
>
>         list($test,$test1);
>
> ---------------
>     When I do "echo list($test,$test1);", it doesn't work.
>
>     What are the better way to see the data in the array?
>
> Thanks,
>  Scott
>
>
>
> --
> 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 many elements i can insert in an array?
thank you!




On Friday 26 January 2001 22:35, Giancarlo wrote:

> > how many elements i can insert in an array?
> thank you!

I'd say up to 2^31 or until your memory is full (which is likely to occur 
earlier)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Even idiots can handle computers, and many do.




> I have a variable(s) that hold the string:
> 
> "name"
> 
> and I'd like to kill the quotes so it contains:
> 
> name
> 
> I am aware of the strlen() function but can find the concant
> 
> Little Help?
> 
> Mike

If you *know* the variable is quoted you could also do:

$new = substr($variable, 1, -1);

I think this would be faster if you were doing a zillion of them as it
doesn't have to find the quotes.

Dustin





Hi

Sorry - but as far as I can tell it does not work. It still have the same
strange behavior.
When using sleep I have no output. Usleep has no wait time (or it may delay
output a bit but not program execution) ?????

Benny


""Daniel Grace"" <[EMAIL PROTECTED]> skrev i en meddelelse
94m72k$qd9$[EMAIL PROTECTED]">news:94m72k$qd9$[EMAIL PROTECTED]...
> ""Benny Nissen"" <[EMAIL PROTECTED]> wrote in message
> 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]...
> > Hi All
> >
> > I have tried to get this to work but it does not produce any output in
the
> > browser - why
> >
> > $i = 1;
> > while ($i)
> > {
> >  if(connection_aborted())
> >   break;
> >
> >  echo $i;
> >  echo "<BR>";
> >     $i++;
> >
> >  sleep(1);
> > //usleep(1000);
> > }
> >
>
> If you're trying to get a delayed output affect (which isn't recommended,
> but would probably work in this case as long as you're not inside a
table),
> you'll either need to do:
>
> ob_implicit_flush(1);
> // at the beginning of the script (use 0 to turn it back off)
>
> or:
> flush(); // after the echo and before the sleep.
>
>
>
> Side note: When you're using PHP for shell scripts (Don't look at me like
> that) and the like, ob_implicit_flush is your friend.
>
> --
>  - Daniel Grace <http://dewin.oldbattery.com/>
>
>   "Space may be the final frontier but its made in a Hollywood basement."
>     - Red Hot Chili Peppers - Californication
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I want to install PHP on iMAC with MAC OS 9, please advise if possible.

Further, is there any lowcost or free web server that supports PHP on my MAC
OS9.

Thanks in advance.






If you get no answer, try the "Apache/MySQL/PHP" list.

Mostly OS X, but some are using OS9 et al.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "iGuru" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:41 AM
Subject: [PHP] PHP on MAC OS9


> I want to install PHP on iMAC with MAC OS 9, please advise if possible.
>
> Further, is there any lowcost or free web server that supports PHP on my
MAC
> OS9.
>
> Thanks in advance.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





I want to install PHP on iMAC with MAC OS 9, please advise if possible.

Further, is there any lowcost or free web server that supports PHP on my MAC
OS9.

Thanks in advance.








You can't on os9.

You have to run it on osX PB (or osx server I believe)

Go here:

http://homepage.mac.com/LightyearDesign/MacOSX/Packages/

> I want to install PHP on iMAC with MAC OS 9, please advise if possible.
> 
> Further, is there any lowcost or free web server that supports PHP on my MAC
> OS9.
> 
> Thanks in advance.
> 
> 
> 
> 


> I want to install PHP on iMAC with MAC OS 9, please advise if possible.
> 
> Further, is there any lowcost or free web server that supports PHP on my MAC
> OS9.
> 
> Thanks in advance.
> 
> 
> 
> 






On Friday, January 26, 2001, at 09:16 AM, lou wrote:

> You can't on os9. 

Sure you can.
Its called webten

http://www.webten.com/

and it supports php

>  
> You have to run it on osX PB (or osx server I believe) 

Or you could go with a freely available operating system such as Linux.
You can get YellowDog or Debian CD's dirt cheap from http://www.cheapbytes.com/

The commercial nix aren't the only nix for PowerPC :P

>  
> Go here: 
>  
> http://homepage.mac.com/LightyearDesign/MacOSX/Packages/ 
>  
> > I want to install PHP on iMAC with MAC OS 9, please advise if possible. 
> >  
> > Further, is there any lowcost or free web server that supports PHP on my MAC 
> > OS9. 
> >  
> > Thanks in advance. 
> >  
> >  
> >  
> >  
>  
>  
> > I want to install PHP on iMAC with MAC OS 9, please advise if possible. 
> >  
> > Further, is there any lowcost or free web server that supports PHP on my MAC 
> > OS9. 
> >  
> > Thanks in advance. 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

(510)  623-9726x357
Fax: (510) 249-9125




When I try to connect to mailbox, I get error "Connection timed out". Is
it possible to specify timeout for this?

TIA.
    Dezider.




i am wondering if anyone has written a snippet to process the current date 
or mktime into a mysql timestamp feild.

~kurth





On Friday 26 January 2001 05:42, Kurth Bemis wrote:
> i am wondering if anyone has written a snippet to process the current
> date or mktime into a mysql timestamp feild.

$CurrentTime = time ();

$Query = "INSERT INTO mytable (timestampfield) VALUES 
(FRON_UNIXTIME($CurrentTime))"

=> MySQL already provides functions for that.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Even idiots can handle computers, and many do.




Hi,

I compiled and installed php4 for the first time and it seems that all
went right as the notice in /var/log shows:

[notice] Apache/1.3.12 (Unix) PHP/4.0.4pl1 configured -- resuming normal
operations

But when I try to execute any sort of php script I´m stuck with an
Internal Server error and /var/log says:

[error] [client 127.0.0.2] Premature end of script headers:
/usr/local/httpd/cgi-bin/test.php

Neither an answer in the manual nor in the FAQ 
Thanks for reply.

W. Pichler

Please cc me cause I´m not subscribed to this list.




That usually means PHP is dying for some reason.

Follow the instructions on http://bugs.php.net for generating a backtrace.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:47 AM
Subject: [PHP] Premature end of script headers error


> Hi,
>
> I compiled and installed php4 for the first time and it seems that all
> went right as the notice in /var/log shows:
>
> [notice] Apache/1.3.12 (Unix) PHP/4.0.4pl1 configured -- resuming normal
> operations
>
> But when I try to execute any sort of php script I´m stuck with an
> Internal Server error and /var/log says:
>
> [error] [client 127.0.0.2] Premature end of script headers:
> /usr/local/httpd/cgi-bin/test.php
>
> Neither an answer in the manual nor in the FAQ
> Thanks for reply.
>
> W. Pichler
>
> Please cc me cause I´m not subscribed to this list.
>
> --
> 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]
>





Ok, I'm reading the manual for the new php4 stuff. Now, I'm not new to php. 
I started with php/fi with a little script to add links to a database. I 
did a little work in php3. I just don't make enough php stuff to get a frim 
grip on everything. That is changing as I am building a second pc to serve 
as a dev box for php4. Here is my first question.

This was lifted from the Zend site from the php manual there.

To assign by reference, simply prepend an ampersand (&) to the beginning of 
the variable which is being assigned (the source variable). For instance, 
the following code snippet outputs 'My name is Bob' twice:
<?php
     $foo = 'Bob';              // Assign the value 'Bob' to $foo
     $bar = &$foo;              // Reference $foo via $bar.
     $bar = "My name is $bar";  // Alter $bar...
  echo $foo;                 // $foo is altered too.
  echo $bar;
?>

   What I don't see here is how this prints (echo) "My name is Bob". The 
way I see this is that $bar = &$foo; is a backwards assignment, so that 
when the script cycles through, it changes $foo from Bob to "My name is 
$bar", and, to my error prone thinking, it should print out "My name is My 
name is My name is...".

It would make sense to me if it were:

<?php
     $foo = 'Ed';         // Assign the value 'Ed' to $foo
     $bar = &$foo;        // Reference $foo via $bar
     $bar = 'Bob';        // changing $foo to 'Bob'
     $this = "My name is $bar";
     $that = "My name is $foo";
   echo $this;                                / /  prints out My name is Bob
   echo $that;                               / /   prints out My name is Bob
Maybe I'm not seeing how php rereads or cycles through the script once it 
sees a "assign by reference"  Could someone explain please?
Thank you.





It's not a backwards assignment.  It's more like this:

$bar = &$foo;

You now have essentially two variable names 'foo' and 'bar' pointing to the
same chunk of memory inside the computer.

If you change one, you change the other:  They are really not two distinct
variables -- They are the same variables, and are aliases for each other.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Noel Akins <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:52 AM
Subject: [PHP] I'm confused about..reffering vars &$


> Ok, I'm reading the manual for the new php4 stuff. Now, I'm not new to
php.
> I started with php/fi with a little script to add links to a database. I
> did a little work in php3. I just don't make enough php stuff to get a
frim
> grip on everything. That is changing as I am building a second pc to serve
> as a dev box for php4. Here is my first question.
>
> This was lifted from the Zend site from the php manual there.
>
> To assign by reference, simply prepend an ampersand (&) to the beginning
of
> the variable which is being assigned (the source variable). For instance,
> the following code snippet outputs 'My name is Bob' twice:
> <?php
>      $foo = 'Bob';              // Assign the value 'Bob' to $foo
>      $bar = &$foo;              // Reference $foo via $bar.
>      $bar = "My name is $bar";  // Alter $bar...
>   echo $foo;                 // $foo is altered too.
>   echo $bar;
> ?>
>
>    What I don't see here is how this prints (echo) "My name is Bob". The
> way I see this is that $bar = &$foo; is a backwards assignment, so that
> when the script cycles through, it changes $foo from Bob to "My name is
> $bar", and, to my error prone thinking, it should print out "My name is My
> name is My name is...".
>
> It would make sense to me if it were:
>
> <?php
>      $foo = 'Ed';         // Assign the value 'Ed' to $foo
>      $bar = &$foo;        // Reference $foo via $bar
>      $bar = 'Bob';        // changing $foo to 'Bob'
>      $this = "My name is $bar";
>      $that = "My name is $foo";
>    echo $this;                                / /  prints out My name is
Bob
>    echo $that;                               / /   prints out My name is
Bob
> Maybe I'm not seeing how php rereads or cycles through the script once it
> sees a "assign by reference"  Could someone explain please?
> Thank you.
>
>
> --
> 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]
>





Q: Is it possible to post plain/text data from PHP with the build-in CURL
functions?

Hello Mr. General PHP!

I want to post PLAIN/TEXT data to some webpage (through SSL). I want to do
this in PHP by using the build-in CURL support. However, by default, CURL is
posting the data as "url-encoded.." (as if it came from a form), but I want
it to be "plain/text" (not var=value pairs)!
If I use the CURL binary (calling it from the commandline), I can specify
extra header-info and force the postdata to be interpreted as plain/text.
Like this:

curl [....] -H "Content-Type: plain/text"

This works perfectly! Is it possible to do this by using the build-in CURL
functions?

M. Homminga










whats the php function that will let me update a db field?  I've been 
looking at the manual but there seems to be no mention of it.

~kurth





It's just like a SELECT, only you send an UPDATE query.

$query = "select * from people";
$people = mysql_query($query) or die(mysql_error());
.
.
.
$query = "update people set name = 'Fred' where lastname = 'Flintstone'";
mysql_query($query) or die(mysql_error());

You can send *ANY* query to the database, not just SELECT.
UPDATE, INPUT, DROP, ALTER TABLE, whatever you can dream up that your
database will allow you to do.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Kurth Bemis <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:58 AM
Subject: [PHP] update db


> whats the php function that will let me update a db field?  I've been
> looking at the manual but there seems to be no mention of it.
>
> ~kurth
>
>
> --
> 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]
>





> > >Does Version 4 support either { } "squiglees" or [ ] "brackets" in this
> > >code:
> > >
> > >if($retrn{strlen($retrn)-1} == '&')
> > >-or-
> > >if($retrn[strlen($retrn)-1] == '&')
> >
> > Yes.  This is a 4.x feature only.  The idea is that in the long run, []
> > will no longer be supported for string offsets, only {} will.

What is the motivation behind this change?





If that's even true (I dunno) maybe because strings in PHP really aren't
arrays of characters like C...

And maybe they got plans for arrays that would be too easy to confuse
syntactically with strings or something...

[shrug]

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 10:58 AM
Subject: [PHP] Why the Change in Ver 4?


> > > >Does Version 4 support either { } "squiglees" or [ ] "brackets" in
this
> > > >code:
> > > >
> > > >if($retrn{strlen($retrn)-1} == '&')
> > > >-or-
> > > >if($retrn[strlen($retrn)-1] == '&')
> > >
> > > Yes.  This is a 4.x feature only.  The idea is that in the long run,
[]
> > > will no longer be supported for string offsets, only {} will.
>
> What is the motivation behind this change?
>
>
> --
> 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]
>





Can u please help!

well i want to check that a word is composed of the alphabet and also ŕ and 
ë
i used :ereg("[a-Zée"čë ŕäď-üöűâęç]", $firstname)
but i have an error i know that ereg("[a-Z]",$firstname) alone is ok but how 
to add the ë and ŕ ?

Thanks

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Hi!
I think you u put ereg("([a-z,A-Z][ë,ŕ]?)",$firstname)
The point is the question mark "?" because it means that it's not 
request...
Try it..I hope it will work!

Felipe Lopes


Em Fri, 26 Jan 2001 17:02:12 -0000 "kaab kaoutar" Escreveu:

> Can u please help!
> 
> well i want to check that a word is composed of the alphabet and also 
ŕ
> and 
> ë
> i used :ereg("[a-Zée"čë ŕäď-üöűâęç]", $firstname)
> but i have an error i know that ereg("[a-Z]",$firstname) alone is ok 
but
> how 
> to add the ë and ŕ ?
> 
> Thanks
> 
> 
________________________________________________________________________
_
> 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]
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!




i'm a bit slow today....please disregard those last 2 questions from me and 
i answered them myself :-)





Why is it that I never get messages in the list from the late night coders
after like 6 central?





They're busy coding?

They're in a different time zone?

I dunno.

The list isn't shut down on purpose, though it hasn't been super stable of
late either. :-^

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Dallas Kropka" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 11:01 AM
Subject: [PHP] Do they like shut this list down at night or what?


> Why is it that I never get messages in the list from the late night coders
> after like 6 central?
>
>
> --
> 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 company is offering a visa card with no annual fee, no deposit and 
will pay you for the people you refer.Just request the web address by
replying to :          
                    
                   [EMAIL PROTECTED]          

 Insert "request " in the subject line
                                                        Thank you




    1-month commercial license ($90).

    Download wasn't too bad. I haven't had a chance to check out the Zend
LaunchPad. The installation (Apache Linux PHP 4.04pl1+patches) took me about
30 minutes for client and server which included the wait on the license key.
It took us another day to put up because there is no mention that the
debugger doesn't work with the optimizer on. Zend customer service fixed
that though.

    The IDE is pretty nice. Startup (Windows version through Samba) takes a
long time and there are still some crashing issues. It's nowhere near as
spry as PHPEd but we're talking about a integrated debugger. The interface
is Swing-based as near as I can tell and my main gripe besides the speed is
I can't use the scroll wheel. It still crashes a bunch (not sure if it's the
debugger or what). I passed it off to an engineer so I can't comment
further. (He's having trouble getting it to recognize the include files.
Anyone have a tip?)

    BTW, the debugger has a browser mode, it sends off some codes in a the
get string of the URL. I didn't test it.

    Some people like source level debuggers and I think it's a good tool
especially considering all the headaches Nexidion Designer gave us a while
back. Personally, the last time I used a debugger, I was making a calculator
using an 80186 (the debugger was a hardware one the size of two coffee table
books stacked next to each other) so obviously I never got used to them. If
you come from the Boreland C/Visual Studio world, I suppose you might find
the IDE essential. If my engineers ever use it, I'll get the company to
spring for a license or 5.

    Take care,

        terry

-- 
terry chay, Director of Engineering, <http://www.QIXO.com/>
QIXO /kick.so/ - Integrating Many Travel Web Sites Into One
W: 1.408.394-8102     F:1.408.516.9090    M: 1.408.314.0717
E-Mail: <mailto:[EMAIL PROTECTED]>     ICQ: 16069322
PGP Fingerprint: 6DCF 1634 547C 935D 4912  2A44 A4A2 79AB DFFF F110 





>
 kyk():Prgm:Local a,b,c:
13->a:
"|------------+------------|"->b:ClrIO:Output
> 0,-1,left(b,a)&"¥"&right(b,a):While abs(13-a)<13:getKey()->c:If abs(50-c)=1
> Then:a+c-50->a:Output 0,-1,left(b,a)&"¥"&right(b,26-a):EndIf:EndWhile:EndPrgm
>
> Play with the 1 and 3 keys. Guess what it does by just looking at the code,
> and win a free donut (should arrive within 6-8 weeks, and shouldn't be too
> stale by then). 1 and 3 have character codes 49 and 51, respectively, if you
> want to take this on...

Talking about OT!
Is this a so-called kiloliner? From the times when a home computer had 1k,
16k or 64k?

I say it is a game where you steer a Yen-sign along the line with the 1 and
3. If you go too far left or right you end the program (while).

|-----------¥-+------------|  3
|------------¥+------------|  3
|-----------¥-+------------|  1
|------------¥+------------|  3
|------------+¥------------|  3
|------------+-¥-----------|  3
...
|------------+----------¥--|  3
|------------+-----------¥-|  3
|------------+------------¥|  3
end

I'm not familiar with these toys, i'm a biologist. So i can't tell what the
0,-1 in the output does. It may be the location of the output, so it is just
a one line you see, with a moving Y. It can also mean it scrolls, then the
suggestion of a road is made and you seem to move along the road. It is not
too exciting though as the only way to move is to press a button.

The + sign does not mean anything but the middle line of the road (if it is
a road) and as you see, i guess it skips one place when you cross it.

Satisfied?
Chris


--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------






> The options: Get a graph-link cable (which I can't find ANYWHERE), or make
> your own during study hall, making them sufficiently stupid that the code can
> be compressed down to a screenful:
>
> kyk():Prgm:Local a,b,c:13->a:"|------------+------------|"->b:ClrIO:Output
> 0,-1,left(b,a)&"¥"&right(b,a):While abs(13-a)<13:getKey()->c:If abs(50-c)=1
> Then:a+c-50->a:Output 0,-1,left(b,a)&"¥"&right(b,26-a):EndIf:EndWhile:EndPrgm
>
> Play with the 1 and 3 keys. Guess what it does by just looking at the code,
> and win a free donut (should arrive within 6-8 weeks, and shouldn't be too
> stale by then). 1 and 3 have character codes 49 and 51, respectively, if you
> want to take this on...

I must admit it is shorter code than javascript would be:
(ie4+, NS4+)

<html>
<head>
<script language="javascript1.2">
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
document.a=13

function keyDown(e) {
a=document.a
b="|------------+------------|";
  if (ns4) {var keycode = e.which-50; }
  if (ie4) {var keycode = event.keyCode-50; }

if (Math.abs(keycode)==1){
a=a+keycode
if ((Math.abs(a-13))>12)
{alert("CRASH!");document.TI.ROAD.value="************************";document.a
=13;return 0;}
document.TI.ROAD.value=(b.substring(0,a)+"¥"+ b.substr(a,26))
}
document.a=a
}

document.onkeydown = keyDown
document.captureEvents(Event.KEYDOWN)



</script>
<body>
Do not click inside screen. Press 1 to go left, 3 to go right (on keyboard).

<table border=1 bgcolor="#D0D0D0">
<tr><td colspan=3 align=right><font size=2 type="arial,helvetica,sans-
serif">Javascript instrument</font></tr>

<tr><td colspan=3>
<FORM NAME="TI">
<INPUT TYPE="TEXT" NAME="ROAD" size="30">
</FORM>
</td></tr>
<tr><td>SQRT<td>MEM<td>COS</tr>
<tr><td>7<td>8<td>9</tr>
<tr><td>4<td>5<td>6</tr>
<tr><td>1<td>2<td>3</tr>
<tr><td>&nbsp;<td>0<td>&nbsp;</tr>
</table>
</body>
</html>

--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------






Hi all,

I am having 5 rows in a mysql database related to five
different users. these rows contains their firstname,
lastname and details of scenes 1 to 5(these details
are numeric values from 1 to 3). if any of these
fields from scenes 1 to 5 are empty that will be
detected from the firstname of the user(collected from
a form with a filed name 'fname') by opening the
database and will be indicated to that user from which
scene he got empty fields. here is the code that i
wrote works like a champ.

$db = mysql_connect ("localhost","myname","password")
or die("<b>Unable to connect to database.</b>");
mysql_select_db ("nimitztest",$db) or die("<b>Unable
to select database.</b>");
$result = mysql_query ("select * from mytable order by
id",$db);
if ($row=mysql_fetch_array($result))
{
while ($row=mysql_fetch_array($result))
{
$FirstName = $row["firstname"];
if ($fname == $FirstName) 
{
for ($i=1; $i<=5; $i++)
  {
  $Num[$i] = $row["num$i"];
  if ($Num[$i] == '') {
  printf ("You have to goto Scene$i<p>"); 
  break;
   }
  } 
}
}
}

But when i include the else statement like below, to
indicate an user with all the fields filled up as 'You
don't have any thing to fill', this code is giving
weird results such as printing like this onto the
screen:

You don't have anything to fill
You have to goto Scene2
You have to goto Scene3
You have to goto Scene4
You have to goto Scene5

for a user with scene2 onwards empty fields.
This may be, because of fault in my code or because of
misinterpretation of the mysql functions by me. 

---------
for ($i=1; $i<=5; $i++)
{
  $Num[$i] = $row["num$i"];
  if ($Num[$i] == '') {
  printf ("You have to goto Scene$i<p>");
  }
  else {
  printf ("You don't have anything to fill<p>");
  }
}
----------

Please correct me about the mistake i am making over
above.

TIA
Chakravarthy K Sannedhi



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/




I'm not sure if I'm understanding correctly, but you might
take a look at this modification...

Notice: all lines with a > in front of them have remained
unchanged. Lines that can safely be deleted are preceeded by
single-line comments (//), and lines without a > are newly
added lines.

$allFieldsFilled = true; // assume this is true until we
prove it to be false (all it takes is once!)
for ($i=1; $i<=5; $i++) {
  if ($row["num$i"] == '') {
    printf ("You have to goto Scene$i<p>");
    $allFieldsFilled = false; // something hasn't been
filled yet
  } // if
} // for
if ($allFieldsFilled) {
  printf ("You don't have anything to fill<p>");
} // if

Intention: loops through all fields, printing "You have to
goto Scene$i" for each field that is empty. However, if no
fields are empty, "You have to goto..." should never be
printed and "You don't have anything to fill" should
instead.

I could've read your problem wrong, too, though. Good luck.

--Toby

--Toby





I dont know if this is reasonable to do or not, but what I'm thinking of
validating a user based on his/her current username/password.

Does anyone know if this is possible to do?

Or better yet - does someone have some code sitting around I can scavange
from?  PHPBuilder didnt help much....






On Thu, 25 Jan 2001, Scott Brown wrote:

> I dont know if this is reasonable to do or not, but what I'm thinking of
> validating a user based on his/her current username/password.
>
> Does anyone know if this is possible to do?
>
> Or better yet - does someone have some code sitting around I can scavange
> from?  PHPBuilder didnt help much....
>
>
>
>

-- 
Lic. Rodolfo Gonzalez Gonzalez.
Global Networks Technologies S.A. de C.V.





Would there be any point in using php sessions if you aren't using cookies? 
You have to store login info anyway, why not just use a temp table to store 
transaction info and write to the database at the end of a session? From 
what I've read on sessions, you have to use cookies
thanks





if yours only storeing one or two variables in a db, dont mind writing
either functions to store all this in the db, or having 5-10 lines of code
per page to this then fine. But sessions are so simple...

<?
        session_start();

        $test[] = '123';
        $test[] = '456';
        $test[] = '789'

        $someclass = new product_class();

        $SessionID = time();

        session_register('test');
        session_register('someclass');
        session_register('SessionID');
?>

three lines of code, I can store text, arrays, class's all in three lines of
code, four if you count session_start(). now one those vars have been
registered you no longer have to execute session_register() everytime you
change something, its all automatic.

I use sessions because they are so simple. I cant say for sure but a good
guess would be that file I/O from sessions would be less overhead then
mysql_db overhead.


--



Chris Lee
Mediawaveonline.com
[EMAIL PROTECTED]





"Noel Akins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Would there be any point in using php sessions if you aren't using
cookies?
> You have to store login info anyway, why not just use a temp table to
store
> transaction info and write to the database at the end of a session? From
> what I've read on sessions, you have to use cookies
> 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]
>






> Would there be any point in using php sessions if you aren't using
cookies?
> You have to store login info anyway, why not just use a temp table to
store
> transaction info and write to the database at the end of a session? From
> what I've read on sessions, you have to use cookies
> thanks

You can use URLs GET/POST to pass the IDs instead of cookies.

The session stuff makes it easier for you to track that sort of data.

I'm not sure what you want to do, but maybe sessions aren't the right answer
to it...






hi!

what's the difference between using
<?php ?> and using <? ?> and using <script  language="php"> </script>

thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





> what's the difference between using
> <?php ?> and using <? ?> and using <script  language="php"> </script>

<?php ?> always works.
<? ?> only works with "short tags" on, and XML is incompatible with it,
since it uses <?XML
<script language="php"></script> always works, but is a fair amount to type.

There is no performance/behaviour difference other than these.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Hello,

I am doing a do loop and I want it to change what variable to use each
run...

First time use: $run1

Second time use: $run2

Third time use: $run2

I hope you can understand what I am saying.

Thank you,

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





At 9:32 AM -0800 1/26/01, Brandon Orther wrote:
>Hello,
>
>I am doing a do loop and I want it to change what variable to use each
>run...
>
>First time use: $run1
>
>Second time use: $run2
>
>Third time use: $run2
>
>I hope you can understand what I am saying.
>


'Variable variables'; see

        http://www.php.net/manual/en/language.variables.variable.php

If you meant $run3 on the third time line, then you can use

        for ($i=1; $i<$SomeNumber; $i++)
        {
        $SomeValue = some_function(${run$i});
        }

Or, use could say

        for ($i=1; $i<$SomeNumber; $i++)
        {
        $VarName = "run$i";
        $SomeValue = some_function($$VarName);
        }

If you actually _wanted_ to use '$run2' on the third time, I'm 
interpreting that to mean you want to limit the maximum value of the 
digit to 2. If so, you could do

        for ($i=1; $i<$SomeNumber; $i++)
        {
        $VarName = 'run'.max($i, 2);
        $SomeValue = some_function($$VarName);
        }


-Steve


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


-- 
+--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------------------- FBI Special Agent Dale Cooper ---+




i'm having a horrible time updating 2 fields in the same db.  I don't get 
an error but the fields aren't updated....can anyone send me a snippet for 
the to learn from?

~kurth





        You need to be a little more specific about DB and problem type.
You may have to commit the transaction if commit is not implict (ex Oracle).
There could be many resons including your SQL statement.

Mike

-----Original Message-----
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 12:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] arg....


i'm having a horrible time updating 2 fields in the same db.  I don't get 
an error but the fields aren't updated....can anyone send me a snippet for 
the to learn from?

~kurth


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




At 12:31 PM 1/26/2001, Krznaric Michael wrote:

sorry - here you all go..


// number crunching time
$count++;
$time = date("Y-m-d H:i:s");

$result = mysql_query("INSERT INTO links (count) VALUES $count WHERE lid=$id");

echo $result;



>         You need to be a little more specific about DB and problem type.
>You may have to commit the transaction if commit is not implict (ex Oracle).
>There could be many resons including your SQL statement.
>
>Mike
>
>-----Original Message-----
>From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 26, 2001 12:23 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] arg....
>
>
>i'm having a horrible time updating 2 fields in the same db.  I don't get
>an error but the fields aren't updated....can anyone send me a snippet for
>the to learn from?
>
>~kurth
>
>
>--
>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 try this:

mysql_query("INSERT INTO links (count) VALUES ("$count") WHERE
lid=$id");


Kurth Bemis wrote:
> 
> At 12:31 PM 1/26/2001, Krznaric Michael wrote:
> 
> sorry - here you all go..
> 
> // number crunching time
> $count++;
> $time = date("Y-m-d H:i:s");
> 
> $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE lid=$id");
> 
> echo $result;
> 
> >         You need to be a little more specific about DB and problem type.
> >You may have to commit the transaction if commit is not implict (ex Oracle).
> >There could be many resons including your SQL statement.
> >
> >Mike
> >
> >-----Original Message-----
> >From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, January 26, 2001 12:23 AM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] arg....
> >
> >
> >i'm having a horrible time updating 2 fields in the same db.  I don't get
> >an error but the fields aren't updated....can anyone send me a snippet for
> >the to learn from?
> >
> >~kurth
> >
> >
> >--
> >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]

-- 

Shawn Blaylock, ClipperNet Software Engineer
[EMAIL PROTECTED]
http://www.clipper.net/
Eugene OR  541-431-3360 x406
Toll Free  866-673-6260 x406




whoops!
I forgot to escape my quotes!

try this:

$query_str = "INSERT INTO links (count) VALUES (\"$count\") WHERE
lid=\"$id\"";

mysql_query($query_str);



Shawn Blaylock wrote:
> 
> You might want to try this:
> 
> mysql_query("INSERT INTO links (count) VALUES ("$count") WHERE
> lid=$id");
> 
> Kurth Bemis wrote:
> >
> > At 12:31 PM 1/26/2001, Krznaric Michael wrote:
> >
> > sorry - here you all go..
> >
> > // number crunching time
> > $count++;
> > $time = date("Y-m-d H:i:s");
> >
> > $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE lid=$id");
> >
> > echo $result;
> >
> > >         You need to be a little more specific about DB and problem type.
> > >You may have to commit the transaction if commit is not implict (ex Oracle).
> > >There could be many resons including your SQL statement.
> > >
> > >Mike
> > >
> > >-----Original Message-----
> > >From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
> > >Sent: Friday, January 26, 2001 12:23 AM
> > >To: [EMAIL PROTECTED]
> > >Subject: [PHP] arg....
> > >
> > >
> > >i'm having a horrible time updating 2 fields in the same db.  I don't get
> > >an error but the fields aren't updated....can anyone send me a snippet for
> > >the to learn from?
> > >
> > >~kurth
> > >
> > >
> > >--
> > >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]
> 
> --
> 
> Shawn Blaylock, ClipperNet Software Engineer
> [EMAIL PROTECTED]
> http://www.clipper.net/
> Eugene OR  541-431-3360 x406
> Toll Free  866-673-6260 x406

-- 

Shawn Blaylock, ClipperNet Software Engineer
[EMAIL PROTECTED]
http://www.clipper.net/
Eugene OR  541-431-3360 x406
Toll Free  866-673-6260 x406




"Kurth Bemis" ...
> At 12:31 PM 1/26/2001, Krznaric Michael wrote:
>
> sorry - here you all go..
>
>
> // number crunching time
> $count++;
> $time = date("Y-m-d H:i:s");
>
> $result = mysql_query("INSERT INTO links (count) VALUES $count WHERE
lid=$id");

> >i'm having a horrible time updating 2 fields in the same db.  I don't get
> >an error but the fields aren't updated....can anyone send me a snippet
for
> >the to learn from?

well, if you want to UPDATE fields into a database, then PLEASE NOT INSERT
data...

that code should look:

$result = mysql_query("UPDATE links (count) VALUES ($count) WHERE lid=$id");

i suppose that you are getting $count from the DB before doing $count++; ...

and also have a look at the data types of that table... if the column
'count' is not of NUMBER type, you'll need some quotes in the query... also
applies for the lid.







I know i'm a liitle slow but why does 2%4 = 2 and not 0 or 1
thanks
Mike
[EMAIL PROTECTED]






Hi Mike!
On Thu, 25 Jan 2001, Mike P wrote:

> I know i'm a liitle slow but why does 2%4 = 2 and not 0 or 1
cause 4*0+2=2

> thanks
> Mike
> [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]
-- teodor




4%2 = 0

4 div 2 equals remainder 0

2 div 4 doesnt divide so your left with the remainder equal to what you
started with, 2


--



Chris Lee
Mediawaveonline.com
[EMAIL PROTECTED]




""Mike P"" <[EMAIL PROTECTED]> wrote in message
94qjq0$rde$[EMAIL PROTECTED]">news:94qjq0$rde$[EMAIL PROTECTED]...
> I know i'm a liitle slow but why does 2%4 = 2 and not 0 or 1
> thanks
> Mike
> [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]
>






I am trying to get my php.ini file configured correctly.

I have a script that calls the require function/command( I'm not sure which it is..)

Here's what the .ini file is:
include_path=d:\sites;d:\sites\merchantpower\setup

According to the notation in the .ini file I have the correct syntax, but it never 
seems to look in the second path.

Can someone explain this to me better. Remember I'm dealing with Windows to do 
development.

I would think that the script would start to look in the d:\sites directory and then 
go to any sub directory from there...

TIA,
-Shane




Shane McBride:

> I am trying to get my php.ini file configured correctly.
> I have a script that calls the require function/command( I'm not sure which
> it is..)
> 
> Here's what the .ini file is:
> include_path=d:\sites;d:\sites\merchantpower\setup
> 
> According to the notation in the .ini file I have the correct syntax, but it
> never seems to look in the second path.

It stops reading at the semicolon ;.
Never in my php.ini file can i indicate two locations.
If you can't leave php.ini in it's default location (C:/windows/), try 
keeping the line empty and putting the directory in your path.


Otherwise this line in the php,ini wold make no sense:
include_path=; UNIX: "/path1:/path2"  Windows: "\path1;\path2"

> 
> Can someone explain this to me better. Remember I'm dealing with Windows to
> do development.
> 
> I would think that the script would start to look in the d:\sites directory
> and then go to any sub directory from there...
> 
> TIA,
> -Shane
> 



--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 




Check the ChangeLog for a list of changes.
Smarty now has a mailing list for announcements and discussion.

http://www.phpinsider.com/php/code/Smarty/




OK, I figured out that I had forgotten the quotes around the path(s), but I still 
don't understand the path itself. Will it look in sub directories.For example:

include_path=".;d:\sites"

Will PHP look in any subs under sites?


- Shane




>OK, I figured out that I had forgotten the quotes around the path(s), but I
still don't understand the path itself. Will it look in sub directories.For
example:
>
>include_path=".;d:\sites"
>
>Will PHP look in any subs under sites?

No.  PHP will not dig through subdirectories looking for files to include.

And I think you need ./ on the . entry in your list, and I'm always hesitant
of \ in a string that goes through PHP, so recommend "/" instead:
"./;d:/sites"






hi!
how can i get the php_oracle.dll, i'm working on windows NT workstation!
thanks!
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Try www.php4win.de
They tend to be on top of the Windows stuff best.

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message ----- 
From: "kaab kaoutar" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 12:29 PM
Subject: [PHP] php_oracle.dll


> hi!
> how can i get the php_oracle.dll, i'm working on windows NT workstation!
> thanks!
> _________________________________________________________________________
> 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]
> 





I have a script that pulls in the following file via: require 'common.inc'

The problem occurs when it hits the $UNIX_PATH variable. At least I think that's where 
it creates a problem. If I comment it out it works fine, but I of course need that 
variable. 

First of all I created a script that creates this file and I don't understand why it 
doubled the backslashes in the $UNIX_PATH variable. Secondly, why it is crapping out 
on the double backslashes? I thought PHP would use the first one as an escape 
character.

As a side note: I know the example shown here shows a windows path for the unix path 
variable, I'm trying to port this over to winders..  :-0

<?
$DB_SERVER="localhost";
$DB_LOGIN="shane";
$DB_PASSWORD="whatever";
$DB_NAME="test";
$HTTP_HOST="localhost";
$AUTH_USER="admin";
$AUTH_PASS="installme";
$CO_NAME="RDI Technologies";
$EMAIL="[EMAIL PROTECTED]";
$UNIX_PATH="d:\\sites\\mercpow\\mp\images\";
$WWW_PATH="http://localhost/mp/images/$image";
$DOC_ROOT="mp";
$ADMINROOT="admin";
?>

TIA-

-Shane





On Fri, 26 Jan 2001 13:37:42 -0500, Shane McBride
([EMAIL PROTECTED]) wrote:
>I have a script that pulls in the following file via: require
>'common.inc'
>
>The problem occurs when it hits the $UNIX_PATH variable. At least I
>think that's where it creates a problem. If I comment it out it
>works fine, but I of course need that variable.
>
>First of all I created a script that creates this file and I don't
>understand why it doubled the backslashes in the $UNIX_PATH
>variable. Secondly, why it is crapping out on the double
>backslashes? I thought PHP would use the first one as an escape
>character.
>
>As a side note: I know the example shown here shows a windows path
>for the unix path variable, I'm trying to port this over to
>winders..  :-0
>
><?
>$DB_SERVER="localhost";
>$DB_LOGIN="shane";
>$DB_PASSWORD="whatever";
>$DB_NAME="test";
>$HTTP_HOST="localhost";
>$AUTH_USER="admin";
>$AUTH_PASS="installme";
>$CO_NAME="RDI Technologies";
>$EMAIL="[EMAIL PROTECTED]";
>$UNIX_PATH="d:\\sites\\mercpow\\mp\images\";

it's obvious if you look at it, you want:
$UNIX_PATH="d:\\sites\\mercpow\\mp\\images\\";






Hi !!

I'm running PHP under IIS4 and PHP 4.0.4pl1 and all my scripts work perfect
but one that try to access  a DBF database via ODBC.

I set all the permission on php.exe , the database and the script.

the error I receive is :

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

I've been reading a lot of threads obou this and I set all the privileges
and still not working, and as I said earlier all my scripts work but this.

I appreciate any help.

Thanks in advance.

Angel.





Hello,

I have successfully compiled mod_php4 and mod_python as DSO's for apache 
1.3.14, and both will
work independently with apache, but if I try to load both of them at I 
get the following apache
error:

dyld: /usr/sbin/apache multiple definitions of symbol _pcre_free
/System/Library/Apache/Modules/mod_python.so definition of _pcre_free
/System/Library/Apache/Modules/libphp4.so definition of _pcre_free

Has anyone gotten these modules to work concurrently? TIA!

--------------------------------------------------------------------------------------------------
Aaron Faby                                                                   Software 
Developer
Tenon Intersystems                                                                     
 
[EMAIL PROTECTED]
1123 Chapala Street                                                            
805-963-6983
Santa Barbara, CA 93103                                             
http://www.tenon.com
--------------------------------------------------------------------------------------------------




at a mysql prompt in the database where your table resides, type the
following:

alter table <currentname> rename <newname>;

That should take care of it.

--
Dominic

Fang Li wrote:
> 
> Does anyone know how to rename a database in MySQL?
> Thanks!
> 
> fang
> 
> --
> 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]





Here's a FAQ on renaming a mysql database :

http://www.faqts.com/knowledge_base/view.phtml/aid/1262/fid/102

If anyone has useful words to add to it then do so.

Philip

> Fang Li wrote:
> > 
> > Does anyone know how to rename a database in MySQL?
> > Thanks!
> > 
> > fang
> > 
> > --
> > 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]





Hello...

I just upgraded my computer to NT5.  When doing
so, I accidentally installed 
the wrong version of PHP.  =(

I installed the CGI version...  I want to use the
ISAPI module.  How can I 
effectively undo what the installation program
did to install the CGI 
version?  What should I do to install the ISAPI
module now?

Thanks in advance for your help.

Sincerely,
rswfire


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/




Hi,

I have a script which slowly processes several thousand lines of text. I
want to give users a feeling for that the process is not dead. Thus, I am
using:

...
print "processing ";
        print"
            ";
        flush();

for($i=0;$i<count($total);$i++) {
        print".
      ";
        flush();
        // do something time consuming
}
...

Works perfect in IE 5.5: It shows the word "processing" followed every 2
seconds (denpending on what I am doing) by a new period.

But, in Netscape nothing shows up until the entire process has finished.
When I push "stop" on the Netspace menu it shows what was transfered so far
and "Transfer interrupted!" But, I would rather have it the way it is in IE.

Any idea how to improve the code above?
Thanks!

Der Heiko

Buchtipp: http://www.aufbruch.com/
Heiko und Gisela Spallek:
Aufbruch ins Land der unbegrenzten Moeglichkeiten.
Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3









havent tested this but im almost sure that netscape waits until the entire
page is downloaded until being displayed IF there are tables on the page.
write a small test script to see if Im right.


--



Chris Lee
Mediawaveonline.com
[EMAIL PROTECTED]





""Spallek, Heiko"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have a script which slowly processes several thousand lines of text. I
> want to give users a feeling for that the process is not dead. Thus, I am
> using:
>
> ...
> print "processing ";
> print"
>     ";
> flush();
>
> for($i=0;$i<count($total);$i++) {
> print".
>       ";
> flush();
> // do something time consuming
> }
> ...
>
> Works perfect in IE 5.5: It shows the word "processing" followed every 2
> seconds (denpending on what I am doing) by a new period.
>
> But, in Netscape nothing shows up until the entire process has finished.
> When I push "stop" on the Netspace menu it shows what was transfered so
far
> and "Transfer interrupted!" But, I would rather have it the way it is in
IE.
>
> Any idea how to improve the code above?
> Thanks!
>
> Der Heiko
>
> Buchtipp: http://www.aufbruch.com/
> Heiko und Gisela Spallek:
> Aufbruch ins Land der unbegrenzten Moeglichkeiten.
> Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
> 2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3
>
>
>
>
>
>
> --
> 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]
>






Netrape supports multipart documents. Read up on your mime types and
encodings, and use that to create a nice progressbar in netscape :)

> -----Original Message-----
> From: Chris Lee [mailto:[EMAIL PROTECTED]]
> Sent: 26 January 2001 23:53
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Display progress in browser using flush(); IE versus
> NS
>
>
> havent tested this but im almost sure that netscape waits until the entire
> page is downloaded until being displayed IF there are tables on the page.
> write a small test script to see if Im right.
>
>
> --
>
>
>
> Chris Lee
> Mediawaveonline.com
> [EMAIL PROTECTED]
>
>
>
>
>
> ""Spallek, Heiko"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I have a script which slowly processes several thousand lines of text. I
> > want to give users a feeling for that the process is not dead.
> Thus, I am
> > using:
> >
> > ...
> > print "processing ";
> > print"
> >     ";
> > flush();
> >
> > for($i=0;$i<count($total);$i++) {
> > print".
> >       ";
> > flush();
> > // do something time consuming
> > }
> > ...
> >
> > Works perfect in IE 5.5: It shows the word "processing" followed every 2
> > seconds (denpending on what I am doing) by a new period.
> >
> > But, in Netscape nothing shows up until the entire process has finished.
> > When I push "stop" on the Netspace menu it shows what was transfered so
> far
> > and "Transfer interrupted!" But, I would rather have it the way it is in
> IE.
> >
> > Any idea how to improve the code above?
> > Thanks!
> >
> > Der Heiko
> >
> > Buchtipp: http://www.aufbruch.com/
> > Heiko und Gisela Spallek:
> > Aufbruch ins Land der unbegrenzten Moeglichkeiten.
> > Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
> > 2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3
> >
> >
> >
> >
> >
> >
> > --
> > 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]
>
>





Look here -

http://home.netscape.com/assist/net_sites/mozilla/index.html
(That is not an animated gif)

http://home.netscape.com/assist/net_sites/pushpull.html

It only works in netscape (so far), but hey... you can't forget the two
remaining people on the planet that actually use it, right?


> -----Original Message-----
> From: Chris Lee [mailto:[EMAIL PROTECTED]]
> Sent: 26 January 2001 23:53
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Display progress in browser using flush(); IE versus
> NS
>
>
> havent tested this but im almost sure that netscape waits until the entire
> page is downloaded until being displayed IF there are tables on the page.
> write a small test script to see if Im right.
>
>
> --
>
>
>
> Chris Lee
> Mediawaveonline.com
> [EMAIL PROTECTED]
>
>
>
>
>
> ""Spallek, Heiko"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I have a script which slowly processes several thousand lines of text. I
> > want to give users a feeling for that the process is not dead.
> Thus, I am
> > using:
> >
> > ...
> > print "processing ";
> > print"
> >     ";
> > flush();
> >
> > for($i=0;$i<count($total);$i++) {
> > print".
> >       ";
> > flush();
> > // do something time consuming
> > }
> > ...
> >
> > Works perfect in IE 5.5: It shows the word "processing" followed every 2
> > seconds (denpending on what I am doing) by a new period.
> >
> > But, in Netscape nothing shows up until the entire process has finished.
> > When I push "stop" on the Netspace menu it shows what was transfered so
> far
> > and "Transfer interrupted!" But, I would rather have it the way it is in
> IE.
> >
> > Any idea how to improve the code above?
> > Thanks!
> >
> > Der Heiko
> >
> > Buchtipp: http://www.aufbruch.com/
> > Heiko und Gisela Spallek:
> > Aufbruch ins Land der unbegrenzten Moeglichkeiten.
> > Studieren, Arbeiten und Leben in den USA: Tips fuer Neuankoemmlinge
> > 2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3
> >
> >
> >
> >
> >
> >
> > --
> > 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]
>
>






Netscape waits until the HTML entity is complete.  Meaning it will
render a table as soon as it gets "</TABLE>".

Chris

On Sat, 27 Jan 2001, Sander Pilon wrote:
> Date: Sat, 27 Jan 2001 00:39:17 +0100
> To: "Chris Lee" <[EMAIL PROTECTED]>,
> <[EMAIL PROTECTED]>
> From: "Sander Pilon" <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Display progress in browser using flush();   IE
> versus NS
> 
> Look here -
> 
> http://home.netscape.com/assist/net_sites/mozilla/index.html
> (That is not an animated gif)
> 
> http://home.netscape.com/assist/net_sites/pushpull.html
> 
> It only works in netscape (so far), but hey... you can't forget the
> two
> remaining people on the planet that actually use it, right?
> 
> 
> > -----Original Message-----
> > From: Chris Lee [mailto:[EMAIL PROTECTED]]
> > Sent: 26 January 2001 23:53
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Display progress in browser using flush(); IE
> versus
> > NS
> >
> >
> > havent tested this but im almost sure that netscape waits until the
> entire
> > page is downloaded until being displayed IF there are tables on the
> page.
> > write a small test script to see if Im right.
> >
> >
> > --
> >
> >
> >
> > Chris Lee
> > Mediawaveonline.com
> > [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> > ""Spallek, Heiko"" <[EMAIL PROTECTED]> wrote in message
> >
>
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hi,
> > >
> > > I have a script which slowly processes several thousand lines of
> text. I
> > > want to give users a feeling for that the process is not dead.
> > Thus, I am
> > > using:
> > >
> > > ...
> > > print "processing ";
> > > print"
> > >     ";
> > > flush();
> > >
> > > for($i=0;$i<count($total);$i++) {
> > > print".
> > >       ";
> > > flush();
> > > // do something time consuming
> > > }
> > > ...
> > >
> > > Works perfect in IE 5.5: It shows the word "processing" followed
> every 2
> > > seconds (denpending on what I am doing) by a new period.
> > >
> > > But, in Netscape nothing shows up until the entire process has
> finished.
> > > When I push "stop" on the Netspace menu it shows what was
> transfered so
> > far
> > > and "Transfer interrupted!" But, I would rather have it the way
> it is in
> > IE.
> > >
> > > Any idea how to improve the code above?
> > > Thanks!
> > >
> > > Der Heiko
> > >
> > > Buchtipp: http://www.aufbruch.com/
> > > Heiko und Gisela Spallek:
> > > Aufbruch ins Land der unbegrenzten Moeglichkeiten.
> > > Studieren, Arbeiten und Leben in den USA: Tips fuer
> Neuankoemmlinge
> > > 2. erweiterte und ueberarbeitete Auflage: ISBN: 3-934407-01-3
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 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]
> 
-- 
"What's the Constitution between friends?"  - TIMOTHY J. CAMPBELL -
Response to President Cleveland, who refused to support a bill because
it was unconstitutional





-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I'm trying to do something in PHP4.0.4p1 that in the past I've done in
mod_perl, but appears to be more difficult.  Basically I have some PHP
code that does access checks against a DB to see if that user has access
to the requested URL.  I'm using mod_layout to call the PHP script so I
can wrap static html pages, CGI's, and not just PHP pages.

The issue is that for CGI's, I don't seem to be able to prevent the CGI
from actually executing and displaying content.  About the best I can do
is generate a 302 with a 0 second delay in the meta tags to send them to a
"Sorry buddy" page, but the CGI output is displayed briefly.

Does anyone know of a way to force the Apache process to abort further
processing?  exit and die just kill off the PHP processing engine, leaving
the CGI running.  I tried trigger_error, but that just displayed a nice
error message.

Anyone have any other ideas?  I've thought about generating a 302 in the
http-headers and using the Location: parameter to send them someplace else
(like how mod_rewrite does redirection) but I can't seem to get it to
work.

Thanks.

- -- 
Aaron Turner <[EMAIL PROTECTED]|synfin.net|linuxkb.org>  URI:www.synfin.net
They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety. -- Benjamin Franklin

pub 1024D/F86EDAE6  Sig: 3167 CCD6 6081 0FFC B749  9A8F 8707 9817 F86E DAE6
All emails by me are PGP signed; a lack of a signature indicates a forgery.
I have retired my PGP 2.6.2 key: FBE1 CEED 57E4 AB80  596E 60BF 451B 20E8 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Public key at: http://www.synfin.net/aturner/pgpkey.asc

iEYEARECAAYFAjpx1jEACgkQhweYF/hu2ubKJwCfXrm/sQEy3t8u7vefaGlD/Pyb
zTYAn1EcoNK+fBdnF8IFLMn6ojANnbyb
=PGwr
-----END PGP SIGNATURE-----






Just do:

Header("Location: $url");
exit;

-Rasmus

On Fri, 26 Jan 2001, Aaron D. Turner wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> I'm trying to do something in PHP4.0.4p1 that in the past I've done in
> mod_perl, but appears to be more difficult.  Basically I have some PHP
> code that does access checks against a DB to see if that user has access
> to the requested URL.  I'm using mod_layout to call the PHP script so I
> can wrap static html pages, CGI's, and not just PHP pages.
>
> The issue is that for CGI's, I don't seem to be able to prevent the CGI
> from actually executing and displaying content.  About the best I can do
> is generate a 302 with a 0 second delay in the meta tags to send them to a
> "Sorry buddy" page, but the CGI output is displayed briefly.
>
> Does anyone know of a way to force the Apache process to abort further
> processing?  exit and die just kill off the PHP processing engine, leaving
> the CGI running.  I tried trigger_error, but that just displayed a nice
> error message.
>
> Anyone have any other ideas?  I've thought about generating a 302 in the
> http-headers and using the Location: parameter to send them someplace else
> (like how mod_rewrite does redirection) but I can't seem to get it to
> work.
>
> Thanks.
>
> - --
> Aaron Turner <[EMAIL PROTECTED]|synfin.net|linuxkb.org>  URI:www.synfin.net
> They that can give up essential liberty to obtain a little temporary safety
> deserve neither liberty nor safety. -- Benjamin Franklin
>
> pub 1024D/F86EDAE6  Sig: 3167 CCD6 6081 0FFC B749  9A8F 8707 9817 F86E DAE6
> All emails by me are PGP signed; a lack of a signature indicates a forgery.
> I have retired my PGP 2.6.2 key: FBE1 CEED 57E4 AB80  596E 60BF 451B 20E8
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.4 (GNU/Linux)
> Comment: Public key at: http://www.synfin.net/aturner/pgpkey.asc
>
> iEYEARECAAYFAjpx1jEACgkQhweYF/hu2ubKJwCfXrm/sQEy3t8u7vefaGlD/Pyb
> zTYAn1EcoNK+fBdnF8IFLMn6ojANnbyb
> =PGwr
> -----END PGP SIGNATURE-----
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles 
and works fine, but PHP4 gives a floating point error (both as a module 
and static).  PHP4 under FreeBSD 4.2 works fine.

Any ideas,
Julia

-- 
[  Julia Anne Case  ] [        Ships are safe inside the harbor,       ]
[Programmer at large] [      but is that what ships are really for.    ]  
[   Admining Linux  ] [           To thine own self be true.           ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
          




Try a snapshot from http://snaps.php.net

This should be fixed.

-Rasmus

On Fri, 26 Jan 2001, Julia A . Case wrote:

> I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles
> and works fine, but PHP4 gives a floating point error (both as a module
> and static).  PHP4 under FreeBSD 4.2 works fine.
>
> Any ideas,
> Julia
>
> --
> [  Julia Anne Case  ] [        Ships are safe inside the harbor,       ]
> [Programmer at large] [      but is that what ships are really for.    ]
> [   Admining Linux  ] [           To thine own self be true.           ]
> [ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
>
>
> --
> 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]
>





Thanks, it works now.

Julia

Quoting Rasmus Lerdorf ([EMAIL PROTECTED]):
> Try a snapshot from http://snaps.php.net
> 
> This should be fixed.
> 
> -Rasmus
> 
> On Fri, 26 Jan 2001, Julia A . Case wrote:
> 
> > I'm having some trouble with PHP4 on a FreeBSD 3.2 machine.  PHP3 compiles
> > and works fine, but PHP4 gives a floating point error (both as a module
> > and static).  PHP4 under FreeBSD 4.2 works fine.
> >
> > Any ideas,
> > Julia
> >
> > --
> > [  Julia Anne Case  ] [        Ships are safe inside the harbor,       ]
> > [Programmer at large] [      but is that what ships are really for.    ]
> > [   Admining Linux  ] [           To thine own self be true.           ]
> > [ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
> >
> >
> > --
> > 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]

-- 
[  Julia Anne Case  ] [        Ships are safe inside the harbor,       ]
[Programmer at large] [      but is that what ships are really for.    ]  
[   Admining Linux  ] [           To thine own self be true.           ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
          




when i put this
header('location: $url');

i get this

http://domain.com/$url

what the hell am i doing wrong?







Kurth Bemis wrote:
> 
> when i put this
> header('location: $url');
> 
> i get this
> 
> http://domain.com/$url
> 
> what the hell am i doing wrong?
> 
erm,
header ("Location: $url");

[double quotes, so PHP will consider your dollars, yens or whatever]

--teodor




I have a script that works fine on my server but gives this error on the
server where I need it.

Warning: File Upload Error - Unable to open temporary file [./php06339aaa]
in /home/sites/site9/web/photo_admin/upload.php3 on line 138

Could someone point me in the right direction?

Thanks.

Data Driven Design
PO Box 1084
Holly Hill, Florida 32117

http://www.datadrivendesign.com
http://www.rossidesigns.net





that sounds like a permissions error.
check the permissions for all of the directories and the file along your
path.


-----Original Message-----
From: Data Driven Design [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File upload error


I have a script that works fine on my server but gives this error on the
server where I need it.

Warning: File Upload Error - Unable to open temporary file [./php06339aaa]
in /home/sites/site9/web/photo_admin/upload.php3 on line 138

Could someone point me in the right direction?

Thanks.

Data Driven Design
PO Box 1084
Holly Hill, Florida 32117

http://www.datadrivendesign.com
http://www.rossidesigns.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]




Sort of along these lines, has anyone done tests to see if you can 100%
ditch php.ini, and run all the php config info in httpd.conf? I'd much
rather do it that way, I'd only have to maintain 1 file...

_a




On 1/25/01 1:36 AM, in article
Pine.BSF.4.10.10101250910530.26823-100000@localhost, "Philip Olson"
<[EMAIL PROTECTED]> wrote:

> Hi Catalin,
> 
> I'm trying to decipher what can and cannot be set with ini_set myself and
> am slowly figuring it out :-)  This cannot be set this way but rather it
> could be set through .htaccess so :
> 
> this works in .htaccess :
> 
>   php_value register_globals off
> 
> this will not work in script :
> 
>   ini_set("register_globals","off");
> 
> The latter will set the "local value" but it won't be of any use, it will
> remain "on" although if you do ini_get("register_globals") right below it
> it'll report them as "off" when in fact they are "on"  There you have it.
> The answer is "NO" as, as quoted from a similar question awhile ago :
> 
> "Directives that affect actions that are taken before a script is
> parsed, such as mangling EGPCS data, can not be changed by the script."
>        - Rasmus
> 
> This certainly falls into that category.
> 
> Regards,
> 
>                                          be outside the box.
> Philip Olson
> http://www.cornado.com/
> 
> 
> On Thu, 25 Jan 2001, Catalin Borcea wrote:
> 
>> Can I set "register_globals=off" using a runtime configuration directive
>> (something like <?php_register_globals_off?>)?
>> 
>> TIA
>> -- Catalin Borcea --
>>                       \\\|///
>>                      \\ - - //
>>                    ( @ @ )
>>  -----oOOO----(_)----OOOo----
>> 
>> 
>> 
>> 
>> -- 
>> 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]
>> 
> 





>       print "Content-type: text/html\n\n";

That's the "perl" method, because perl doesn't have any native functions for
adding stuff to the response header, so you just print it :)


>       header( "Content-type: test/html" );

The above is correct.

_alex





Can someone give me an example of a simple sybase query page?

here is what i have:

<?
$server = "someserver";
$user = "sybuser";
$pass = "sybpass";
$query = "select * from SomeSillyTable where ThatSillyGuy='me'";
sybase_connect ($server, $user, $pass);
sybase_query ($query);
sybase_close ();
?>

Here is what I get:

Warning: -1 is not a Sybase link index in /www/smurfy/include/clumpysql.php on
line 7

Warning: -1 is not a Sybase link index in /www/smurfy/include/clumpysql.php on
line 8





Does the encoder have support for multiple file encoded "bundles" ?

i.e. If there's an include statement in a file I encode, can I specify the
included file should be wrapped in to the same file?

Obviously that's a totally simplistic example, but you get the idea :)

_alex





I have this scriptlet:

$items = 6;
$randnum = rand(1,$items);
echo $randnum . "<br><br>";

Always, no matter how many times I hit refresh, it'll always return the
lowest possible value, in this case 1.  If I have rand(4,$items), it returns
four.

So I tried mt_rand(), with this:

$items = 6;
$randnum = mt_rand(1,$items);
echo $randnum . "<br><br>";

This always, without fail, returns the highest possible value.  6 in this
case.

I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.  Could
this be a cache type problem?  Could the gods be conspiring to drive me
steadily insane?

April





this is a function that I wrote to solve this problem, but it is almost
impossible to get a truly random number you can get somthing pretty close by
seeding with somthing like the time function, using the seconds since epoch
and this should be hard to duplicate.

<?php
function random_number($config, $lownum, $highnum){

$time = date(U);
$seed = srand($time);
$rand = rand($lownum, $highnum);

echo  "<FONT FACE=\"$fontstyle\" SIZE=\"$fontsize\"
COLOR=\"$fontcolor\">$rand</FONT>";

$lownum  = "1";
$highnum = "100";
random_number("config.inc.php", $lownum, $highnum);

}
?>

-----Original Message-----
From: April [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:50 PM
To: PHP General
Subject: [PHP] rand(), mt_rand(), and my inability to make either of
them random.


I have this scriptlet:

$items = 6;
$randnum = rand(1,$items);
echo $randnum . "<br><br>";

Always, no matter how many times I hit refresh, it'll always return the
lowest possible value, in this case 1.  If I have rand(4,$items), it returns
four.

So I tried mt_rand(), with this:

$items = 6;
$randnum = mt_rand(1,$items);
echo $randnum . "<br><br>";

This always, without fail, returns the highest possible value.  6 in this
case.

I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.  Could
this be a cache type problem?  Could the gods be conspiring to drive me
steadily insane?

April


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

You need to plant seeds to reach this goal, it discusses this in manual   
under rand() and mt_rand() so have a look here :

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

Which links to and talks about srand :

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

A seedless rand() is essentially useless.  Examples exist in the above,   
check out the user comments.

Philip

On Fri, 26 Jan 2001, April wrote:

> I have this scriptlet:
> 
> $items = 6;
> $randnum = rand(1,$items);
> echo $randnum . "<br><br>";
> 
> Always, no matter how many times I hit refresh, it'll always return the
> lowest possible value, in this case 1.  If I have rand(4,$items), it returns
> four.
> 
> So I tried mt_rand(), with this:
> 
> $items = 6;
> $randnum = mt_rand(1,$items);
> echo $randnum . "<br><br>";
> 
> This always, without fail, returns the highest possible value.  6 in this
> case.
> 
> I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.  Could
> this be a cache type problem?  Could the gods be conspiring to drive me
> steadily insane?
> 
> April
> 
> 
> -- 
> 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]
> 





Thanks.  It doesn't need to be completely random, just, more random than
"1".  The occasional 3 would be enough for me.

And,t hank you very very much.  You forgot the quotes around the U, btw.
*huggss*

----- Original Message -----
From: "Robert Collins" <[EMAIL PROTECTED]>
To: "'April'" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 2:58 PM
Subject: RE: [PHP] rand(), mt_rand(), and my inability to make either of
them random.


> this is a function that I wrote to solve this problem, but it is almost
> impossible to get a truly random number you can get somthing pretty close
by
> seeding with somthing like the time function, using the seconds since
epoch
> and this should be hard to duplicate.
>
> <?php
> function random_number($config, $lownum, $highnum){
>
> $time = date(U);
> $seed = srand($time);
> $rand = rand($lownum, $highnum);
>
> echo  "<FONT FACE=\"$fontstyle\" SIZE=\"$fontsize\"
> COLOR=\"$fontcolor\">$rand</FONT>";
>
> $lownum  = "1";
> $highnum = "100";
> random_number("config.inc.php", $lownum, $highnum);
>
> }
> ?>
>
> -----Original Message-----
> From: April [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 1:50 PM
> To: PHP General
> Subject: [PHP] rand(), mt_rand(), and my inability to make either of
> them random.
>
>
> I have this scriptlet:
>
> $items = 6;
> $randnum = rand(1,$items);
> echo $randnum . "<br><br>";
>
> Always, no matter how many times I hit refresh, it'll always return the
> lowest possible value, in this case 1.  If I have rand(4,$items), it
returns
> four.
>
> So I tried mt_rand(), with this:
>
> $items = 6;
> $randnum = mt_rand(1,$items);
> echo $randnum . "<br><br>";
>
> This always, without fail, returns the highest possible value.  6 in this
> case.
>
> I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.
Could
> this be a cache type problem?  Could the gods be conspiring to drive me
> steadily insane?
>
> April
>
>
> --
> 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]
>





lol, nm, you weren't.  Why does it return Warning: Use of undefined constant
U - assumed 'U' in c:\apache\htdocs\temp\random.php on line 4 if I don't use
quotes, though?

annnnyway, I'm going to give up on this.  Thanks, though.
----- Original Message -----
From: "April" <[EMAIL PROTECTED]>
To: "Robert Collins" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 3:15 PM
Subject: Re: [PHP] rand(), mt_rand(), and my inability to make either of
them random.


> Thanks.  It doesn't need to be completely random, just, more random than
> "1".  The occasional 3 would be enough for me.
>
> And,t hank you very very much.  You forgot the quotes around the U, btw.
> *huggss*
>
> ----- Original Message -----
> From: "Robert Collins" <[EMAIL PROTECTED]>
> To: "'April'" <[EMAIL PROTECTED]>; "PHP General"
> <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 2:58 PM
> Subject: RE: [PHP] rand(), mt_rand(), and my inability to make either of
> them random.
>
>
> > this is a function that I wrote to solve this problem, but it is almost
> > impossible to get a truly random number you can get somthing pretty
close
> by
> > seeding with somthing like the time function, using the seconds since
> epoch
> > and this should be hard to duplicate.
> >
> > <?php
> > function random_number($config, $lownum, $highnum){
> >
> > $time = date(U);
> > $seed = srand($time);
> > $rand = rand($lownum, $highnum);
> >
> > echo  "<FONT FACE=\"$fontstyle\" SIZE=\"$fontsize\"
> > COLOR=\"$fontcolor\">$rand</FONT>";
> >
> > $lownum  = "1";
> > $highnum = "100";
> > random_number("config.inc.php", $lownum, $highnum);
> >
> > }
> > ?>
> >
> > -----Original Message-----
> > From: April [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 26, 2001 1:50 PM
> > To: PHP General
> > Subject: [PHP] rand(), mt_rand(), and my inability to make either of
> > them random.
> >
> >
> > I have this scriptlet:
> >
> > $items = 6;
> > $randnum = rand(1,$items);
> > echo $randnum . "<br><br>";
> >
> > Always, no matter how many times I hit refresh, it'll always return the
> > lowest possible value, in this case 1.  If I have rand(4,$items), it
> returns
> > four.
> >
> > So I tried mt_rand(), with this:
> >
> > $items = 6;
> > $randnum = mt_rand(1,$items);
> > echo $randnum . "<br><br>";
> >
> > This always, without fail, returns the highest possible value.  6 in
this
> > case.
> >
> > I'm using Apache/4.0.3pl1 on Windows 2000, locally, just to develop.
> Could
> > this be a cache type problem?  Could the gods be conspiring to drive me
> > steadily insane?
> >
> > April
> >
> >
> > --
> > 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 could I:

How could I check to make sure a page exists before I redirect to it (a page
within my own server, but page name passed in querystring - therefore it
could be changed by client)?

Thanks!





Try this:

<?
$filename = "dat.txt";

if (file_exists($filename)){
        echo "file exists";
} else {
        echo "file does not exist";
}
?>

Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com

-----Original Message-----
From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:58 PM
To: PHP Mailing List
Subject: [PHP] Check for Page


How could I:

How could I check to make sure a page exists before I redirect to it (a page
within my own server, but page name passed in querystring - therefore it
could be changed by client)?

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]




We need something to where we can poll a service and
pull the exchange rates for various currencies against
the dollar to our database for later use.  Is there a PHP
library/class that does something like this already?  Just
so I'm not reinventing the wheel? :p

Chris




There was a discussion of one that starts here :

    http://marc.theaimsgroup.com/?l=php-pear&m=97879652231768&w=2

Not sure how far along it is and that discussion is more about "where to
put it in PEAR" and it's not yet in PEAR so who knows, perhaps you can ask
the author about it.  At somepoint it will live here :

    http://viewcvs.php.net/viewcvs.cgi/php4/pear/Numbers/

Philip

On Fri, 26 Jan 2001, Boget, Chris wrote:

> We need something to where we can poll a service and
> pull the exchange rates for various currencies against
> the dollar to our database for later use.  Is there a PHP
> library/class that does something like this already?  Just
> so I'm not reinventing the wheel? :p
> 
> Chris
> 





I've installed PHP using the 4.04 win32 installer. I recently downloaded the 
mysql(latest version) win32 installer and used that. But STILL mysql doesnt work. Can 
someone give a code snipet i can use to see if it is working?




I just installed mySQL yesterday from mysql.com (or .net or whatever it
was). It installed fine, there was a note about what to do if you didn't
install it to c:\mysql properly - I installed mine to a different directory,
followed the instructions and all went fine. Might be one place to start.

HTH,
jb

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 8:21 PM
To: PHP
Subject: [PHP] Help Please, MySQL is driving me insane


I've installed PHP using the 4.04 win32 installer. I recently downloaded the
mysql(latest version) win32 installer and used that. But STILL mysql doesnt
work. Can someone give a code snipet i can use to see if it is working?




But i installed it to the default c:\mysql.
How can I set a username and such to allow me to use it on my cpu?
----- Original Message -----
From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 4:12 PM
Subject: RE: [PHP] Help Please, MySQL is driving me insane


> I just installed mySQL yesterday from mysql.com (or .net or whatever it
> was). It installed fine, there was a note about what to do if you didn't
> install it to c:\mysql properly - I installed mine to a different
directory,
> followed the instructions and all went fine. Might be one place to start.
>
> HTH,
> jb
>
> -----Original Message-----
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:21 PM
> To: PHP
> Subject: [PHP] Help Please, MySQL is driving me insane
>
>
> I've installed PHP using the 4.04 win32 installer. I recently downloaded
the
> mysql(latest version) win32 installer and used that. But STILL mysql
doesnt
> work. Can someone give a code snipet i can use to see if it is working?
>
> --
> 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 started the server? If not go to the command prompt and:
1. cd c:\mysql\bin (assuming this is where it was installed.
2. type mqsqld-opt (optimized for pentium class PC)

That should start the server.
If you need more help let me know.

- Shane

----- Original Message -----
From: "Chris" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:20 PM
Subject: [PHP] Help Please, MySQL is driving me insane


I've installed PHP using the 4.04 win32 installer. I recently downloaded the
mysql(latest version) win32 installer and used that. But STILL mysql doesnt
work. Can someone give a code snipet i can use to see if it is working?






The username that it defaults to is root, with no password. There is a
command you need to run to set a password.

----- Original Message -----
From: "Chris" <[EMAIL PROTECTED]>
To: "Jason Bouwmeester" <[EMAIL PROTECTED]>; "PHP"
<[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:29 PM
Subject: Re: [PHP] Help Please, MySQL is driving me insane


> But i installed it to the default c:\mysql.
> How can I set a username and such to allow me to use it on my cpu?
> ----- Original Message -----
> From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 4:12 PM
> Subject: RE: [PHP] Help Please, MySQL is driving me insane
>
>
> > I just installed mySQL yesterday from mysql.com (or .net or whatever it
> > was). It installed fine, there was a note about what to do if you didn't
> > install it to c:\mysql properly - I installed mine to a different
> directory,
> > followed the instructions and all went fine. Might be one place to
start.
> >
> > HTH,
> > jb
> >
> > -----Original Message-----
> > From: Chris [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 26, 2001 8:21 PM
> > To: PHP
> > Subject: [PHP] Help Please, MySQL is driving me insane
> >
> >
> > I've installed PHP using the 4.04 win32 installer. I recently downloaded
> the
> > mysql(latest version) win32 installer and used that. But STILL mysql
> doesnt
> > work. Can someone give a code snipet i can use to see if it is working?
> >
> > --
> > 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]
>





Ummm try going into c:\mysql\bin and running winmysqladmin.exe or
MySqlManager.exe - I can't remember which one I ran.

HTH,
jb

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 8:29 PM
To: Jason Bouwmeester; PHP
Subject: Re: [PHP] Help Please, MySQL is driving me insane


But i installed it to the default c:\mysql.
How can I set a username and such to allow me to use it on my cpu?
----- Original Message -----
From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 4:12 PM
Subject: RE: [PHP] Help Please, MySQL is driving me insane


> I just installed mySQL yesterday from mysql.com (or .net or whatever it
> was). It installed fine, there was a note about what to do if you didn't
> install it to c:\mysql properly - I installed mine to a different
directory,
> followed the instructions and all went fine. Might be one place to start.
>
> HTH,
> jb
>
> -----Original Message-----
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:21 PM
> To: PHP
> Subject: [PHP] Help Please, MySQL is driving me insane
>
>
> I've installed PHP using the 4.04 win32 installer. I recently downloaded
the
> mysql(latest version) win32 installer and used that. But STILL mysql
doesnt
> work. Can someone give a code snipet i can use to see if it is working?
>
> --
> 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]
>




Ahh, thank you everyone...now I just have to figure this beast out
----- Original Message -----
From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 4:23 PM
Subject: RE: [PHP] Help Please, MySQL is driving me insane


> Ummm try going into c:\mysql\bin and running winmysqladmin.exe or
> MySqlManager.exe - I can't remember which one I ran.
>
> HTH,
> jb
>
> -----Original Message-----
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:29 PM
> To: Jason Bouwmeester; PHP
> Subject: Re: [PHP] Help Please, MySQL is driving me insane
>
>
> But i installed it to the default c:\mysql.
> How can I set a username and such to allow me to use it on my cpu?
> ----- Original Message -----
> From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 4:12 PM
> Subject: RE: [PHP] Help Please, MySQL is driving me insane
>
>
> > I just installed mySQL yesterday from mysql.com (or .net or whatever it
> > was). It installed fine, there was a note about what to do if you didn't
> > install it to c:\mysql properly - I installed mine to a different
> directory,
> > followed the instructions and all went fine. Might be one place to
start.
> >
> > HTH,
> > jb
> >
> > -----Original Message-----
> > From: Chris [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 26, 2001 8:21 PM
> > To: PHP
> > Subject: [PHP] Help Please, MySQL is driving me insane
> >
> >
> > I've installed PHP using the 4.04 win32 installer. I recently downloaded
> the
> > mysql(latest version) win32 installer and used that. But STILL mysql
> doesnt
> > work. Can someone give a code snipet i can use to see if it is working?
> >
> > --
> > 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]
>
>





All,

I'm trying to port a wonderful application over to miserable windows. I can not find 
documentation of how to invoke exec on windows. Here's what I tried:

// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;
if ($PLATFORM == "windows") {
$new_path = str_replace('^', '\\', $WINDOWS_PATH);
exec("copy c:\temp\$picture $new_path.$image");
echo $new_path.$image;
} else {
exec("mv $picture 
/services/webpages/t/h/thebackcarecenter.com/public/RDI_Shop/images/$image"); 
}

The previous step uploads the file. It does get to the temp directory, but never 
copies to the permanent directory. All the varaibles are defined. I think it lies in 
how I'm trying to execute a command.









>I'm trying to port a wonderful application over to miserable windows. I can
not find documentation of how to invoke exec on windows. Here's what I
tried:

Some people say exec() does not work on Windows...  I could have sworn I've
seen it work, but maybe not...
$new_path = str_replace('^', '\\', $WINDOWS_PATH);
exec("copy c:\temp\$picture $new_path.$image");

You need \\ for each \ there.  In particutlar, you have the tab character
after :c and before 'emp' now.

The good news is, you can maybe use copy() and unlink() for this instead of
exec().
The bad news is, Win98 says I don't have permission to do copy() or unlink()
and I'll be damned if I can figure out how to alter permissions in Win98 to
make it possible.

exec("mv $picture
/services/webpages/t/h/thebackcarecenter.com/public/RDI_Shop/images/$image")
;

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm









Should I place the error_log dir between quotes?

"/var/log/php4/error.log"

Or not?





Won't hurt.

You probably don't need to since it doens't have spaces or any funky
characters...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Steve Haemelinck" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 3:08 PM
Subject: [PHP] PHP.INI


> Should I place the error_log dir between quotes?
>
> "/var/log/php4/error.log"
>
> Or not?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





How can I check if Headers have been written to the browser?

Thank You!






Karl,

This may work for you :

http://www.php.net/manual/en/function.headers-sent.php

Philip

On Fri, 26 Jan 2001, Karl J. Stubsjoen wrote:

> How can I check if Headers have been written to the browser?
> 
> Thank You!
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






I tried to do the following:



class some_class {

    var $something;

    function select_something () {

        $query = "SELECT something FROM something_tb WHERE something =
'$this->something'";

        $db = new db_sql;

        $db->query($query);
        $db->next_record ();

        $this->something = $db->Record["something"];
    }
}


class another_class {

    var $something_else;

    function select_something_else () {

        $query = "SELECT something_else FROM something_else_tb";

        $db = new db_sql;
        $something_class = new some_class;

        $db->query($query);
        while ($db->next_record ()) {

            $something_class->something = $db->Record["something_else"];
            $something_class->select_something ();
        }
    }
}


PHP is throwing up an error stating that I can't nest classes. Is this true?
What is the reason for not being able to nest classes? Is there any way
around it or am I thinking about classes incorrectly?

Any help would be greatly appreciated. Thanks very much.

-- 

Clarence Kwei

[EMAIL PROTECTED]

ScienCentral, Inc.
(212) 244-9577 ext. 118

<http://www.stn2.com>
<http://www.sciencentral.com>






Hello all,

I was just taking a look at the latest php4 snapshot and came across this 
in the phpinfo: HTTP_COOKIE_VARS["htscallerid"]. It seems that 
"htscallerid" is set the first time a person comes to the site if cookies 
are enabled and isn't set if cookies aren't enabled. Is this correct?

Also I saw this - url_rewriter.tags and was wondering if anyone had info on 
it. I saw that is was added in the change logs but didn't see any other 
info on it. It appears to have to do with use_trans_sid.

Thanks,

Trevor DeVore
Blue Mango Multimedia 





Hello,

How can I detect the directory where my file is in? i.e. I want the same
file to do something different depending on where it is located. Is there a
function for that?

Thanks for the attention!

Marx





<?
    echo "$DOCUMENT_ROOT <br>\n";
    echo "$PHP_SELF <br>\n";
?>

Try that. or am missunerstanding the question?

Chris Lee
Mediawaveonline.com



""Marx Gomes"" <[EMAIL PROTECTED]> wrote in message
012601c087d8$2ef57da0$[EMAIL PROTECTED]">news:012601c087d8$2ef57da0$[EMAIL PROTECTED]...
> Hello,
>
> How can I detect the directory where my file is in? i.e. I want the same
> file to do something different depending on where it is located. Is there
a
> function for that?
>
> Thanks for the attention!
>
> Marx
>
>
> --
> 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]
>






Joe wrote
> Use dirname() function to find which directory the file is in. 

Chris Lee wrote
>     echo "$PHP_SELF <br>\n";

That's it! dirname($PHP_SELF) is exactly what I need. Thanks!

Marx





I want to setup php so that when I click a PHP script local to my hard
drive: C:\test.php it will run it through the PHP.exe parser but display the
results in my web browser...Anyone done this?

Thanks,
-Jonathan





Here's what I get:

Warning: Unable to create 'd:\sites\merchantpower\mp\images\': Permission denied in 
d:/sites/MerchantPower/mp/admin/add_record2.php on line 47





If you are using NT, I think you can right-click on the images directory and
make it writable by anybody.

If you are using Win98, I think you're stuck.

Win95, stuck.

Win2K, who knows.
WinME, who knows.

Disclaimer:  I didn't need it bad enough to *really* try that hard -- I was
coding a quickie on my laptop for a guy on Linux where this stuff works
right.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Shane McBride" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 26, 2001 3:47 PM
Subject: [PHP] move_uploaded_file - getting furthur ..still need help


Here's what I get:

Warning: Unable to create 'd:\sites\merchantpower\mp\images\': Permission
denied in d:/sites/MerchantPower/mp/admin/add_record2.php on line 47







Hello, anybody know, how can i change the timeout of the telnet server in a redhat 
6.2?

Thanks


_____________________________________________________________
Get your own i8that.com email addresses.  It's Fun!  It's Free!  
Go to---> http://www.i8that.com




Hello php-general,

  i get an unknown error with mail(). I dont know why but maybe
  somebody knows what i can do. the code:

<?php
mail("[EMAIL PROTECTED]","test","test");
?>

The error: Warning: Unknown error in ./mailtest.php on line 2

i set up the php.ini correctly !!!
Plz help me!


-- 
Best regards,
 TraXter                          mailto:[EMAIL PROTECTED]






You may need to check your mail server's error logs and see if
something's happening there. Assuming PHP _is_ finding the mail server
and attempting to send the message, there must be some problem at the
mail server (ie, no relay access for the IP where your script is
running, etc.).

--Toby

TraXter wrote:
> 
> Hello php-general,
> 
>   i get an unknown error with mail(). I dont know why but maybe
>   somebody knows what i can do. the code:
> 
> <?php
> mail("[EMAIL PROTECTED]","test","test");
> ?>
> 
> The error: Warning: Unknown error in ./mailtest.php on line 2
> 
> i set up the php.ini correctly !!!
> Plz help me!
> 
> --
> Best regards,
>  TraXter                          mailto:[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]




I am getting this error and I don't understand. I am running PHP 4.0.4 and Xitami web 
server on Windows 98SE. I know this is not the most ideal setup, but I just use it for 
developing.

Warning: Unable to create 'd:\sites\merchantpower\mp\images\': Permission denied in 
d:/sites/MerchantPower/mp/admin/add_record2.php on line 49

Do I need to set permissions somewhere? I have no idea where...maybe the web server? 
It's like the file never gets to the temp directory.....

I'm lost.....
Here's the code:
if (is_uploaded_file($picture)) {
copy($picture, $new_path);
//move_uploaded_file($picture, $new_path);
} else {
echo "Possible file upload attack: filename '$picture'.";
}
}

Any help would be greatly appreciated...

-Shane




""Shane McBride"" ...
> I am getting this error and I don't understand. I am running
> PHP 4.0.4 and Xitami web server on Windows 98SE. I know this
> is not the most ideal setup, but I just use it for developing.

Usually, webservers running PHP won't allow to execute any commands
regarding creation or modificacion of any files in the server...

I was trying to make a simple hitcounter for a website, feeding the number
of hits in a simple text file... at home, with a W98/onmihttpd it worked...
at the real unix/apache webserver, permission to modify the file...








hello,

I was just wondering if it is possible to connect to Microsoft SQL server
7.0 with php4?

Thank you,

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





yes it is


Brandon Orther wrote:

> hello,
>
> I was just wondering if it is possible to connect to Microsoft SQL server
> 7.0 with php4?
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





Excellent answer...
somewhat when you're asked
"Can you tell me where the Bakery is?"
and you say
"Yes, I can."

Forgive me for saying so, but I find this sort of attitude on a mailing list
designed as help forum very arrogant, impolite and snooty, and completely
unnecessary.

-----Original Message-----
From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 3:35 PM
To: Brandon Orther
Cc: PHP User Group
Subject: Re: [PHP] Microsoft SQL server 7


yes it is


Brandon Orther wrote:

> hello,
>
> I was just wondering if it is possible to connect to Microsoft SQL server
> 7.0 with php4?
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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









"Thor M. Steindorsson" wrote:

> Excellent answer...
>

Thanks.


> somewhat when you're asked
> "Can you tell me where the Bakery is?"
> and you say
> "Yes, I can."
>

Not quite the same thing.

The poster may have simply wanted to know if it was possible.

"I was just wondering if it is possible to connect to Microsoft SQL server
7.0 with php4?"

Yes, it is.

>From Windows?  From Linux?  From a Mac?

None of this info was given.  The original poster was about as brief and
unhelpful
in their request for info as I was in my reply.  Tit for tat.


>
> Forgive me for saying so,

You're not forgiven.



> but I find this sort of attitude on a mailing list
> designed as help forum very arrogant, impolite and snooty, and completely
> unnecessary.
>

I almost figured I'd get one of these after I sent (sent in haste actually - I
meant to add
"email me offlist if you want more info").

Implied or not, the original poster is always more than happy to ask something
offlist - not
everything is PHP specific, nor pertinent to the group.  I've actually posted
our experiences
using PHP and MSSQL to the list in the past, so my guess is that the original
poster
didn't do too much researching into the archives of this list.

I used to share your attitude, but I don't anymore.  Rather than waste huge
amounts of
traffic sending gobs of info on the question, I posted - yes, you can do it.
Implication was
'email me for more info'.





Not sure if this is the right list, but.. I'm running mod_perl on RedHat 7.
I installed the new PHP updates and all of a sudden it broke mod_perl.. I
get this in my error_log

[Fri Jan 26 15:49:20 2001] [notice] child pid 7766 exit signal Segmentation
fault (11)
[Fri Jan 26 15:49:21 2001] [notice] child pid 7764 exit signal Segmentation
fault (11)
[Fri Jan 26 15:49:24 2001] [notice] child pid 7765 exit signal Segmentation
fault (11)
[Fri Jan 26 15:53:24 2001] [notice] SIGHUP received.  Attempting to restart
Subroutine connect_on_init redefined at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 31.
Subroutine setPingTimeOut redefined at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 45.
Subroutine connect redefined at /usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm
line 58.
Subroutine childinit redefined at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 132.
Subroutine cleanup redefined at /usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm
line 149.
Subroutine all_handlers redefined at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 163.
Subroutine disconnect redefined at
/usr/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 179.
[Fri Jan 26 15:53:27 2001] [notice] Apache/1.3.14 (Unix)  (Red-Hat/Linux)
mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 mod_perl/1.24 configured -- resuming
normal operations

When I try running the .pl file from the shell, it works fine. When I
connect via the web, it dies. Can *ANYONE* help me??

Thanks!

David Wolf




Hi does anyone know how I would execute a script on a regular basis using
lynx (what command).






You want to use cron, this reply is made for you :

http://marc.theaimsgroup.com/?l=php-general&m=97962729420863&w=2

It contains a few really useful links on the matter.

Philip

On Fri, 26 Jan 2001, Trunkz Santai wrote:

> Hi does anyone know how I would execute a script on a regular basis using
> lynx (what command).
> 
> 
> 
> -- 
> 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]
> 






ok, i'll jump over to the php list.  any of you guys know what's up with
this/where i can find info?  was there a change in the mysql client
libraries that needs to be considered in things like php and perl's dbi,
or...?

-tcl.


---------- Forwarded message ----------
Date: Fri, 26 Jan 2001 21:04:12 +0100
From: Maciek Uhlig <[EMAIL PROTECTED]>
To: tc lewis <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: RE: aborted connections?

As far as PHP is concerned, 4.0.4pl1 is not enough. You need to install CVS
version later than 2001-01-18. At least this is my experience.

Maciek

> -----Original Message-----
> From: tc lewis [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:47 PM
> To: Maciek Uhlig
> Cc: [EMAIL PROTECTED]
> Subject: RE: aborted connections?
>
>
>
> so we upgraded to 3.23.32 last night, but i'm still seeing a ton of:
> 010126 11:15:24  Aborted connection 30757 to db: 'XXX' user: 'YYY'
> host: `ZZZ' (Got an error reading communication packets)
>
> type errors in the error log.
> i'm seeing these errors from both php connections and from perl dbi
> connections.  the versions involved are:
> mysql-3.23.32
> php-4.0.4pl1
> DBI-1.14
> Msql-Mysql-modules-1.2215
> oh and perl is v5.6.0.
>
> which i believe are the latest stable releases of each.
>
> anything else i should be looking for?
>
> -tcl.
>
>
> On Tue, 23 Jan 2001, tc lewis wrote:
>
> >
> > thanks for the reply.  i found a followup on this problem from sasha
> > ("Follow up on aborted connections bug in 3.23.31"), but wading through
> > the archive searching for the original thread hasn't ended up being
> > successful yet.  anyone know offhand in which thread this was originally
> > discussed?
> >
> > not all of these errors are coming from php connections.  does php have
> > some related issue with this also?
> >
> > -tcl.
> >
> > ps- i like these informative changelog entries:
> >
> > . "Fixed security bug in something (please upgrade if you are
> using a earlier MySQL 3.23 version)."
> > . "Fixed buffer overflow bug when writing a certain error message."
> >
> >
> > On Tue, 23 Jan 2001, Maciek Uhlig wrote:
> >
> > > Read the archives. The detailed story can be found there. Use
> newest MySQL
> > > and newest PHP CVS. These errors will go away.
> > >
> > > Maciek
> > >
> > > > -----Original Message-----
> > > > From: tc lewis [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, January 23, 2001 3:56 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: aborted connections?
> > > >
> > > >
> > > >
> > > > we're seeing a lot of errors like these in our error log
> files from mysql:
> > > >
> > > > 010122 17:38:52  Aborted connection 177373 to db: 'XXX' user: 'YYY'
> > > > host: `ZZZ' (Got an error reading communication packets)
> > > >
> > > > i haven't investigated too too much about this yet, but i
> was wondering
> > > > what common problems this error might be associated with.  i'll keep
> > > > looking through the manual, but suggestions would of course
> be wonderful.
> > > >
> > > > the connections are over ethernet/tcp, and the eth
> interfaces on the mysql
> > > > server are showing 0 errors after months of uptime, so i'm
> guessing it's
> > > > not a tcp/ip issue, as the wording of that error might suggest.
> > > >






Where is my crontrab file located?






Hello everyone~
I'm a Korean(in ASIA) PHPer.
I have some problems with 'mail()' function in windows2000 and PHP4.0

first I met a error message like this

Warning: Failed to Connect in d:\apache\htdocs\mail2.php on line 3 

OOps ~ so I installed my SMTP services then configured my PHP.ini file like this

[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =      ;for unix only, may supply arguments as well (default is 
'sendmail -t -i')

then I retried mail function.

mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");

but this time I met an another error message ~!

Warning: Server Error in d:\apache\htdocs/test/test.php on line 3

OOPs ~! I'm very sorry about this.
Does anyone have a clear answer ?




hi,
im trying to fix this couple of hours but i couldnt find the mistake...
can somebody look at it...

first i want to check the $co_area for 3 digital  ... it must contain 3
digital

if  ($co_area != !ereg("([0-9]{3})",$co_area))
{ echo " * Area code must be 3 digital"; }


second...

nickname check works but the first letter could be any number or any
letters....

with this code it accept only letters as first character....... i just want
any letter or numbers or - _ symboles from 3 to 12 characters...

if ($nickname != !eregi("^[-\._\.0-9a-zA-Z]{3,12}$",$nickname))
 {
 $error ="Nickname must be Alphanumeric[ a-z 0-9; - _ ; 3 - 12
characters ]";
 $flak=1;
 }


i hope someone can help me to fix this...

thanx

kumanan
[EMAIL PROTECTED]








> if  ($co_area != !ereg("([0-9]{3})",$co_area))
> { echo " * Area code must be 3 digital"; }

I don't know anything about ereg and regex, so if there's an error in that
part I won't be able to help with that, but I can tell you that ($something
!= !$something_else) is a double negative, it's like saying "I can't not
program in PHP." You might as well say ($something == $something_else), save
the obfuscation factor.

Since you want to do something when ereg is false, you should say:

if (!ereg(...)) {
  Do a bunch of stuff;
}





Would it be easier to return an OBJECT populated with all the items one
might need?

On 01/22/2001 12:38 PM, "Matt McClanahan" <[EMAIL PROTECTED]> wrote:

> On Mon, 22 Jan 2001, Abe Asghar wrote:
> 
>> Hey there,
>> 
>>  is there a way that you can get a function to return multiple values. e.g.:
>> {and also how to access them}
>> 
>> function VarTest() {
>> 
>> return $var = 10;
>> 
>> return $var2 = 20;
>>  }
> 
> Functions can only return one variable.  However, you can return an array,
> which contains as many values as you need.
> 
> function vartest()
> {
>  $first = 10;
>  $second = 20;
> 
>  return Array($first,$second);
> }
> 
> Matt
> 
> 





UNIVERSITY DIPLOMA

Obtain a prosperous future, money earning power,
and the admiration of all.

Diplomas from prestigious non-accredited universities
based on your present knowledgeand life experience.

No required tests, classes, books, or interviews.

Bachelors, masters, MBA, and doctorate (PhD) diplomas
available in the field of your choice.No one is turned
down.

Confidentiality assured. CALL NOW to receive your
diploma within days!!!

713-866-8869

Call 24 hours a day, 7 days a week, including Sundays
and holidays.

7




How about giving users a chance to pass some context to the completion
function, like an array of acceptable commands? Otherwise for a system with
200 various menues you end up coding 200 function names.

August



Reply via email to