Re: [PHP] File upload !!!!

2001-05-14 Thread Matthias Roggendorf

Hi,
thanks for the responses! Here is the code snippet:

The form:

FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST
INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000
Send this file: INPUT NAME=userfile TYPE=file
INPUT TYPE=submit VALUE=Send File

The PHP part:

if (is_uploaded_file($userfile)) {
copy($userfile, ./);
} else {
echo Possible file upload attack: filename '$userfile'.;
}

It always runs into the file attack line.
When I read out the $HTTP_POST_FILES I get
userfile=array
userfile_size=0
userfile_type=img/gif
 It would be great if you can write back again.
Thanks, Matthias










Kevin Williams [EMAIL PROTECTED] wrote in message
003001c0dbdc$e8e6c5e0$[EMAIL PROTECTED]">news:003001c0dbdc$e8e6c5e0$[EMAIL PROTECTED]...
Hi,
A snippet of code could help, but I recently experienced two problems with
uploading and gaining the information.

Are you using the correct ENCTYPE for the upload, along with using POST (GET
doesn't work).
Also, if you are trying to us the information from inside a function, I had
to either globally define all of the attributes, or you could pass them to
the function.

Hope this helps

Kevin Williams

Matthias Roggendorf [EMAIL PROTECTED] wrote in message
9dmisb$bhq$[EMAIL PROTECTED]">news:9dmisb$bhq$[EMAIL PROTECTED]...
 Hi,
 sorry for asking such easy things but I really have a hard time to get
this
 to work:

 I use exactly the scripts which are given on the PHP website to upload
 files. The problem is that the variable $userfile just contains none and
 $userfile_size is 0. The rest of the variables have the right values.
 When I use a larger file it takes more time so I assume that the file is
 uploaded, but I cannot save it because I don't know the temporary
filename.

 Can anybody help me? I really need this to work.

 Thanks, Matthias



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






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




re: [PHP] File upload !!!

2001-05-14 Thread Rares

Is your file greater than 1000 bytes?
If it is, this is the answer: the file you try to upload is too large.
Increase the limit (beware of the built-in limit of PHP - in php.ini)

INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"


-- 
PHP General Mailing List (http://www.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] How can PHP 3.0.12 recognize semicolons as var delimiters in URL?

2001-05-14 Thread Christian Capito

Hello,

i'm using htdig 3.1.5 on a box with PHP 3.1.12

the program htsearch provides me with html, in which following URLs can be 
found:

http://myserver.de/search/results.php?words=sms;page=2

The problem is, the results.php script can't properly parse the URL and I 
can't use the variables $words or $page. I suppose this is because of the 
semicolons, because the same URL with '' between the variables works.

How can I get php to correctly recognise the semicolons? Semicolons between 
variables are supposed to be valid HTTP links.

Thanks,

christian capito



-- 
PHP General Mailing List (http://www.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] Cookies

2001-05-14 Thread Sascha Andres

hi,
i want to set cookies.
cookies can only be set before html
and head tags. i think this is
because php sends all output immediatly.
is there a statement that stops sending
immediatly and a statement that tells
to send now (at the end of the doc)?

ciao sascha


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




Re: [PHP] File upload !!!!

2001-05-14 Thread Deependra B. Tandukar

Increase your file size limit from 1000 or only the file size smaller or
equal to 1000bytes will be uploaded.

DT

- Original Message -
From: Matthias Roggendorf [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 12:36 PM
Subject: Re: [PHP] File upload 


 Hi,
 thanks for the responses! Here is the code snippet:

 The form:

 FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST
 INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000
 Send this file: INPUT NAME=userfile TYPE=file
 INPUT TYPE=submit VALUE=Send File

 The PHP part:

 if (is_uploaded_file($userfile)) {
 copy($userfile, ./);
 } else {
 echo Possible file upload attack: filename '$userfile'.;
 }

 It always runs into the file attack line.
 When I read out the $HTTP_POST_FILES I get
 userfile=array
 userfile_size=0
 userfile_type=img/gif
  It would be great if you can write back again.
 Thanks, Matthias










 Kevin Williams [EMAIL PROTECTED] wrote in message
 003001c0dbdc$e8e6c5e0$[EMAIL PROTECTED]">news:003001c0dbdc$e8e6c5e0$[EMAIL PROTECTED]...
 Hi,
 A snippet of code could help, but I recently experienced two problems with
 uploading and gaining the information.

 Are you using the correct ENCTYPE for the upload, along with using POST
(GET
 doesn't work).
 Also, if you are trying to us the information from inside a function, I
had
 to either globally define all of the attributes, or you could pass them to
 the function.

 Hope this helps

 Kevin Williams

 Matthias Roggendorf [EMAIL PROTECTED] wrote in message
 9dmisb$bhq$[EMAIL PROTECTED]">news:9dmisb$bhq$[EMAIL PROTECTED]...
  Hi,
  sorry for asking such easy things but I really have a hard time to get
 this
  to work:
 
  I use exactly the scripts which are given on the PHP website to upload
  files. The problem is that the variable $userfile just contains none
and
  $userfile_size is 0. The rest of the variables have the right values.
  When I use a larger file it takes more time so I assume that the file is
  uploaded, but I cannot save it because I don't know the temporary
 filename.
 
  Can anybody help me? I really need this to work.
 
  Thanks, Matthias
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




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




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




php-general Digest 14 May 2001 08:59:38 -0000 Issue 685

2001-05-14 Thread php-general-digest-help


php-general Digest 14 May 2001 08:59:38 - Issue 685

Topics (messages 52635 through 52664):

passing variables without form submit
52635 by: brent simpson

Multiple Selections?
52636 by: Jason Caldwell
52640 by: Sean Cazzell

indexing records
52637 by: midget2000x

One database, different forms
52638 by: midget2000x

Re: File upload 
52639 by: Chris Cameron
52657 by: Matthias Roggendorf
52662 by: James Holloway
52664 by: Deependra B. Tandukar

Receiving a text stream
52641 by: Todd Cary

validate form with javascript
52642 by: Chris Mason
52645 by: Steve

changing error messages
52643 by: todd kennedy

Re: mysql - SUBSTRING
52644 by: Nuno Silva

Re: Search engines and mod_rewrite
52646 by: Steve

fgetcsv
52647 by: Steve Wade
52648 by: Jason Murray
52649 by: Steve Wade
52650 by: Jason Murray

Re: HallMark uses PHP
52651 by: Joseph Blythe
52652 by: Steve Wade
52653 by: Jason Murray
52656 by: Maxim Maletsky

writing updateable code
52654 by: Scott Mebberson
52655 by: elias

Re: File upload !!!
52658 by: Rares

How can PHP 3.0.12 recognize semicolons as var delimiters in URL?
52659 by: Christian Capito

Cookies
52660 by: Sascha Andres
52663 by: Simon Robson

my query results won't clear!! :(
52661 by: Sandeep Hundal

Administrivia:

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

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

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


--




I'm trying to write what I thought would be a pretty simple script 
action to pass a variable from a form element without a sumbit button to 
subsequent pages; instead of a form button i would like any number of
links to other pages to be able to pass this checkbox value: ie whether
it is checked or not.

Doesn't seem as easy as I thought. I tried using some crazy JavaScript / 
PHP thing whereby an onChange in the form element submitted the form to 
itself, hoping perhaps nievely that the php in the links to pages i want 
to recieve this variable would pick it up:

ie: A href=this.html?source=?php echo $value;?this page/a

where value would be whether the checkbox was checked or not, but no go.

Then I tried using Javascript to do the same onChange thing but set a 
cookie, that could be read by subsequent pages through php, but no luck 
there. Can someone tell me where i'm going wrong in my thinking about this?

brent.





I have a Multiple Selection HTML Field --- the user can select any number of
items by holding down the CTRL key.  When I submit my form to my (say)
TestProg.php -- in the Hidden Input Field I only see the value for the
*last* item I selected... how can I see all the items I selected?

Thanks.
Jason






 I have a Multiple Selection HTML Field --- the user can select any number of
 items by holding down the CTRL key.  When I submit my form to my (say)
 TestProg.php -- in the Hidden Input Field I only see the value for the
 *last* item I selected... how can I see all the items I selected?

If you want to allow the user to select multiple items, you should append
'[]' to the end of the name of your select.

select name=color[] size=3 multiple

Now when you get the value, it will be an array of the items they
selected.

You may run into a problem with your hidden input type on the second page
- I'm not sure how PHP will handle things because your value will now be
an array.  You may want to write out a hidden field for each of the users
selections - like:

input type=hidden name=color[] value=one
input type=hidden name=color[] value=two
input type=hidden name=color[] value=three


Regards,

Sean

On Sun, 13 May 2001, Jason Caldwell wrote:

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





What I want to do is figure out a way to index MySQL query results on my PHP
site that's not dependent on the id of each record.

I've got a MySQL photo database that runs my photo site.  Right now, the 'id'
field is a sequential, auto-incremented number, and I am using that id as an
index for the photos (because it was easy for me to grasp).

It works now because the groups are organized in order (for example all the
Iran pictures are sequential).  But 

 ---
providing the finest in midget technology




I am writing a PHP application that will operate on a MySQL database.  There
will be 4 types of forms (like catalog request, info request, etc.) calling
the code which writes the data to the database.

Since the variable names on the forms will equal the MySQL column names (as 

Re: [PHP] imap_fetch_overview Question

2001-05-14 Thread Sigitas Paulavicius

Chris Cowan [EMAIL PROTECTED] wrote in message
9dldfq$kc4$[EMAIL PROTECTED]">news:9dldfq$kc4$[EMAIL PROTECTED]...
 Does anyone know what the sequence argument is suppose to be? More
 importantly, what the numbers stand for 2,4:6?

 Chris

It means give me overview of messages #2 and all from #4 to #6.
So 2,3,4,5 reffers to the same sequence as 2:5.

You might also want to consider using UID rather than Msgno.

Sigitas



-- 
PHP General Mailing List (http://www.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] IMAP/POP3/OUTLOOK Question

2001-05-14 Thread Mattias Segerdahl

Hi,

I was wondering if someone could help me explain how Microsoft OUTLOOK knows
which emails that it has downloaded from the server, as far as I know, there
isn't any way of marking the email in a pop3 queue that they have been
either read or downloaded. But then again, I have an inbox with over 20,000
emails in it, and outlook goes through these in less than a few seconds, so,
could anyone explain to me how this is done.

// Mattias


-- 
PHP General Mailing List (http://www.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] IMAP/POP3/OUTLOOK Question .. NEW! ... Complimantary

2001-05-14 Thread Mattias Segerdahl

Hi,

I was wondering if someone could help me explain how Microsoft OUTLOOK knows
which emails that it has downloaded from the server, as far as I know, there
isn't any way of marking the email in a pop3 queue that they have been
either read or downloaded. But then again, I have an inbox with over 20,000
emails in it, and outlook goes through these in less than a few seconds, so,
could anyone explain to me how this is done.

NEW PART:

This is if I've set the outlook client not to delete the email from the pop
server, or I've choosen to leave the message for x number of days..

// Mattias


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




Re: [PHP] IMAP/POP3/OUTLOOK Question

2001-05-14 Thread jdwright



Hiya,

Correct me if I'm wrong, but I think it just keeps a record of the e-mails it's
downloaded. If you run the command 'UIDL' on a telnet session into a POP server,
you will get the Unique ID for every e-mail in your inbox. All Outlook does is
compare this to the list of e-mails it knows it's downloaded, and then download
the one's it doesn't have a record on. At least something like that anyway.

It's also why if Outlook or the computer crash in the middle of a download of
e-mails, it'll download 'em again (As it's lost the list! :( ).

Hope that helps.


Jonathan Wright..



-- 
PHP General Mailing List (http://www.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] inserting into MCIS Ldap....!!

2001-05-14 Thread Manoj Mishra

 
Hi !!

Sorry to bother you...!!

Will you please mind helping me in Adding attribute value using
PHP with MCIS LDAP.

I am able to connect to the MCIS LDAP,
I am able to bind it to MCIS LDAP,
But I am not able to insert attributes into MCIS LDAP.

Would you mind helping me in this regard.?

Thanks.!

Manoj



RE: [PHP] validate form with javascript

2001-05-14 Thread Sandeep Hundal

doh! forgot to add, you need to put this in your form tage as well :
name=formname onSubmit=return formCheck()


regards

/sunny

-Original Message-
From: Sandeep Hundal [mailto:[EMAIL PROTECTED]]
Sent: 14 May 2001 10:43
To: 'Meir Kriheli - MKsoft'; Chris Mason; [EMAIL PROTECTED]
Subject: RE: [PHP] validate form with javascript


here's one that i use along with my forms you can ofcourse expand it to
include all forms as long as you change the input names too

hapy coding :)

/sunny



script language=JavaScript
transmitted = 0;
function formCheck() {
if (document.formname.inputname.value == ) {
   alert(You need to enter an email address!);
   document.formname.inputname.focus();
   return false;
}
}
/script


-Original Message-
From: Meir Kriheli - MKsoft [mailto:[EMAIL PROTECTED]]
Sent: 14 May 2001 11:42
To: Chris Mason; [EMAIL PROTECTED]
Subject: Re: [PHP] validate form with javascript


You can try the forms class from Manuel Lemos, which handles
this and more.

For more details:
http://phpclasses.upperdesign.com/browse.html/package/1


--
Meir Kriheli
MKsoft computer systems

  'There's someone in my head but it's not me - Pink Floyd
- Original Message -
From: Chris Mason [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 2:46 AM
Subject: [PHP] validate form with javascript


 I have a form in which I validate the email address using a php function
 then alert the operson if the email address is not correct. However, I
would
 like to pop up an alert with javascript if the email field is left blank.
I
 am using the function below but it down't work with php, probably works
 great with a cgi.

 Does anyone have a better way to do this?

 Chris Mason
 Code:
 in the head

 function validForm(replyForm)
 {
 if(replyForm.email.value==\\){
 alert(\You must enter an email address\)
 replyform.email.value.focus()
 return false
 }
 return true
 }


 in the form:
 FORM  onSubmit=\return validForm(this)\ METHOD=\POST\
 ACTION=\reserve.php3?action=send\ ENCTYPE=\x-www-form-urlencoded\
 table
 TR CLASS=\$c\ TD CLASS=\$c\E-Mail /TD TD COLSPAN=\$i\INPUT
 TYPE=\text\ NAME=\email\ VALUE=\$email\ SIZE=\50\/TD/TR

 /table
 /form
 )



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

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

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




Re: [PHP] How can PHP 3.0.12 recognize semicolons as var delimiters in URL?

2001-05-14 Thread Christian Capito

on Monday 14 May 2001 09:59, Christian Capito quoth:

 How can I get php to correctly recognise the semicolons? Semicolons
 between variables are supposed to be valid HTTP links.

I just would like to let you all know that I have been able to solve the 
problem. I have put following entry into the .htaccess file in the directory

php3_arg_separator  ;  

And now it works!

chris capito

-- 
PHP General Mailing List (http://www.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] Online HTML Editors

2001-05-14 Thread MATTHEW BOULTER

Heya guys sorry to be posting on a PHP mailing list but it's the only one
I'm subscribed to.
For my latest project we're trying to do away with having to teach some of
our (less technically-minded) staff HTML coding.

But we still need them to be able to edit content out of a MySQL dbase. To
achieve this we'd like to employ the use of a HTML
editor (loaded with the content out of a dbase - that's easy). With the
editor completely run through a web interface and *preferably*
doesn't allow the people access to HTML code.

Now I know that's a tall order so I'd settle for anyone out there to let me
know any suggestions of completely online web editors
(with or without HTML code access).

Thanks in advance crew!
---
 Matthew M. Boulter
 MB Productions, Pty Ltd.
 Brisbane, Queensland, Australia
 m: 0414-912-501
 e: [EMAIL PROTECTED]
 icq: 14626936
---




[PHP] imap_uid()

2001-05-14 Thread Mattias Segerdahl

Hi,

I was wondering if umap_uid() is really functioning as it should, or if I'm
mistaken and using the function for the wrong purpose, I would like to
retrieve the Unique ID's from a pop server, sorta like using UIDL when
telneting to the server, but when I do, imap_uid() i get a sequencial
number, starting from 1, instead of numbers I want, like, 3afffb530001,
etc. etc.

Does anybody know why?

// Mattias


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




[PHP] Re: One database, different forms

2001-05-14 Thread Adrian D'Costa

Hi,

I ask a similar question but did not get a reply.  I figured out a
way.  The only thing I do is use one form and four tables.

I build the sql statement on the fly.

From the from I have a hidden field that will be passed on to the php
script.  Based on that variable I select the table.  You can see a sample
of it on vvmm.net/search.php3

$searchstmt = select ;

switch ($vsearch) {
case z:
//  this exec only if no choice is selected.
$searchStmt .= ;
break;

case c:
//  Select vvmmdb table.  Catalog Choice
$searchStmt .= city.city as destinazione, vvmmdb.days,
vvmmdb.periodo, vvmmdb.vitofferta, vvmmdb.curr1 as curr2, vvmmdb.url,
vvmmdb.stars, vvmmdb.club, vvmmdb.tcode from vvmmdb,city where ;
// blah blah
}

// Check if destinazione has been entered
if ($dest) {
switch ($vsearch) {
case z:
  $searchStmt .= ;
break;
case c:
//  Select vvmmdb table.  Catalog Choice
$searchStmt .= vvmmdb.cityid=$citycode and ;
$csearchStmt .= vvmmdb.contid=$countrycode and ;
break;

// more case statements
}

I have a whole script about 800 lines.  If you need it I will send it.  In
fact I sent this script earlier.  I finally end it with:

$stmt = substr($searchStmt, 0, strlen($searchStmt)-4);
$stmt1 = substr($searchStmt1, 0, strlen($searchStmt1)-4);

Since I do not know which options the viewer is selecting I use the above
to remove the  and at the end of the statement.

It works for me.  

Adrian



On Sun, 13 May 2001, midget2000x wrote:

 I am writing a PHP application that will operate on a MySQL database.  There
 will be 4 types of forms (like catalog request, info request, etc.) calling
 the code which writes the data to the database.
 
 Since the variable names on the forms will equal the MySQL column names (as they
 should), I am wondering if there is a way for me to create my SQL statements on
 the fly so that only data passed is written.  Otherwise I'll have to create 8
 types of SQL statements...INSERT (if the record, keyed by e-mail address,
 doesn't exist), and UPDATE (if the record does exist) for all 4 forms.
 
 For example, on my add to mailing list form, only the e-mail address is
 collected.  I'd like the PHP to recognize that only the 'email' field is passed
 and create the SQL statement that only writes the e-mail to the database.
 
 Any ideas greatly appreciated!
 
 Thanks,
 
 Rory
 
  --  ---
 providing the finest in midget technology
 



-- 
PHP General Mailing List (http://www.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] time getdate GMT

2001-05-14 Thread Johannes Schmiderer

Hi,

I'm new to PHP. I want to have the GMT Time in extra values (for instance a
array with year, mon, day, hour, )
The best way I've found is:

  $idtGMTime = time() - date(Z);
  $aGMTime = getdate($idtGMTime);

Any other suggestions?
Why isn't there a function like getgmdate() (as gmtime() in Perl).

Note: PHP 4.0.4 Win32 CGI returns a wrong sign for date(Z). At 4.0.5 it's
ok. 4.0.4pl1 mod_PHP is correct, too.

Hannes Schmiderer





-- 
PHP General Mailing List (http://www.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] PDFLib and php 4.0.5

2001-05-14 Thread Geir Eivind Mork

After a great deal of swear words, preassure from my boss and numberous tries I 
now cry out for help. Can anyone compile a howto on installing pdflib so tha 
tit works with php 4.0.5 ? I've tried so many times and neither me or our 
sysadmin can manage to make php understand that I really need to get pdflib and 
php working together. It's not only giving me headache, it's a real pain. 

to compile everything else into or make php use is a like running a hot knife 
through butter but this really ticks me off.

-- 
 php developer / CoreTrek AS| transvestite, n.:  Someone who likes to 
 Sandnes / Rogaland / Norway| eat, drink, and be Mary. 
 web: http://www.moijk.net/ | 

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




[PHP] Php Newbie

2001-05-14 Thread Heidi Belal

Hi all,
I'm trying to learn/use php to develope website.  I
have downloaded the installable version from php.net
and installed it.  I'm using win2k and iis web server.
 And now i have a folder c:/php with the stuff it
installed.  How do i check that this installation
works?
i created a helloworld php file and put it in my
inetpub/wwwroot/php folder and then tried to display
it in the browser but all i saw was my html code.  
Can someone help please?!
Thanks,
Heidi

=
Heidi Belal
ICQ# 32127109
http://m3.easyspace.com/hmbelal

A bus stops at a bus station.
A train stops at a train station.  On my desk
I have a work station...

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

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




Re: [PHP] PHP: Variables in TITLE

2001-05-14 Thread Geir Eivind Mork

Tarrant Costelloe wrote:

 I have a log in script written in PHP4 which accesses a secure server. Once
 entered I want the the secure page to hold the users name (from variable) in
 the TITLE header  Something along the lines of this:
 title$name is logged in/title
 Obiously I have tried that with no luck, anyone got any ideas?

title?=$name? is logged in/title

?
-- 
 php developer / CoreTrek AS| Tell a man there are 300 billion stars
 Sandnes / Rogaland / Norway| in the universe and he'll believe you.
 web: http://www.moijk.net/ | Tell him a bench has wet paint on it and

-- 
PHP General Mailing List (http://www.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] How to change value of input on form from iframe?

2001-05-14 Thread Dezider Góra

I'm having a big problem.
I've created bound combo's page, that works. When user selects a value
from first combo, second combo in IFRAME is requeried and shows only
corresponding values.
Now I need to get the value from the second combo back to the main form.

I'm trying all javasrcipt combinations that come to my mind, but with no
succes.
Can PLEASE anybody show me the correct syntax?
tia
Dezider.

the main page:

HEAD
?
echo SCRIPT LANGUAGE=\JAVASCRIPT\;
echo function requery(country_id);
echo {;
echo document.all.operator.src=\getoperators.php?id=\ + country_id;;

echo };
echo /SCRIPT;
?
/HEAD
BODY
.
.
.
TD WIDTH=150BOperátor/B/TD
TD:/TD
TDIFRAME name=operator id=operator
SRC=getoperators.php FRAMEBORDER=NO SCROLLING=NO HEIGHT=22
WIDTH=200/IFRAME/td
/TR
TR
TD COLSPAN=3
INPUT TYPE=HIDDEN NAME=operatorid id=operatorid
VALUE=0
input type=SUBMIT value=Send
/td
 /TR

getoperators.php is:

HTML
HEAD
SCRIPT language=Javascript
function savevalue(oper_id)
{
 alert (oper_id)
 document.forms[newphone].operatorid.value=oper_id;

PLEASE how to correct this?
}
/SCRIPT
/HEAD
?
include ../../include/data_mysql.php;
$objData = new mysql_db;
$objData-init();
$sqlstring = select * from cell_operators where country = $id;
$obj_str = SELECT NAME=\operid\ TABINDEX=\1\ SIZE=\1\
style=\position: absolute; top: 0px; left: 0px\
onChange=\savevalue(this.value)\OPTION VALUE=\0\nie je/OPTION;

if ( $objData-query($sqlstring) ):
# Create a list from results
while ( $objData-movenext() == False ){
$obj_str .= OPTION VALUE=\ . $objData-value( id ) .
\ . $objData-value( cell_prefix ) . ' - ' . $objData-value(
description ) . /OPTION;
}
endif;
$obj_str .= /SELECT;
echo $obj_str;
?


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




Re: [PHP] Only have one session per user?

2001-05-14 Thread Jason Stechschulte

On Fri, May 11, 2001 at 10:22:15PM +0200, Christian Marschalek wrote:
 Can I only have one session per user / internet explorer? Or is it 
 possible to seperate sessions let's say from script to script?

Are you asking if you can have more than one session for one user running
multiple instances of the same web browser?  IIRC, this will only work
if you are not using cookies for your sessions.  

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
I surely do hope that's a syntax error.
 -- Larry Wall in [EMAIL PROTECTED]

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




Re: [PHP] How to change value of input on form from iframe?

2001-05-14 Thread elias

Hi!
Never worked with IFRAMEs nor sure how i can access their forms with
JavaScript? maybe it's like: framename.document.formane.field ? anyway

As i understand:
* Main form have Combo1 that when it's selection is changed then
IFRAME.Combo2 is rebuilt right?
I see you set your frame source to myframe.php?id=id_from_combo1
Now when the main page is reloaded you must have a variable called $id too,

So basically as the Combo1 have option and you need to position the last
one before the form was posted then make use again from the $id variable.
like for example:
after the main form has been loaded, generate this script:
script
  document.mainform.combo1.selectedIndex = ?=$id?;
/script

This was an example
Hope i help a little.

-elias

Dezider Góra [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm having a big problem.
 I've created bound combo's page, that works. When user selects a value
 from first combo, second combo in IFRAME is requeried and shows only
 corresponding values.
 Now I need to get the value from the second combo back to the main form.

 I'm trying all javasrcipt combinations that come to my mind, but with no
 succes.
 Can PLEASE anybody show me the correct syntax?
 tia
 Dezider.

 the main page:

 HEAD
 ?
 echo SCRIPT LANGUAGE=\JAVASCRIPT\;
 echo function requery(country_id);
 echo {;
 echo document.all.operator.src=\getoperators.php?id=\ + country_id;;

 echo };
 echo /SCRIPT;
 ?
 /HEAD
 BODY
 .
 .
 .
 TD WIDTH=150BOperátor/B/TD
 TD:/TD
 TDIFRAME name=operator id=operator
 SRC=getoperators.php FRAMEBORDER=NO SCROLLING=NO HEIGHT=22
 WIDTH=200/IFRAME/td
 /TR
 TR
 TD COLSPAN=3
 INPUT TYPE=HIDDEN NAME=operatorid id=operatorid
 VALUE=0
 input type=SUBMIT value=Send
 /td
  /TR

 getoperators.php is:

 HTML
 HEAD
 SCRIPT language=Javascript
 function savevalue(oper_id)
 {
  alert (oper_id)
  document.forms[newphone].operatorid.value=oper_id;
 
 PLEASE how to correct this?
 }
 /SCRIPT
 /HEAD
 ?
 include ../../include/data_mysql.php;
 $objData = new mysql_db;
 $objData-init();
 $sqlstring = select * from cell_operators where country = $id;
 $obj_str = SELECT NAME=\operid\ TABINDEX=\1\ SIZE=\1\
 style=\position: absolute; top: 0px; left: 0px\
 onChange=\savevalue(this.value)\OPTION VALUE=\0\nie je/OPTION;

 if ( $objData-query($sqlstring) ):
 # Create a list from results
 while ( $objData-movenext() == False ){
 $obj_str .= OPTION VALUE=\ . $objData-value( id ) .
 \ . $objData-value( cell_prefix ) . ' - ' . $objData-value(
 description ) . /OPTION;
 }
 endif;
 $obj_str .= /SELECT;
 echo $obj_str;
 ?


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




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




RE: [PHP] File upload !!!!

2001-05-14 Thread Jaime Bozza

Hello,
   Is there some reason I keep getting copies of messages from the list sent
directly to me as well as the list?  I've seen one or two come by and
thought it was just someone replying wrong.  Recently though, I'm received
questions, comments, answers, etc., all regarding subjects I haven't been
involved in. :)

   I read the list all the time, so I don't think I need two copies sent to
me. G


Jaime Bozza
GeoComm International Corp.


-Original Message-
From: Kevin Williams [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 13, 2001 1:46 PM
To: [EMAIL PROTECTED]
Cc: PHP User Group; Matthias Roggendorf
Subject: Re: [PHP] File upload 


Hi,
A snippet of code could help, but I recently experienced two problems with
uploading and gaining the information.

Are you using the correct ENCTYPE for the upload, along with using POST (GET
doesn't work).
Also, if you are trying to us the information from inside a function, I had
to either globally define all of the attributes, or you could pass them to
the function.

Hope this helps

Kevin Williams

Matthias Roggendorf [EMAIL PROTECTED] wrote in message
9dmisb$bhq$[EMAIL PROTECTED]">news:9dmisb$bhq$[EMAIL PROTECTED]...
 Hi,
 sorry for asking such easy things but I really have a hard time to get
this
 to work:

 I use exactly the scripts which are given on the PHP website to upload
 files. The problem is that the variable $userfile just contains none and
 $userfile_size is 0. The rest of the variables have the right values.
 When I use a larger file it takes more time so I assume that the file is
 uploaded, but I cannot save it because I don't know the temporary
filename.

 Can anybody help me? I really need this to work.

 Thanks, Matthias



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




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




RE: [PHP] Free Database Design Program

2001-05-14 Thread Chris Mulcahy

No, then the software becomes stolen, not free.

Discussing cracking and stealing programs on a list populated with software
developers may not be wise.

Most software developers depend on the income from their software to make a
living.  Please do not support cracking on this list.

Chris

-Original Message-
From: Augusto Cesar Castoldi [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 13, 2001 3:19 PM
To: Anuradha Ratnaweera
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Free Database Design Program


The software can be really a freeware (better) or...

can be cracked..., than he becomes free.

regards,

Augusto Cesar Castoldi

On Fri, 11 May 2001, Anuradha Ratnaweera wrote:


 On Sat, 5 May 2001, Augusto Cesar Castoldi wrote:

  Anyone know a Free database Design program? I'm needing to organize my
  MySQL databases and design new databases.

 In what sence do you mean Free? Just curious;

 Anuradha


 --
 a href=http://www.bee.lk/people/anuradha/;home page/a


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



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


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




RE: [PHP] PHP: Variables in TITLE

2001-05-14 Thread Matt Schroebel

I would recommend:

title?php echo htmlspecialchars($name); ? is logged in/title

that way you won't get burned by quotes, etc ...

 From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 7:59 AM
 To: '[EMAIL PROTECTED]'
 I want the the secure page to hold the users name 
 (from variable) in
 the TITLE header  Something along the lines of this:
 
 title$name is logged in/title

-- 
PHP General Mailing List (http://www.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] RSexec() doubt

2001-05-14 Thread Felipe Moreno

Hi list members,

   I'm trying to develop a script that work like the MS jscript function
called RSexec () (Remote Script execute). During this develop, I'm having a
doubt regarding the use of that function RSexec(), cause I was reading about
it, and every reference points do use it with ASP (active server pages). My
doubt is: Anyone ever used it with PHP? Is it possible? Anyone know any
alternative function in Javascript or another solution to archive the same
effect as the RSexec() ? The scene is something like:

I have two select dropdown list boxes, the first one is MARK and the other
one is MODELS. The first contain all the MARKS...and the second is
EMPTY...waiting for the MARK to be select to query a Database and get the
results. So, when I select the MARK, the MODELS box value became WAIT... and
the query start...So, after the results arrive, the models box get all the
respective values. So, everything happen without refreshing the screen. It's
a very powerfull function...and don't work in Netscape...

Thanks for your attention! Thanks for any ideas!

Best Regards,

Felipe Moreno



-Mensagem original-
De: Chris Mulcahy [mailto:[EMAIL PROTECTED]]
Enviada em: segunda-feira, 14 de maio de 2001 10:33
Para: [EMAIL PROTECTED]
Assunto: RE: [PHP] Free Database Design Program


No, then the software becomes stolen, not free.

Discussing cracking and stealing programs on a list populated with software
developers may not be wise.

Most software developers depend on the income from their software to make a
living.  Please do not support cracking on this list.

Chris

-Original Message-
From: Augusto Cesar Castoldi [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 13, 2001 3:19 PM
To: Anuradha Ratnaweera
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Free Database Design Program


The software can be really a freeware (better) or...

can be cracked..., than he becomes free.

regards,

Augusto Cesar Castoldi

On Fri, 11 May 2001, Anuradha Ratnaweera wrote:


 On Sat, 5 May 2001, Augusto Cesar Castoldi wrote:

  Anyone know a Free database Design program? I'm needing to organize my
  MySQL databases and design new databases.

 In what sence do you mean Free? Just curious;

 Anuradha


 --
 a href=http://www.bee.lk/people/anuradha/;home page/a


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



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


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



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




Re: [PHP] One database, different forms

2001-05-14 Thread Ethan Schroeder

I use this code for dynamically creating queries almost every day.

  $column = mysql_list_fields($db,$table);
  for($i = 0; $i  mysql_num_fields($column); $i++)
  {
$value = mysql_field_name($column,$i);
$value = $$value;
$values .= '$value';
if($i != mysql_num_fields($column)-1)
  $values .= ,;
  }
  $sql = INSERT INTO $table VALUES ($values);
  mysql_query($sql);

Ethan Schroeder

- Original Message -
From: midget2000x [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 13, 2001 1:31 PM
Subject: [PHP] One database, different forms


 I am writing a PHP application that will operate on a MySQL database.
There
 will be 4 types of forms (like catalog request, info request, etc.)
calling
 the code which writes the data to the database.

 Since the variable names on the forms will equal the MySQL column names
(as they
 should), I am wondering if there is a way for me to create my SQL
statements on
 the fly so that only data passed is written.  Otherwise I'll have to
create 8
 types of SQL statements...INSERT (if the record, keyed by e-mail address,
 doesn't exist), and UPDATE (if the record does exist) for all 4 forms.

 For example, on my add to mailing list form, only the e-mail address is
 collected.  I'd like the PHP to recognize that only the 'email' field is
passed
 and create the SQL statement that only writes the e-mail to the database.

 Any ideas greatly appreciated!

 Thanks,

 Rory

  --  ---
 providing the finest in midget technology

 --
 PHP General Mailing List (http://www.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] Writing to files

2001-05-14 Thread Tarrant Costelloe

What's the most basic syntax for writing to a text file using PHP. I would
like to store some variables in one and then retrieve them a later stage...?

Taz

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




Re: [PHP] One database, different forms

2001-05-14 Thread Ethan Schroeder

Oh, here is the update code, which uses the same concepts:

  $column = mysql_list_fields($db,$table);
  for($i = 1; $i  mysql_num_fields($column); $i++)
  {
$value = mysql_field_name($column,$i);
$name = $value;
$value = $$value;
$values .= $name='$value';
if($i != mysql_num_fields($column)-1)
  $values .= ,;
  }
  $sql = UPDATE $table SET $values WHERE id='$id';
  mysql_query($sql);

And the INSERT code again for good measure:

  $column = mysql_list_fields($db,$table);
  for($i = 0; $i  mysql_num_fields($column); $i++)
  {
$value = mysql_field_name($column,$i);
$value = $$value;
$values .= '$value';
if($i != mysql_num_fields($column)-1)
  $values .= ,;
  }
  $sql = INSERT INTO $table VALUES ($values);
  mysql_query($sql);

This code relies on 2 variables being correctly set: $db is the name of the
database you are working with, and $table is the name of the table.  Other
than that what this script basically does is goes through every column in
the specified table and dynamically creates a query from the names of the
columns.  Your variable names will need to match the column names exactly or
this will insert/update null values.

- Original Message -
From: midget2000x [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, May 13, 2001 1:31 PM
Subject: [PHP] One database, different forms


 I am writing a PHP application that will operate on a MySQL database.
There
 will be 4 types of forms (like catalog request, info request, etc.)
calling
 the code which writes the data to the database.

 Since the variable names on the forms will equal the MySQL column names
(as they
 should), I am wondering if there is a way for me to create my SQL
statements on
 the fly so that only data passed is written.  Otherwise I'll have to
create 8
 types of SQL statements...INSERT (if the record, keyed by e-mail address,
 doesn't exist), and UPDATE (if the record does exist) for all 4 forms.

 For example, on my add to mailing list form, only the e-mail address is
 collected.  I'd like the PHP to recognize that only the 'email' field is
passed
 and create the SQL statement that only writes the e-mail to the database.

 Any ideas greatly appreciated!

 Thanks,

 Rory

  --  ---
 providing the finest in midget technology

 --
 PHP General Mailing List (http://www.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] Mail a form to mailbox

2001-05-14 Thread ashok a dhar

Dear friends


Please give a PHP site where i can do 
send a mail a form contents to my mailbox.

i want to use the PHP function
mail(recipient,subject,message);

Thank u very much
bapi
[EMAIL PROTECTED]



Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/

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




RE: [PHP] my query results won't clear!! :(

2001-05-14 Thread Sandeep Hundal

damn, yeah thats my problem. how do i clear out all variables then??

thanks!

/sunny

-Original Message-
From: Mark Roedel [mailto:[EMAIL PROTECTED]]
Sent: 14 May 2001 14:56
To: Sandeep Hundal; [EMAIL PROTECTED]
Subject: RE: [PHP] my query results won't clear!! :(


 -Original Message-
 From: Sandeep Hundal [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 3:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] my query results won't clear!! :(
 
 
 i'm running a select query on a table, and ihave a form right 
 underneath it, with similar names to the information selected
 in the query above.
 
 yet despite using mysql_free_results before my form starts, it
 still keeps the last result of the query 1 in memory :(
 
 are there any solutions??

It's hard to be certain of much without seeing any of your code.

My guess, though, would be that you're simply misunderstanding the
extent to which mysql_free_result() operates.

In particular, it only frees the memory associated with the result set
itself.  It does not clear out variables that you've assigned to hold
pieces of the returned data.

That is, given the following code:

$result = mysql_query('select * from table');
$mydata = mysql_fetch_array($mydata);
mysql_free_result($result);

$result should be cleared out.  $mydata, however, should be retained.

Does that match what you're experiencing?


---
Mark Roedel ([EMAIL PROTECTED])  ||  There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full.
 LeTourneau University  ||-- Henry Kissinger


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

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




Re: [PHP] Writing to files

2001-05-14 Thread Jason Stechschulte

On Mon, May 14, 2001 at 03:05:30PM +0100, Tarrant Costelloe wrote:
 What's the most basic syntax for writing to a text file using PHP. I would
 like to store some variables in one and then retrieve them a later stage...?

This will append This is pretty basic to the end of the file instead of
overwriting the file.

?php
$basic = fopen(basic.txt, a+);
fputs($basic, This is pretty basic\n);
fclose($basic);
?

It is really easy to read in the entire file into an array.  Probably
not very efficient, but will get you started quickly.

?php
$prettyBasic = file(basic.txt);
for($i = 0; $i  sizeof($prettyBasic); $i++) {
   echo $prettyBasic[$i]br;
}
?

Search the online manual for more information on these functions.

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

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
If I don't document something, it's usually either for a good reason,
or a bad reason.  In this case it's a good reason.  :-)
 -- Larry Wall in [EMAIL PROTECTED]

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




Re: [PHP] Php Newbie

2001-05-14 Thread Johannes Janson

Hi,

 i created a helloworld php file and put it in my
 inetpub/wwwroot/php folder and then tried to display
 it in the browser but all i saw was my html code.
 Can someone help please?!

You'll need to configure IIS to parse your PHP files. Use the instruction
below.
If you wonder which one to use isapi or CGI I'd say for home developement
it doesn't matter. CGI is said to be more stable but I had no problem with
the
isapi module with IIS. But anyway give it a thought to get Apache.
To test your installation just use your helloworld or create a file with
?php phpinfo(); ? in it.

hope it helps
Johannes

IIS 4.0+ (isapi):
1. Copy the php.ini-dist to your systemroot (the directory where you
installed windows), rename it to php.ini, and
edit it to fit your needs
2. Start the Microsoft Management Console or the Internet Services Manager,
located in your Control Panel
3. Click on your webserver, and select properties
4. If you don't want to perform HTTP Authentication using PHP, you can (and
should) skip this step. Under ISAPI Filters,
add a new ISAPI filter. Use PHP as the filter name, and supply a path to the
php4isapi.dll
5. Under Home Directory, click on the Configuration button. Add a new entry
to the Application Mappings. Use the path the
php4isapi.dll as the Executable, supply .php as the extension, leave Method
exclusions, blank, and check the Script engine
checkbox
6. Stop IIS completely
7. Start IIS again


IIS 4.0+ (CGI)
1. Copy the php.ini-dist to your systemroot (the directory where you
installed windows), rename it to php.ini, and
edit it to fit your needs
2. Start the Microsoft Management Console (may appear as 'Internet Services
Manager', either in your Windows NT 4.0
Option Pack branch or the Control Panel-Administrative Tools under Windows
2000).
3. Right click on your Web server node (will most probably appear as
'Default Web Server'), and select 'Properties'.
4. Under 'Home Directory', click on the 'Configuration' button. Add a new
5. entry to the Application Mappings; Use the path to php.exe as the
Executable, supply .php as the extension, leave
'Method exclusions', blank, and check the Script engine checkbox.
6. Put a .php file under your Web server's document root and check if it
works!




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




Re: [PHP] PHP's OO is bad?

2001-05-14 Thread Zef Hemel

I did some benchmark on how fast variable access is when being used through
OOP. And this difference can be up to 1,7 times as slow.

I surely hope you can speed up, right now I'm not using it because it's
slower...


Zef


Phil Driscoll [EMAIL PROTECTED] schreef in berichtnieuws
[EMAIL PROTECTED]
 On Sunday 13 May 2001 06:25, Sean Cazzell wrote:
  certainly not the signigicant slow
  down that he claims.

 guessing - haven't done any tests
 I don't know whether or not what Sterling said is true, but I think that
your
 comment that the difference in speed with a larger program would be less
is
 incorrect in view of your benchmark. Your test does so little that I would
 imagine that the bulk of the execution time is taken up just by the
 initialisation and closedown of the request (by browser, apache and php)
and
 the time taken in transit. It *could* be that the OO stuff executed many
 times more slowly than the non-OO.
 /guessing - haven't done any tests

 Cheers
 --
 Phil Driscoll

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




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




Re: [PHP] phpMyAdmin: dumping problem

2001-05-14 Thread bill

Hi Peter,

I've had similar problems.  I haven't found any easy way.  Here's how I got
around the problems.

Upgrade to the latest version of phpMyadmin.

Make sure magic_quotes is on (if it isn't, the program will warn you.)

You may need to replace a single slash \ with a double slash \\

Use phpMyadmin to upload the data.

It may require a bit of futzing but it should work.

kind regards,

bill hollett


[EMAIL PROTECTED] wrote:

 i got a 1.21 txt file worth of backup data on my HD.
 I need to get it up and running on my new mysql server asap.

 2 problems tho
 i dont have ftp or telnet access, and two phpMyAdmin always gives me a syntax
 error.. this is most likely because HTML is included in the contexs of the
 database.

 Anyone know of a compile cgi script or someting else that might help me?

 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]


-- 
PHP General Mailing List (http://www.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] installing PHP on a sun box

2001-05-14 Thread Joseph Bannon

I'm installing PHP on a sun box and when type in make and i get not
found. How can I run make if it's not found?

Thanks,

Joseph

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




RE: [PHP] installing PHP on a sun box

2001-05-14 Thread Andrew Hill

Joseph,

You should check that 'cc' is installed on your system. (try typing: cc) If
you get language optional software package not installed then you will
need to install the developer tools, including the c-compiler.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 12:41 PM
 To: PHP (E-mail)
 Subject: [PHP] installing PHP on a sun box


 I'm installing PHP on a sun box and when type in make and i get not
 found. How can I run make if it's not found?

 Thanks,

 Joseph

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




-- 
PHP General Mailing List (http://www.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] achive style message center

2001-05-14 Thread shaun

 i was wondering if anyone has or knows were i can find
an archive style message system much like the php support archive.

im looking for something to create a forum were people can chat and interact
without the need of real time
preferably the archive should be searchable

if anyone could help i would be very appreciative.
if you need more information just ask



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




RE: [PHP] achive style message center

2001-05-14 Thread Sandeep Hundal

why not just use a message board?


-Original Message-
From: shaun [mailto:[EMAIL PROTECTED]]
Sent: 14 May 2001 18:15
To: [EMAIL PROTECTED]
Subject: [PHP] achive style message center


 i was wondering if anyone has or knows were i can find
an archive style message system much like the php support archive.

im looking for something to create a forum were people can chat and interact
without the need of real time
preferably the archive should be searchable

if anyone could help i would be very appreciative.
if you need more information just ask



-- 
PHP General Mailing List (http://www.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] Input buffer overflow with Apache

2001-05-14 Thread Geoff Caplan

Hi

I am hoping someone on the list can save me from the grief of an OS
re-install.

I carelessly allowed the disk on my Red Hat 6.2 server to fill up. I have
fixed the damage, apart from Apache. Here is the problem

When the disk was full, Apache keeled over logging the error:

input buffer overflow, can't enlarge buffer because scanner uses REJECT.

It didn't recorver when I created some disk space. So I have deleted all
Apache files and done a rebuild from scratch. First I tried a basic build
which started ok. But when I compiled in the PHP module I have been getting
the same error as before, with Apache refusing to start.

Can't find anything to help on the web, so I would very much appreciate some
advice

Geoff Caplan


-- 
PHP General Mailing List (http://www.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] MIME Decoding of a string

2001-05-14 Thread Jeroen Geusebroek

Hi Guys,

I've been struggeling with this for a while but can't seem to find
any code that will decode a string MIME encoded. I found one class
but it also didn't do what i want.

Coding this myself is probably WAY above my head ;P

ie. i have this string:

--=_NextPart_000_002D_01C0DBE5.49F28C40
Content-Type: text/plain;
charset=Windows-1252
Content-Transfer-Encoding: quoted-printable

yadayadayada =
yadayadayada

This is the body of the message

--=_NextPart_000_002D_01C0DBE5.49F28C40--

The string is the body of an email message thats taken out of a database.
If it's also necassary to include the headers of the message, that's no
problem
since i also store that in the database.

The reason i need this, is because i am creating a message archive similair
to Geocrawler and MARC and it's quite irratating to not be able to decode
messages
when they are mime encoded.

Thanks for the advice,

Jeroen Geusebroek


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




RE: [PHP] PHP priviledges

2001-05-14 Thread bd

Hello,

I have similar concerns with the host I'm trying out right now - though
they're running Linux/Apache.  My problem is with lack of security with
shell access (i.e. access to other client's directories and key server
files) and apparently lax monitoring of its privacy policies.  I'm not a sys
admin so I don't know exactly what is achievable, but I was surprised by the
loose config of the server I'm on.

I'm looking for a Virtual-Host provider running PHP/MySQL who has mastered
the concept of providing a secure, shared environment to it's clients -
including ssh/scp access restricted to only what's owned by me, secured
administration tools, secured email communication with its clients, and
complete logical and physical security of the server and data center.  Does
anyone have a recommendation?  I've seen providers that address these issues
for dedicated server configs - but not virtual server configs.

Best Regards,
bd

-Original Message-
From: José León Serna [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 6:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP priviledges


Hello:
In my host, the php is installed in a way that I have access from a php
script to all the webs on that server, (there are almost 60) and I can
delete/copy any file of other servers. I don't like this because other user
of that server can do the same as I. I have contacted with my host and they
doesn't know how to prevent php/IIS to have access to other directories on
the server, Is this possible?

Best Regards

Visual PHP Studio, RAD development with PHP
http://www.visualphpstudio.f2s.com



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


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




Re: [PHP] MIME Decoding of a string

2001-05-14 Thread mark

Jeroen Geusebroek [EMAIL PROTECTED] wrote:

 The reason i need this, is because i am creating a message archive similair
 to Geocrawler and MARC and it's quite irratating to not be able to decode
 messages
 when they are mime encoded.

Take a look at my project: http://www.webgadgets.com/phpost

It's a webmail app but it includes code to fully parse MIME messages,
including quoted printable encoding, etc.  It uses no third party
libraries or classes, only functions that are native to PHP.

I am about to release 1.06 (tonight likely) which greatly improves the
MIME handling (seems to handle MIME better than Eudora or Outlook now,
especially nested multipart sections).

Mark


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




RE: [PHP] achive style message center

2001-05-14 Thread Alok K. Dhir

If you're looking primarily for mailing list software with web
archiving, look no further than Mailman (www.list.org).  If you're
looking for web discussion software, then there's tons of good, php
based, web discussion forum software out there, a lot of it GPLed.
Search freshmeat.net.

What I have yet to see is a unified software package which combines all
the features of mailing list software with a web discussion system -
i.e. true two way interaction support for any boards from either
interface (email / web).  

Al

 -Original Message-
 From: 
 [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED].
net] On Behalf Of shaun
 Sent: Monday, May 14, 2001 1:15 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] achive style message center
 
 
  i was wondering if anyone has or knows were i can find
 an archive style message system much like the php support archive.
 
 im looking for something to create a forum were people can 
 chat and interact without the need of real time preferably 
 the archive should be searchable
 
 if anyone could help i would be very appreciative.
 if you need more information just ask
 
 
 
 -- 
 PHP General Mailing List (http://www.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] use of copy and ftp to get my permissions on file

2001-05-14 Thread Dennis Gearon

Does this sound like the right idea for editing a file online and
keeping the permissions of my user account:


open(read) file in include dir from script
read/parse/modify into local variable
close file

copy(pres_ver_file, php's_tmp_dir/old_ver_file);
create ( php's_tmp_dir/original_name_new_version, 'w');
write contents to new file.
close file

ftp( php's_tmp_dir/new_version, original_directory/over_top_of_original
);
ftp( php's_tmp_dir/old_version, original_directory/old_version );

delete  (php's_tmp_dir/new_version)
delete  (php's_tmp_dir/old_version)


-
how do I get the name of the temp directory that PHP is configured for?
-

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




RE: [PHP] writing updateable code

2001-05-14 Thread scott [gts]

i'd like to know if anyone's written anything to perform anything
of this nature also...

if not, i'll take a crack at it.

shouldnt be too hard to get a simple Updater script
to check for new versions and update local files
with newer ones 

 -Original Message-
 From: elias [mailto:[EMAIL PROTECTED]]
 Subject: Re: [PHP] writing updateable code
 
 Should be actually hard...
 Write Update.php file that connects to your web-site and reads your
 version-information file and then read version information site from the
 hoster site and check if you have a new version, if so then the update.php
 will again query the version-info file and get new files lists and update
 the hoster (by copying new files from your server to their server)
 You can make whatever you want!
 
 I mean by the Hoster (The one who's hosting your script, let's say the
 update.php)
 
 -elias
 http://www.eassoft.cjb.net
 
 Scott Mebberson [EMAIL PROTECTED] wrote in message
 9dnr1o$gv5$[EMAIL PROTECTED]">news:9dnr1o$gv5$[EMAIL PROTECTED]...
  Has anybody ever written some code for a product and want it to be able to
  update itself... and made it look for updates? Does anybody have some
 ideas
  or information on this?
 
  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]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




Re: [PHP] MIME Decoding of a string

2001-05-14 Thread Jeroen Geusebroek

Mark Wrote:

Take a look at my project: http://www.webgadgets.com/phpost

It's a webmail app but it includes code to fully parse MIME messages,
including quoted printable encoding, etc.  It uses no third party
libraries or classes, only functions that are native to PHP.

I am about to release 1.06 (tonight likely) which greatly improves the
MIME handling (seems to handle MIME better than Eudora or Outlook now,
especially nested multipart sections).

Sounds good ;) I saw you release your version 2 days ago on freshmeat and
when i tried it, it didn't handle mime that great yet.

Hopefully the new version will be better! Thanks for contributing to the 
open source community. (My project will also be open source, but first it
has to be stable ;)

Jeroen Geusebroek

-- 
PHP General Mailing List (http://www.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] Easily Making Post Vars Session Vars

2001-05-14 Thread Jason

Hi,

I realize you cannot override session variables through GET or POST for
security reasons. I have a complex multipage form that I would like to store
in a session for insertion in the database when the last step is completed.
The form field names are arrays, so they can be listed and inserted quite
easily (ie-custinfo[name], custinfo[state], etc).

So, is there anyway to assign $HTTP_POST_VARS to a session array holding the
same values without assign each variable one by one (there are a ton of
variables).

I tried doing something like this and it didn't seem to work:
session_start();
if(!isset($custinfo)) {
  session_register(custinfo);
  $custinfo = array();
}
$custinfo = $HTTP_POST_VARS;


So, it doesn't appear it will be that easy. Anybody have any hints on doing
this?

Thanks!


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




Re: [PHP] disable compiler flag --enable-trans-sid at runtime

2001-05-14 Thread Holger Bhnke

 php_flag session.use_trans_sid off
 That may not be the correct syntax, but it should be close.

it is correct!
works perfectly

thanx Kirk


Johnson, Kirk [EMAIL PROTECTED] schrieb im Newsbeitrag 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have not done this, but this is what I would try. There is a setting in
php.ini, session.use_trans_sid, which controls whether PHP appends the
session ID. Set up an .htaccess file with something like this in it:

php_flag session.use_trans_sid off

That may not be the correct syntax, but it should be close.

Good luck!

Kirk

 -Original Message-
 From: Holger Böhnke [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 6:01 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] disable compiler flag --enable-trans-sid at runtime
 
 
 Hi All,
 
 is it possible to disable the compiler flag 
 
 --enable-trans-sid
 
 at runtime?

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



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




Re: [PHP] phpjobs.com

2001-05-14 Thread Phillip Bow

http://jobsearch.monster.com/jobsearch.asp?cy=USbrd=1lid=fn=6fn=660fn=5
54q=php

Good luck in your search.
--
phill

Jack Dempsey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 anyone know what the deal with it is? i'm trying to find some work for
 the summer (been REAL hard) and noticed that the site is there,
 although not really...

 -jack

 --
 PHP General Mailing List (http://www.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] session VS scope

2001-05-14 Thread Steve

I have just recently began pulling together some of the project work I
have done to build a little library of tools.  In doing so I have made a
number of functions from what used to be separate include files... yes,
I'm transitioning from linear programming to that new-fangled functional
programming style. grin

One of the components I was working on today was a user login tool. 
Unfortunately I re-aquainted myself with the problems that I fought with
but forgot about when I wrote this code months ago.  [my solution months
ago was to not use functions or classes in this code, which was
cumbersome and ugly]

The following is from
http://www.php.net/manual/en/function.session-register.php and explains
it well:

- - - -
[EMAIL PROTECTED]
03-Jan-2001 01:37 
Some note about session_register() scope. I ecountered problems while
trying to register varible inside a function in one of my classes in my
web application. Apparently this function can only be properly called
from the scope of the page, not from some functions on that page: 

[...snip...]
- - - -
 
To paraphrase, session_register() does not follow proper scoping rules
when identifying it's parameters.  I find this to be an odd language
design decision because the developers created funtions and classes
which conform to a satisfactory scoping policy but when they added
session vars, they did not make session vars use that scoping policy at
all.  Instead the session_register function looks at the $GLOBALS, and
matches from this 'scope' only.  That seems like a problem to me, but it
has been around so long that I fear it is now a 'feature' of the
language.  I have trouble fathoming that this would indeed have been an
unintentional result, so I am not considering it a 'bug'.

Can someone explain the logic behind this to me?  I don't see why
session_register() behaves as it does.  I should not need to globalize
my local variables in order to register them with the session.

I even thought of a way to 'fix' this without breaking everyone's legacy
work, I think.  We have all these associative arrays for grouping
variables (scoping them, if you will) in $GLOBALS, $HTTP_POST_VARS,
$HTTP_GET_VARS, $HTTP_SESSION_VARS, etc... why not make another global
associative array $LOCAL which contains variables with strictly local
scope, whatever that scope may be (and for which we never need to write
global $LOCAL).  No small task, but it would provide another way to
explicitly work in a local_only scope in the context of conflicting
names, etc.

Then I *ought* to be able to do something like the following to register
the session variable:  $val

?PHP
start_session();

function defoo($bar)
// this is a TOY example, but the principle holds.  Some data, available
in a function, needs 
// to be registered. It is inappropriate to make $val a global, not to
mention poor technique.
{
  $val = $bar - 1;
  session_register($LOCALS['val']);
}
?

Can anyone point at this and tell me why it SHOULD NOT happen?  Does
anyone have an elegant work-around for me that negates the need for
$LOCALS?

If not, I would feel OK passing this off towards the development team
and working with them on it to improve the language.

please CC your reply to: nepolon AT worlddomination DOT net

thanks,
--Steve

-- 
PHP General Mailing List (http://www.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] [Win32,PHP/4.0.5] Problem with session

2001-05-14 Thread Christian Ribeaud

Hi,

I would like to know what is wrong with the code below.
The following code will be included on every page with the include
command.
The variable $language does not seem to be registered at all. it should
be registered
again on every page. Why this? On the php.ini register_globals is off
and session.auto_start is 0.
Any help would be gratefully appreciated. Thanks and have a nice day,

christian

 code 
session_name(Apache);
if (apache_note(Cookie)) {
session_id(apache_note(Cookie));
}
session_start();
if (session_is_registered(language)) {
$language = ($HTTP_GET_VARS[language])?
$HTTP_GET_VARS[language]:
$HTTP_SESSION_VARS[language];
} else {
session_register(language);
$language = $HTTP_GET_VARS[language]?
$HTTP_GET_VARS[language]:
d;
}
$HTTP_SESSION_VARS[language] = $language;
 code 


-- 
PHP General Mailing List (http://www.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] mail() is not supported in this PHP build ???

2001-05-14 Thread Jan PAVLÍK

Hi,
I have really problem with %SUBJ%, what I do bad, that isn't work
function mail()

THANX from Czech Republic :))

--
Jan PAVLIK, webmaster

--
CASHMAIL s.r.o.
[EMAIL PROTECTED]
0608/344 010
ICQ 6611951

Motto: Neco nefunguje? Zkuste nejdrive news://news.nixnet.cz/



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




RE: [PHP] [Win32,PHP/4.0.5] Problem with session

2001-05-14 Thread Johnson, Kirk

With register_globals off, ordinary GLOBAL variables can't be registered, so
the line session_register(language); isn't doing anything. Access all
registered variables through $HTTP_SESSION_VARS only.

Kirk

 -Original Message-
 From: Christian Ribeaud [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 1:38 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] [Win32,PHP/4.0.5] Problem with session
 
 
 Hi,
 
 I would like to know what is wrong with the code below.
 The following code will be included on every page with the include
 command.
 The variable $language does not seem to be registered at all. 
 it should
 be registered
 again on every page. Why this? On the php.ini 
 register_globals is off
 and session.auto_start is 0.
 Any help would be gratefully appreciated. Thanks and have a nice day,
 
 christian
 
  code 
 session_name(Apache);
 if (apache_note(Cookie)) {
 session_id(apache_note(Cookie));
 }
 session_start();
 if (session_is_registered(language)) {
 $language = ($HTTP_GET_VARS[language])?
 $HTTP_GET_VARS[language]:
 $HTTP_SESSION_VARS[language];
 } else {
 session_register(language);
 $language = $HTTP_GET_VARS[language]?
 $HTTP_GET_VARS[language]:
 d;
 }
 $HTTP_SESSION_VARS[language] = $language;
  code 

-- 
PHP General Mailing List (http://www.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] Wrong ReplicationID from MS Access

2001-05-14 Thread Adriana Matiaskova

Has anybody met with this problem?

I use MS Access 7.0 database through ODBC, Apache 1.3.11 and PHP 4.0.4pl on 
Windows 95. When I use SELECT query from database, I get for Replication ID 
(Automatic number) field something like ' 7~Yó¹Ò.“€Hë-×' instead of 
'47499E92-D96B-11D2-B727-008048EB2DD7' which should be there.

On another computer I had the same problem (PHP 4.0b3, Apache 1.3.11), but 
suddenly I noticed, it's OK already, and I don't know why. Maybe I have 
installed something, I don't know.
Is there some error in configuration? Can anyone help?
Thanks.


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




RE: [PHP] Easily Making Post Vars Session Vars

2001-05-14 Thread Johnson, Kirk

This isn't quite what you are asking, but maybe it will be of help. Use the
loop below to create and assign GLOBAL versions of the $HTTP_POST_VARS:;

reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
  $GLOBALS[$key] = $val;
}

Kirk

 -Original Message-
 From: Jason [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 1:32 PM
 To: Php-General
 Subject: [PHP] Easily Making Post Vars Session Vars
 
 
 Hi,
 
 So, is there anyway to assign $HTTP_POST_VARS to a session 
 array holding the
 same values without assign each variable one by one (there 
 are a ton of
 variables).
 [snip]
 I tried doing something like this and it didn't seem to work:
 session_start();
 if(!isset($custinfo)) {
   session_register(custinfo);
   $custinfo = array();
 }
 $custinfo = $HTTP_POST_VARS;
 
 
 So, it doesn't appear it will be that easy. Anybody have any 
 hints on doing
 this?
 
 Thanks!

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




RE: [PHP] Easily Making Post Vars Session Vars

2001-05-14 Thread Jason

Ok, I see where that's going.

I actually was a bit off in my first posting.

The form field names are a multi-dimesional array. The goal it to make
writing all of the info to the db a breeze.

ie- name=cust[personal][phone]

and name=cust[history][interests]

etc etc

lets also say
$cust[history][interests] = tv;

The reasoning behind it is the data does not need to be stored in a
consistent or usable (just readable) manner. so... say history is a table,
and has a column name details.

I would cycle through the array two levels deep on the first associative
history, i suppose with nested while(list = each).

The two values I want to return from that array would be the 2nd associative
key name and the value, in this case interests and tv.

SO... back on track... how would i utilize that loop below to get my
multi-dimesion form variables into a session. Once I get it into a session I
think I can break it up no problem.

Thanks.

 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 1:07 PM
 To: Php-General
 Subject: RE: [PHP] Easily Making Post Vars Session Vars


 This isn't quite what you are asking, but maybe it will be of
 help. Use the
 loop below to create and assign GLOBAL versions of the $HTTP_POST_VARS:;

 reset($HTTP_POST_VARS);
 while(list($key, $val) = each($HTTP_POST_VARS)) {
   $GLOBALS[$key] = $val;
 }

 Kirk

  -Original Message-
  From: Jason [mailto:[EMAIL PROTECTED]]
  Sent: Monday, May 14, 2001 1:32 PM
  To: Php-General
  Subject: [PHP] Easily Making Post Vars Session Vars
 
 
  Hi,
 
  So, is there anyway to assign $HTTP_POST_VARS to a session
  array holding the
  same values without assign each variable one by one (there
  are a ton of
  variables).
  [snip]
  I tried doing something like this and it didn't seem to work:
  session_start();
  if(!isset($custinfo)) {
session_register(custinfo);
$custinfo = array();
  }
  $custinfo = $HTTP_POST_VARS;
 
 
  So, it doesn't appear it will be that easy. Anybody have any
  hints on doing
  this?
 
  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]



-- 
PHP General Mailing List (http://www.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] Passing vars between functions (with POSTs)

2001-05-14 Thread Miguel Ribeiro

Hi,

I'm struggling to pass from 3 functions (and one of them have a html form
POST) one simple variable called $login.

Once in the function (that have form with POST) is calling a php3 without
passing the $login (like: common.php3login='someone') and since the next
function doesn't have any relation with this one (doesn't receive any value
by return) but requires the same variable ($login).

My question and great doubt is:

How can I share $login in several functions... without use or change
(because I don't have access) the PHP configuration environment...

I believe that this could be solve with register_globals var but I don't
know how to do it.

Best Regards,
Miguel



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




RE: [PHP] Easily Making Post Vars Session Vars

2001-05-14 Thread Johnson, Kirk

Before we get too carried away here :), what didn't work with your original
solution? I would have guessed that it would work. What was the error?

But, here's some more with the loop, definitely not tested:

reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
if(is_array($val)) {
if(count($val)  0) {
reset($val);
while(list($key2,$val2)=each($val)) {
  $GLOBALS[$key][$key2] = $val2;
}
}
}
}

 -Original Message-
 From: Jason [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 2:40 PM
 To: Johnson, Kirk; Php-General
 Subject: RE: [PHP] Easily Making Post Vars Session Vars
 
 
 Ok, I see where that's going.
 
 I actually was a bit off in my first posting.
 
 The form field names are a multi-dimesional array. The goal it to make
 writing all of the info to the db a breeze.
 
 ie- name=cust[personal][phone]
 
 and name=cust[history][interests]
 
 etc etc
 
 lets also say
 $cust[history][interests] = tv;
 
 The reasoning behind it is the data does not need to be stored in a
 consistent or usable (just readable) manner. so... say 
 history is a table,
 and has a column name details.
 
 I would cycle through the array two levels deep on the first 
 associative
 history, i suppose with nested while(list = each).
 
 The two values I want to return from that array would be the 
 2nd associative
 key name and the value, in this case interests and tv.
 
 SO... back on track... how would i utilize that loop below to get my
 multi-dimesion form variables into a session. Once I get it 
 into a session I
 think I can break it up no problem.
 
 Thanks.
 
  -Original Message-
  From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
  Sent: Monday, May 14, 2001 1:07 PM
  To: Php-General
  Subject: RE: [PHP] Easily Making Post Vars Session Vars
 
 
  This isn't quite what you are asking, but maybe it will be of
  help. Use the
  loop below to create and assign GLOBAL versions of the 
 $HTTP_POST_VARS:;
 
  reset($HTTP_POST_VARS);
  while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
  }
 
  Kirk
 
   -Original Message-
   From: Jason [mailto:[EMAIL PROTECTED]]
   Sent: Monday, May 14, 2001 1:32 PM
   To: Php-General
   Subject: [PHP] Easily Making Post Vars Session Vars
  
  
   Hi,
  
   So, is there anyway to assign $HTTP_POST_VARS to a session
   array holding the
   same values without assign each variable one by one (there
   are a ton of
   variables).
   [snip]
   I tried doing something like this and it didn't seem to work:
   session_start();
   if(!isset($custinfo)) {
 session_register(custinfo);
 $custinfo = array();
   }
   $custinfo = $HTTP_POST_VARS;
  
  
   So, it doesn't appear it will be that easy. Anybody have any
   hints on doing
   this?
  
   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]
 
 

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




Re: [PHP] HallMark uses PHP!!!!

2001-05-14 Thread Kath

http://www.bbspot.com/News/2000/6/php_suspend.html

- Kath

- Original Message -
From: Joseph Blythe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 12:30 AM
Subject: Re: [PHP] HallMark uses PHP


 [EMAIL PROTECTED] wrote:

  I was just looking at Hallmark Channels' website, and noticed them to be
using PHP, wow, PHP has rocketed to something, eh.

 Yes, when I first started using php nearly 2 years ago not many people
 even knew what it was (most thought it was some form of a drug). Now
 days you are hard pressed not to at least come across one site using it
 during a normal web browsing session.

 Long Live PHP,

 Joseph





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



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




RE: [PHP] (OT) HallMark uses PHP!!!!

2001-05-14 Thread scott [gts]

oh god... 

that story will probably come true in the next few years,
due to the way the public school system keeps going downhill
and the unyeilding ignorance of administrators.

 -Original Message-
 From: Kath [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 5:18 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] HallMark uses PHP
 
 
 http://www.bbspot.com/News/2000/6/php_suspend.html
 
 - Kath
 
 - Original Message -
 From: Joseph Blythe [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, May 14, 2001 12:30 AM
 Subject: Re: [PHP] HallMark uses PHP
 
 
  [EMAIL PROTECTED] wrote:
 
   I was just looking at Hallmark Channels' website, and noticed them to be
 using PHP, wow, PHP has rocketed to something, eh.
 
  Yes, when I first started using php nearly 2 years ago not many people
  even knew what it was (most thought it was some form of a drug). Now
  days you are hard pressed not to at least come across one site using it
  during a normal web browsing session.
 
  Long Live PHP,
 
  Joseph
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP General Mailing List (http://www.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] Are Sessions safe to use, Security wise?

2001-05-14 Thread Brandon Orther

Hello,

I am setting up a script that logs into a data base and I only want the
person to have to login once. Is it safe for me to save there login info as
sessions?

Thanks
Brandon


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




RE: [PHP] achive style message center

2001-05-14 Thread scott [gts]

one thought is to search http://www.hotscripts.com/PHP/
for forum or message board scripts.

 -Original Message-
 From: shaun [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 14, 2001 1:15 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] achive style message center
 
 
  i was wondering if anyone has or knows were i can find
 an archive style message system much like the php support archive.
 
 im looking for something to create a forum were people can chat and interact
 without the need of real time
 preferably the archive should be searchable
 
 if anyone could help i would be very appreciative.
 if you need more information just ask
 
 
 
 -- 
 PHP General Mailing List (http://www.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] PHP4 and MySQL on Macintosh

2001-05-14 Thread Andreas Pucko

Hi there,

does anybody know if it is possible to run these applications on MAC 0S?

Any experiences?

Cheers Andy


-- 
PHP General Mailing List (http://www.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] What's more effecient: var on every page or simple function?

2001-05-14 Thread Noah Spitzer-Williams

Which of the two is more efficient:

# start of file.php
$myvar = 3;
# end file.php

#start of file.php
function myvar() {
return 3;
}
#end file.php

the difference between the two is the first example would set the variable
on every page regardless of whether it was used whereas with the function
obviously it would be used only if it were called.

what's better? (myvar is a constant #)

- Noah



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




Re: [PHP] PHP4 and MySQL on Macintosh

2001-05-14 Thread Sverre Johan Tøvik

At 14:44 -0700 14-05-01, Andreas Pucko wrote:
  Hi there,

  does anybody know if it is possible to run these applications on MAC 0S?

  Any experiences?

PHP4 is part of the commercial Apache-on-UNIX-on-MacOS implementation 
WebTen (from Tenon), but not MySQL. I'd rather recommend upgrading to 
Mac OS X - because it's a full-blown *nix, PHP4 and MySQL, and a 
bunch of other *nix stuff, is there. Actually, I think you can get 
them as double-clickable installer packages.


Sverre
-- 
disclaimer I speak for myself only! /disclaimer
to be yourself, in a world that tries, night and day, to make you just
like everybody else - is to fight the greatest battle there ever is to
fight, and never stop fighting -- e.e. cummings

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




RE: [PHP] PHP4 and MySQL on Macintosh

2001-05-14 Thread Hoover, Josh

Andy,

I believe you can run PHP on Mac OS with the use of WebTen by Tenon
(http://www.tenon.com/products/webten/).  MySQL does not run on Mac OS.  You
can run both PHP 4 and MySQL on Mac OS X.  Since it sounds like you're a Mac
developer, I would suggest you check out the AMP mailing list which is full
of Mac developers using technologies like PHP, MySQL, Mac OS X, etc.  The
URL is http://www.developersplace.com/  

Hope that helps out.

Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]

Searching for a new IT solution for your company? Need to improve your
product marketing? 
Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify
the process for you.
KnowledgeStorm - Your IT Search Starts Here 

 does anybody know if it is possible to run these applications 
 on MAC 0S?



[PHP] pulling data out of a string

2001-05-14 Thread Richard Kurth


 I am trying to figure out how to pull data out of a string. This is
 driving me crazy. I figure an if statement of some sort would work but
 I'm not sure how to structure it.

I know how to get what I want if it is just
$fullhostname = www.domain.net;
$exp = explode(., $fullhostname);

$host = $exp[0];
$domain = $exp[1];
$tld = $exp[2];


 But what if it looks like this
$fullhostname = www.mysit.dom.net;
I need
$host= www
$domain = mysit.dom
$tld = net

or this
$fullhostname = mysite.domain.net;
$host =
$domain = mysite.domain
$tld = net

Or even worse this
$fullhostname = mysit.dom.net;

$host =
$domain = mysit.dom
$tld = net








Best regards,
 Richard  
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]




Re: [PHP] PHP priviledges

2001-05-14 Thread Ben Gollmer

This is an excellent question. I've run into the same thing myself when 
setting up my own Linux boxen.

Apache + PHP needs to have read access to users' web directories in 
order to serve them up to the 'net (mode 704), and directories must have 
the execute bit set (mode 705). Assuming users with virtual hosts are 
all members of a group (say 'vhusers'), a shell user cannot read other 
users' files. However, a PHP script (running as the Apache user - 
usually 'nobody') can read all files, obtain directory listings, etc etc 
(as can anyone not a member of the 'vhusers' group - on a virtual host 
server, I'm guessing no one should have priviledged access except the 
admins).

Obviously, this is undesirable from a security standpoint. You don't 
want some luser snarfing the code you've been working on for weeks!

One suggestion I've heard is to make each user have their own group, for 
example 'joeuser' belongs to the group 'joeuser', etc etc. Then you 
could start a seperate instance of Apache+PHP for each user - running AS 
that user. Now joeuser's PHP scripts can't read bobuser's files. 
However, in my view this opens up another security hole - external 
services should never run as normal users on a box. If a new buffer 
overflow was found in Apache, someone could easily wipe out joeuser's 
files...whereas in the previous example, the damage would be limited to 
just reading the files. Also, starting so many instances of Apache seems 
unnecessarily resource-intensive.

I'm by no means a security expert - this email merely reflects the 
results of experimentation on my own boxen. If anyone has any 
suggestions on how to improve this situation, please post 'em!

Ben Gollmer


On Monday, May 14, 2001, at 01:09 PM, bd wrote:

 Hello,

 I have similar concerns with the host I'm trying out right now - though
 they're running Linux/Apache.  My problem is with lack of security with
 shell access (i.e. access to other client's directories and key server
 files) and apparently lax monitoring of its privacy policies.  I'm not 
 a sys
 admin so I don't know exactly what is achievable, but I was surprised 
 by the
 loose config of the server I'm on.

 I'm looking for a Virtual-Host provider running PHP/MySQL who has 
 mastered
 the concept of providing a secure, shared environment to it's clients -
 including ssh/scp access restricted to only what's owned by me, secured
 administration tools, secured email communication with its clients, and
 complete logical and physical security of the server and data center.  
 Does
 anyone have a recommendation?  I've seen providers that address these 
 issues
 for dedicated server configs - but not virtual server configs.

 Best Regards,
 bd

 -Original Message-
 From: José León Serna [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 09, 2001 6:57 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP priviledges


 Hello:
 In my host, the php is installed in a way that I have access from a 
 php
 script to all the webs on that server, (there are almost 60) and I can
 delete/copy any file of other servers. I don't like this because other 
 user
 of that server can do the same as I. I have contacted with my host and 
 they
 doesn't know how to prevent php/IIS to have access to other directories 
 on
 the server, Is this possible?

 Best Regards
 
 Visual PHP Studio, RAD development with PHP
 http://www.visualphpstudio.f2s.com



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


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




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




[PHP] Question php4's configration

2001-05-14 Thread ÕŕF

hi,
My environment:
win2k server + apache1.39 + php4.05

My apache's httpd.conf:

LoadModule php4_module d:/winnt/system32/php4apache.dll
AddType application/x-httpd-php .php .php3 .php4

I copied all the all the sapi related dlls to the win2k's system32
directory. And I installed the apache as a service. The problem is when I
want to restart the apache services, I got memory access violation error of
apache.exe

0x00ea99ea instruction referenced the 0x memory. The memory
block should not be written;

I can still use apache + php except this problem, but I wonder I've not
met the potential problem in the future. Can anyone help me?



-- 
PHP General Mailing List (http://www.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] Connectivity to MS SQL

2001-05-14 Thread Andreas Pucko

Hi there,

I developed an application with a MySQL DB in the backend. Now I have to
change my code to connect to a MS SQL DB. Does anybody know how to do that?
I can't find anything in my PHP Book regarding this topic.

Thanx

Andy

---
Walter Andreas Pucko
W3 International Media Ltd.
Tel:  (604)871-9899
Fax:  (604)871-1108



-- 
PHP General Mailing List (http://www.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] MSSQL

2001-05-14 Thread Andreas Pucko

Hi there,

while tying to connect to a MSSQL DB I get the error message: call to
undefined function.

I thing my syntax is ok.


function pconnect_db()
{

  if (!($link = mssql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))) {
  printf(An SQL error has occured. Please contact our webmaster\n\n);
  DisplayErrMsg(sprintf(internal error %d:%s\n,
 mysql_errno(), mssql_error()));
  exit() ;
   }
   return $link;
}

does anybody see the error?

Cheers Andy


-- 
PHP General Mailing List (http://www.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] Upgrading PHP

2001-05-14 Thread Joseph Bannon

Does anyone know of instructions on upgrading PHP? 

J



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




Re: [PHP] MSSQL

2001-05-14 Thread Fabian Raygosa

According to the php docs there is no mssql_pconnect  just mssql_connect
get rid of the p
- Original Message -
From: Andreas Pucko [EMAIL PROTECTED]
To: Php (E-mail) [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 3:19 PM
Subject: [PHP] MSSQL


 Hi there,

 while tying to connect to a MSSQL DB I get the error message: call to
 undefined function.

 I thing my syntax is ok.


 function pconnect_db()
 {

   if (!($link = mssql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))) {
   printf(An SQL error has occured. Please contact our
webmaster\n\n);
   DisplayErrMsg(sprintf(internal error %d:%s\n,
  mysql_errno(), mssql_error()));
   exit() ;
}
return $link;
 }

 does anybody see the error?

 Cheers Andy


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


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




Re: [PHP] MSSQL (Mistake)

2001-05-14 Thread Fabian Raygosa

DAMN SORRY there is a pconnect
duh
bad me bad me

- Original Message -
From: Fabian Raygosa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Php (E-mail) [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 3:18 PM
Subject: Re: [PHP] MSSQL


 According to the php docs there is no mssql_pconnect  just mssql_connect
 get rid of the p
 - Original Message -
 From: Andreas Pucko [EMAIL PROTECTED]
 To: Php (E-mail) [EMAIL PROTECTED]
 Sent: Monday, May 14, 2001 3:19 PM
 Subject: [PHP] MSSQL


  Hi there,
 
  while tying to connect to a MSSQL DB I get the error message: call to
  undefined function.
 
  I thing my syntax is ok.
 
 
  function pconnect_db()
  {
 
if (!($link = mssql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))) {
printf(An SQL error has occured. Please contact our
 webmaster\n\n);
DisplayErrMsg(sprintf(internal error %d:%s\n,
   mysql_errno(), mssql_error()));
exit() ;
 }
 return $link;
  }
 
  does anybody see the error?
 
  Cheers Andy
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


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


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




[PHP] ssh

2001-05-14 Thread Dennis Gearon

anyone got the easy directions to setting up
teraterm pro with SSH

***AND*** getting the certificate to work for it?

My provider that runs php/mysql/etc only lets people use SSH connections
for telnet, which I agree with. 

Right, now, I don't want to pay the $139 for the non open source windows
SSH client.

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




[PHP] PHP Mail (SMTP)

2001-05-14 Thread Jason Caldwell

There's a setting in the PHP.INI file called [Mail Function] - SMTP

Can I programmatically set this? Or, am I for now restricted to this .INI
entry?

I'd like the option of sending to any one of my 3 mail servers, from one
script.

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




Re: [PHP] ssh

2001-05-14 Thread Tyrone Mills

How about using something like puTTY or SecureCRT?

I use puTTY to connect Windoze boxes to my linux servers all the time, it
works great and actually passes the function keys to remote server instead
of interpreting them itself.

- Original Message -
From: Dennis Gearon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 3:26 PM
Subject: [PHP] ssh


 anyone got the easy directions to setting up
 teraterm pro with SSH

 ***AND*** getting the certificate to work for it?

 My provider that runs php/mysql/etc only lets people use SSH connections
 for telnet, which I agree with.

 Right, now, I don't want to pay the $139 for the non open source windows
 SSH client.

 --
 PHP General Mailing List (http://www.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] Extensions for PHP

2001-05-14 Thread Andreas Pucko

Hi

does anybody know which extension I need to connect to a MSSQL DB, and wher
I could get it?

Thanx

Andy


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




Re[2]: [PHP] pulling data out of a string

2001-05-14 Thread Richard Kurth

Hello Philip,

Monday, May 14, 2001, 3:36:17 PM, you wrote:

That my problem www is not always the host when it is a sub-domain it
would be like mysit.domain.net or sometimes people put a few extra
periods in the domain name like  www.my.test.net  I thought maybe I
could look at the string and find out how many periods are in it then
if there is a www before the first period if not treat it like a
sub-domain. The last period is is any thing after it would be the tld.
How would I count the periods

Philip Hallstrom Is the host always going to be named www?  If it isn't then how can
Philip Hallstrom you distinguish between www.domain.net and mysit.domain.net where in 
the
Philip Hallstrom latter what you call the domain is mysit.domain.  There's no way
Philip Hallstrom around that one.  However, if you can assume that www is always the
Philip Hallstrom name of the host then you could do something like this:


Philip Hallstrom $fullhostname = www.mysit.domain.net;
Philip Hallstrom $exp = explode(., $fullhostname);

Philip Hallstrom if( $exp[0] == www )  {
Philip Hallstrom $hostname = array_shift($exp);
Philip Hallstrom }else {
Philip Hallstrom $hostname = ;
Philip Hallstrom }
Philip Hallstrom $tld = array_pop($exp);
Philip Hallstrom $domain = join(., $exp);


Philip Hallstrom That should do it...


Philip Hallstrom In article [EMAIL PROTECTED] you write:

 I am trying to figure out how to pull data out of a string. This is
 driving me crazy. I figure an if statement of some sort would work but
 I'm not sure how to structure it.

I know how to get what I want if it is just
$fullhostname = www.domain.net;
$exp = explode(., $fullhostname);

$host = $exp[0];
$domain = $exp[1];
$tld = $exp[2];


 But what if it looks like this
$fullhostname = www.mysit.dom.net;
I need
$host= www
$domain = mysit.dom
$tld = net

or this
$fullhostname = mysite.domain.net;
$host =
$domain = mysite.domain
$tld = net

Or even worse this
$fullhostname = mysit.dom.net;

$host =
$domain = mysit.dom
$tld = net








Best regards,
 Richard  
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]






-- 
Best regards,
 Richard  
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]




Re: [PHP] ssh

2001-05-14 Thread Ethan Schroeder

Simple.  Get putty.  It is, by far, the best free ssh client out there.  
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
It's small, too.

Ethan Schroeder

- Original Message - 
From: Dennis Gearon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 5:26 PM
Subject: [PHP] ssh


 anyone got the easy directions to setting up
 teraterm pro with SSH
 
 ***AND*** getting the certificate to work for it?
 
 My provider that runs php/mysql/etc only lets people use SSH connections
 for telnet, which I agree with. 
 
 Right, now, I don't want to pay the $139 for the non open source windows
 SSH client.
 
 -- 
 PHP General Mailing List (http://www.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] Crypt in build 4.0.5

2001-05-14 Thread Brandon Orther

Hello,

Does Crypt need to be setup in the ini or as an extension?  When I installed
4.0.5 it doesn't seem to work?

Thanks
Brandon


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




RE: [PHP] HallMark uses PHP!!!!

2001-05-14 Thread Matt Stone

lol

-Original Message-
From: Kath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 7:18 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HallMark uses PHP


http://www.bbspot.com/News/2000/6/php_suspend.html

- Kath

- Original Message -
From: Joseph Blythe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 12:30 AM
Subject: Re: [PHP] HallMark uses PHP


 [EMAIL PROTECTED] wrote:

  I was just looking at Hallmark Channels' website, and noticed them to be
using PHP, wow, PHP has rocketed to something, eh.

 Yes, when I first started using php nearly 2 years ago not many people
 even knew what it was (most thought it was some form of a drug). Now
 days you are hard pressed not to at least come across one site using it
 during a normal web browsing session.

 Long Live PHP,

 Joseph





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



--
PHP General Mailing List (http://www.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] Redirection in PHP ? (newbie)

2001-05-14 Thread Nicolas Mermet

Hi, this might be a trivial question but I could not find any docs on that
on php.net.

I am develloping the admin side of a dynamic web site (php/mysql). 
The mechanic is nothing special: a form is submitted and sends the data to
the php page/script that actually does the work of feeding the db. I
noticed that hitting back on the browser make the feeding scripts run
again, and double the entries in the db. Of course, that is what the
scripts are supposed to do :-).

To avoid spamming my db I would like to implement a simple redirection
function, that would redirect the user to the main admin page once the
feeding script has successfully executed and would reduce chances of
double entries. Is there a simple way to achieve that ?

thanks,
Nicolas.

-- 
PHP General Mailing List (http://www.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] need some ideas here...

2001-05-14 Thread Christian Dechery

My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've 
tried everything... the mail() function, my alternate function which calls 
popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' 
and all that stuff...

the mail simply won't go an mail() always returns false...
I'm guessing there's no mail sending in this server...

so what do I do?

is it possible for me to call a script on another host from with a script 
and return something to it?

like
?php
code ... code ... code...;
code ... code ... code...;

here I'd have some code to call a script in another host that can send 
mails, of course with the necessary parms...;

code code code;
code code code;
?

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.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] need better solution...

2001-05-14 Thread Christian Dechery

In most of my scripts there are always headers and footers to html outputs...
like logos, images, and on the bottom some links and stuff like that... 
that should always apear...

the most basic is:

html
... header here ...
?php
lots of code
?
... footer here ...
/html

but sometimes I want something like this:
?php
 session_start(); // for instance
 code code code
 if(something)
 print error message and terminate script;
?
html
sadasdsa
/html

what do I do in this case??? I've tried all kinds of programing 
techniques... but none of them seems to fit here.


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer



Re: [PHP] ssh

2001-05-14 Thread Ethan Schroeder

I use mindterm sometimes, as well.  I love it.

Ethan Schroeder

- Original Message - 
From: Dennis Gearon [EMAIL PROTECTED]
To: Ethan Schroeder [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 7:04 PM
Subject: Re: [PHP] ssh


 WOW! installation beats the HELL out of the teraterm project! Thanks,
 got it working!
 
 I wonder if 'mindterm' would be a good applet to install? For anywhere
 access that is. My provider only allows access from the IP's I
 designate.
 


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




Re: [PHP] need better solution...

2001-05-14 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Christian Dechery) wrote:

 html
 ... header here ...
 ?php
 lots of code
 ?
 ... footer here ...
 /html
 
 but sometimes I want something like this:
 ?php
  session_start(); // for instance
  code code code
  if(something)
  print error message and terminate script;
 ?
 html
 sadasdsa
 /html

http://php.net/manual/en/ref.outcontrol.php

-- 
CC

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




Re: [PHP] need some ideas here...

2001-05-14 Thread Ethan Schroeder

Find where there sendmail is and put this in an .htaccess file: php_value
sendmail_path  '/path/to/sendmail -t'

Ethan Schroeder

- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 7:04 PM
Subject: [PHP] need some ideas here...


 My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
 tried everything... the mail() function, my alternate function which calls
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
 and all that stuff...

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...

 so what do I do?

 is it possible for me to call a script on another host from with a script
 and return something to it?

 like
 ?php
 code ... code ... code...;
 code ... code ... code...;

 here I'd have some code to call a script in another host that can send
 mails, of course with the necessary parms...;

 code code code;
 code code code;
 ?
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer


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



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




RE: [PHP] need better solution...

2001-05-14 Thread James Atkinson

I would suggest some sort of Templating solution. Take a look at Smarty,
PHPLib, or FastTemplates.

- James

 -Original Message-
 From: Christian Dechery [mailto:[EMAIL PROTECTED]]
 Sent: May 14, 2001 5:11 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] need better solution...


 In most of my scripts there are always headers and footers to html
 outputs...
 like logos, images, and on the bottom some links and stuff like that...
 that should always apear...

 the most basic is:

 html
 ... header here ...
 ?php
 lots of code
 ?
 ... footer here ...
 /html

 but sometimes I want something like this:
 ?php
  session_start(); // for instance
  code code code
  if(something)
  print error message and terminate script;
 ?
 html
 sadasdsa
 /html

 what do I do in this case??? I've tried all kinds of programing
 techniques... but none of them seems to fit here.

 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer



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




Re: [PHP] Redirection in PHP ? (newbie)

2001-05-14 Thread Chris Adams

On 14 May 2001 16:54:49 -0700, Nicolas Mermet [EMAIL PROTECTED]
wrote:
 To avoid spamming my db I would like to implement a simple redirection
 function, that would redirect the user to the main admin page once the
 feeding script has successfully executed and would reduce chances of
 double entries. Is there a simple way to achieve that ?

header(Location: index.php) should do the trick.

However, I'd recommend something more robust if avoiding duplicates is a big
deal. For example, if you're using sessions, you might have your addition
script set a confirmation variable using uniqid() and changing it after
updating the DB; if confirmation variable passed in the form submission doesn't
match the session variable, you can redirect them to the Were you really
sure? page. Alternately, depending on your data structure it might be easier
to simply insert a dummy record first and then use UPDATEs from that point
forward.

(The unique confirmation variable approach is also a good idea for security
purposes - otherwise if someone can guess the structure of your application,
they could do something funny like send an HTML email with a link to
/products/delete.php?ID=someIDConfirmed=yes to an admin, which would go
directly through without confirmation if they were logged in at the time.)

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




Re: [PHP] need some ideas here...

2001-05-14 Thread Chris Adams

On 14 May 2001 16:59:48 -0700, Christian Dechery [EMAIL PROTECTED] wrote:
 My free-web-hosting (www.f2s.com) does not allow PHP to send emails... I've 
 tried everything... the mail() function, my alternate function which calls 
 popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php' 
 and all that stuff...


Did you try a popen with something /usr/bin/mail? (I assume you've checked the
file paths to make sure they're correct)

 the mail simply won't go an mail() always returns false...
 I'm guessing there's no mail sending in this server...
 
 so what do I do?
 
 is it possible for me to call a script on another host from with a script 
 and return something to it?

PHP does allow arbitrary URLs to be loaded, so you could setup a script and
simply do something like this:

$email_script = fopen(http://someotherhost/mail/script.php?To=blah...;, r);
$Status = fgetss($email_script);

If you need to send large emails, you'll need to fake a POST request. I've had
to do this the hard way in the past but I think there are a couple PHP classes
floating around now which will let you do it. (And, of course, you could use
CURL)

Alternately, if you have a friendly mail server available, you could simply use
one of the SMTP scripts available to send directly to the mail server. Check
out phpclasses.upperdesign.com for a couple scripts.

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




Re: [PHP] need better solution...

2001-05-14 Thread Jason Brooke

 but sometimes I want something like this:
 ?php
  session_start(); // for instance
  code code code
  if(something)
  print error message and terminate script;
 ?
 html
 sadasdsa
 /html

 what do I do in this case??? I've tried all kinds of programing
 techniques... but none of them seems to fit here.

I don't understand why you're asking what to do in that case - what exactly is
the problem there?

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]




[PHP] ODBC connect

2001-05-14 Thread Andreas Pucko

Hi there,

I would like to get information out of a database via ODBC.

I switched from MySQL.

The old syntax does not work which was like:

while ($row = odbc_fetch_row($result))
{
printf (option value = \%s\%s/option, $row-nr,$row-name);
}
 

so, how do I get the nr and name out of the row??

Any suggestions?

Cheers

Andy

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




Re: [PHP] need better solution...

2001-05-14 Thread David Robley

On Tue, 15 May 2001 09:40, Christian Dechery wrote:
 In most of my scripts there are always headers and footers to html
 outputs... like logos, images, and on the bottom some links and stuff
 like that... that should always apear...

 the most basic is:

 html
 ... header here ...
 ?php
 lots of code
 ?
 ... footer here ...
 /html

 but sometimes I want something like this:
 ?php
  session_start(); // for instance
  code code code
  if(something)
  print error message and terminate script;
 ?
 html
 sadasdsa
 /html

 what do I do in this case??? I've tried all kinds of programing
 techniques... but none of them seems to fit here.

exit or die are probably the tools you want.

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

   Blessed are the censors; they shall inhibit the earth.

-- 
PHP General Mailing List (http://www.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] output of file contents while reading

2001-05-14 Thread Maree Talbot

Is it possible in PHP, to open a remote file with fopen() and begin sending 
the contents of the file to the client before the entire file has been read 
from the remote source?

If so, how? I've been unable to get it to work so far, probably because I 
don't understand the nitty gritty of file handles.

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]




Re: [PHP] need better solution...

2001-05-14 Thread Christian Dechery

At 10:35 15/5/2001 +0930, David Robley wrote:
On Tue, 15 May 2001 09:40, Christian Dechery wrote:
  In most of my scripts there are always headers and footers to html
  outputs... like logos, images, and on the bottom some links and stuff
  like that... that should always apear...
 
  the most basic is:
 
  html
  ... header here ...
  ?php
  lots of code
  ?
  ... footer here ...
  /html
 
  but sometimes I want something like this:
  ?php
   session_start(); // for instance
   code code code
   if(something)
   print error message and terminate script;
  ?
  html
  sadasdsa
  /html
 
  what do I do in this case??? I've tried all kinds of programing
  techniques... but none of them seems to fit here.

exit or die are probably the tools you want.

yeah... that's what I use... but then the footer isn't going to be displayed...


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




Re: [PHP] need better solution...

2001-05-14 Thread Christian Dechery

At 11:02 15/5/2001 +1000, Jason Brooke wrote:
  but sometimes I want something like this:
  ?php
   session_start(); // for instance
   code code code
   if(something)
   print error message and terminate script;
  ?
  html
  sadasdsa
  /html
 
  what do I do in this case??? I've tried all kinds of programing
  techniques... but none of them seems to fit here.

I don't understand why you're asking what to do in that case - what exactly is
the problem there?


the problem is, if I terminate the script on that condition the footer 
won't be displayed...


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




Re: [PHP] need some ideas here...

2001-05-14 Thread Christian Dechery

what??? I didn't understand... how will I find out where sendmail is in a 
free-web-host? I don't have telnet access... how can I figure that out? and 
how a .htaccess file would help me here?

At 19:50 14/5/2001 -0500, Ethan Schroeder wrote:
Find where there sendmail is and put this in an .htaccess file: php_value
sendmail_path  '/path/to/sendmail -t'

Ethan Schroeder

- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 7:04 PM
Subject: [PHP] need some ideas here...


  My free-web-hosting (www.f2s.com) does not allow PHP to send emails...
I've
  tried everything... the mail() function, my alternate function which calls
  popen(/usr/lib/sendmail -t) and even a script.cgi with '#!/usr/bin/php'
  and all that stuff...
 
  the mail simply won't go an mail() always returns false...
  I'm guessing there's no mail sending in this server...
 
  so what do I do?
 
  is it possible for me to call a script on another host from with a script
  and return something to it?
 
  like
  ?php
  code ... code ... code...;
  code ... code ... code...;
 
  here I'd have some code to call a script in another host that can send
  mails, of course with the necessary parms...;
 
  code code code;
  code code code;
  ?
  
  . Christian Dechery (lemming)
  . http://www.tanamesa.com.br
  . Gaita-L Owner / Web Developer
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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




  1   2   >