Re: [PHP] .php extensions versus .html

2003-01-31 Thread Justin French
I think what you've seen is shtml / ssi / server side includes, but anyway,
since you asked:

1. create a .htaccess file which pushes *all* .php pages through PHP

I *THINK* the code is something like:

Files ~ \.html$
ForceType application/x-httpd-php
/Files

But you should check the apache manual, list or some tutorials.


2. change your code to:

html
head
titleUntitled/title
/head
body
HELLO WORLD!!!
P
?php include(helloworld2.php); ?
/body
/html


Why can't you just use the .php extension?


Justin


on 31/01/03 5:46 PM, Guru Geek ([EMAIL PROTECTED]) wrote:

 I was wondering, can you call a php script in the middle of a html page?
 
 I've seen some sites use code like this:
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 
 html
 head
 titleUntitled/title
 /head
 body
 HELLO WORLD!!!
 P
 !--#include file=helloworld2.php --
 /body
 /html
 
 but when I try it, the php script doesn't run.
 
 
 Does anyone else know how to use php on a page and yet keep the .html
 extension?
 
 Thanks in advance,
 Roger
 
 


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




Re: [PHP] need some guidance

2003-01-31 Thread Justin French
On a major level, create or use a large CMS (content management system), and
use the information you have in the databases / file system to establish
what's new, modified, etc.

On a smaller level, you could check which files have been updated in X days
(I think) with PHP, and display them as a list, which some selective
listing.

On a pain-in-the-ass level, you could maintain a HTML page with links on it
to things you've recently updated, and maintain it manually.


If you're talking about *another site* (not yours), it would be even harder.


Justin


on 31/01/03 4:28 PM, Seth Hopkins ([EMAIL PROTECTED]) wrote:

 Hey everyone.  I'm wondering if someone could lead me in the right direction
 on this one.  What could I use to see if a site has been updated and then
 display what has been added to it?
 
 Any advice is appreciated.
 Thanks.
 
 Seth
 
 


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




[PHP] rename failes if file name contains single quotes

2003-01-31 Thread $B%X!<%s(B $B%H!<%^%9(B
when i try to rename a file with single quote(s) in the
(Bfile name, e.g.
(B
(Brename("/tmp/foo 'n bar", "/tmp/foobar");
(B
(Brename fails with "there is no such file".
(Bwhats wrong?
(B
(Bthanx,
(B
(Bakagisan
(B
(B__
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] rename failes if file name contains single quotes

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 16:52, $B%X!<%s(B $B%H!<%^%9(B wrote:
(B when i try to rename a file with single quote(s) in the
(B file name, e.g.
(B
(B rename("/tmp/foo 'n bar", "/tmp/foobar");
(B
(B rename fails with "there is no such file".
(B whats wrong?
(B
(BYou probably need to escape certain characters such as space and the single 
(Bquote.
(B
(B-- 
(BJason Wong - Gremlins Associates - www.gremlins.biz
(BOpen Source Software Systems Integrators
(B* Web Design  Hosting * Internet  Intranet Applications Development *
(B
(B/*
(BI never said all Democrats were saloonkeepers; what I said was all
(Bsaloonkeepers were Democrats.
(B*/
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LOGOUT - Reset Session

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 15:50, Keith Spiller wrote:
 Hello Everyone,

 I'm trying to create a Logout Function and Link.  My site uses a standard
 htaccess file for its authentication method.  After the brower requests the
 username and password they have access to the protected site.

 Then users can jump to a special Messaging section where I wrote a php
 script that retieves the $REMOTE_USER value and checks it against a message
 database.

 My problem is that I'd like to have a logout link that will dump the values
 the user had entered for their username and password so that they can no
 longer access the messages, neither with a back button nor just by going
 back to the site url.  But since I am retrieving the $REMOTE_USER value
 using PHP4, it seems some how it remebers the username and password.

Yes, that's because after HTTP authentication, each time the browser requests 
a page it'll send the user and password as well.

  Is
 that because I need to destroy the session and remove or replace the
 session cookies?  I do not know what the session name is, nor how to check
 it.

HTTP authentication are not related to sessions.

Have a look in the manual  HTTP authentication with PHP


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

/*
New members are urgently needed in the Society for Prevention of
Cruelty to Yourself.  Apply within.
*/


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




Re: [PHP] rename failes if file name contains single quotes

2003-01-31 Thread Ernest E Vogelsinger
At 09:52 31.01.2003, =?ISO-2022-JP?B?GyRCJVghPCVzGyhCIBskQiVIITwlXiU5GyhC?=
said:
[snip]
when i try to rename a file with single quote(s) in the
file name, e.g.

rename(/tmp/foo 'n bar, /tmp/foobar);

rename fails with there is no such file.
whats wrong?
[snip] 

try to escape blanks and quotes:
rename(/tmp/foo\ \'n bar, /tmp/foobar);

generally you should escape all non-ascii characters in file names.

-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] PHP Apache

2003-01-31 Thread Justin French
strings must be wrapped in quotes

$name = 'ab';

Justin

on 31/01/03 8:45 PM, Aaron Stephan William Boeren ([EMAIL PROTECTED]) wrote:

 The script:
 ?php
 #start variables
 $name = ab;
 $age = 16;
 #start script
 echo Hi, my name is $name and I'am $age years old.;
 ?


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




[PHP] query on indexserver via php ado

2003-01-31 Thread Florian Grabke
hi

we try to migrate our intranet from asp to php the last problem is our
indexserver.

we are using the ado functions of php to make a connection and a query on
the indexserver but the recordset is empty


code:

$objQuery = new COM(ixsso.Query)or die(Cannot start Query);
$objutil = new COM(IXSSO.util)or die(Cannot start Util);
$rsQuery = new COM(ADODB.recordset) or die(Cannot start Recordset);
$objutil-addscopetoquery ($objQuery,/,deep);
$querystring = #filename *.pdf;
print $querystring;
$objQuery-catalog =catalogname;
$objQuery-query = $querystring;
$objQuery-SortBy = filename;
$objQuery-columns = (filename,docsubject, doctitle, docauthor, doccompany,
doccategory, dockeywords, doccomments, characterization, vpath,);
$rsQuery = $objQuery-CreateRecordset(nonsequential);

___

any ideas how to get the thing work ?

greets flo



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




[PHP] reading attachmentsl

2003-01-31 Thread Bartosz Matosiuk
hi all

I'm writing a mail client and I got problem with attachments. I have no
idea how to read and save attachments. Mayby someone already did something
like that a can help me with some advice or giving me link to some
resourses.

greetz
bartek



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




Re: [PHP] How to check for refresh in PHP

2003-01-31 Thread adrian [EMAIL PROTECTED]
a real simple thing i do is to increment the counter
then use header() to redirect to same page with a variable added.
so at the top of details.php i put..

if(!$_GET['no_count']){
...increment counter
header(location:...details.php?no_count=on);
exit;
}

of course people can always just manually edit the url in the address bar
in which case you could probly use http_referer  to check.
for my purposes most of the visitors won't edit the url so it's not too
important.



- Original Message -
From: Pag [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 15, 2003 6:08 AM
Subject: [PHP] How to check for refresh in PHP



 Hi,

 I have a news site where i want to track how many visits or reads each
 individual news has. I have a main list with all the titles, then clicking
 on them shows the details of the specific news, only then the counter for
 that particular news is increased. The problem is, if the user does a
 refresh while at the details, the counter is increased again. How can i
 prevent this from happening?

 I thought it would be something like a unique counter problem, but its
 like having a counter problem for each news i have. :-P

 What would be nice, if it exists, is to check if the user is doing a
 refresh or coming from somewhere else. If its a refresh, the counter would
 simply not increase. That would be sufficient to keep the
 i-want-my-news-to-have-the-higher-number-of-visitors author, from having
 his way.

 Thanks.

 Pag



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




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




php-general Digest 31 Jan 2003 11:51:40 -0000 Issue 1855

2003-01-31 Thread php-general-digest-help

php-general Digest 31 Jan 2003 11:51:40 - Issue 1855

Topics (messages 133706 through 133756):

php question - query string
133706 by: Anthony Ritter
133708 by: Philip Hallstrom
133709 by: Lowell Allen

php as shell script
133707 by: David H
133710 by: Khalid El-Kary

PHP Compile Error
133711 by: Robert Fitzpatrick
133716 by: Johannes Schlueter

Re: Context
133712 by: Justin French

Re: mysq_connect()
133713 by: Khalid El-Kary
133721 by: Philip Olson

Re: XML PHP question
133714 by: Chris McCluskey

POST without a form
133715 by: arthur.chereau

iCal parser and importing iCal to database
133717 by: Reuben D. Budiardja
133719 by: Dan Harrington
133724 by: Richard Baskett

Re: [PHP-WIN] Register globals on and off
133718 by: Davy Obdam
133726 by: Tom Rogers
133740 by: Jason Wong
133741 by: Jason Wong

Re: Adding HTTP URL Code
133720 by: Tom Rogers

Re: Encryption using MMCrypt - whats the point?
133722 by: Jason Sheets

Re: PHP - mysql_info question
133723 by: John W. Holmes

Change MySQL from Socket to TCP
133725 by: Stephen
133735 by: Chris Shiflett

Re:[PHP] POST without a form
133727 by: Daniel Leighton

Introduction
133728 by: Julie Williams

Money format
133729 by: Ben Edwards
133731 by: V Dub
133734 by: Ben Edwards

Trying to understand an error
133730 by: Lynn
133738 by: Jason Wong

Re: Money format--concatenate?
133732 by: Leonard Burton

Sending plain text data in a table with mail()
133733 by: Leonard Burton

Using CVS through PHP
133736 by: Weston Houghton

How to check for refresh in PHP
133737 by: Pag
133739 by: Justin French
133756 by: adrian murphy.2020tourism.com

.php extensions versus .html
133742 by: Guru Geek
133746 by: Justin French

need some guidance
133743 by: Seth Hopkins
133744 by: Timothy Hitchens \(HiTCHO\)
133747 by: Justin French

LOGOUT - Reset Session
133745 by: Keith Spiller
133750 by: Jason Wong

rename failes if file name contains single quotes
133748 by: $B%X!%s(B $B%H!%^%9(B
133749 by: Jason Wong
133751 by: Ernest E Vogelsinger

Re: PHP  Apache
133752 by: Aaron Stephan William Boeren
133753 by: Justin French

query on indexserver via php ado
133754 by: Florian Grabke

reading attachmentsl
133755 by: Bartosz Matosiuk

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]


--

---BeginMessage---
The following script is from Kevin Yank's book on page 59-60.  (Sitepoint)

I'd like to get some clarification about the line: (almost next to last line
in the script)

...
echo(pa href='$PHP_SELF?addjoke=1'Add a Joke!/a/p);



He has a link called Add a Joke!.

When the user clicks on the link, the same page loads - with the form this
time - and the query string passes the value -1 - to the variable $addjoke.

Am I on the right track?

If so, why does 1 - as opposed to 2 or something else - have to be the
name/value pair if the user is adding another joke?

Thank you.
TR
..

html
head
title The Internet Joke Database /title
/head
body
?php
  if (isset($addjoke)): // If the user wants to add a joke
?

form action=?=$PHP_SELF? method=post
pType your joke here:br /
textarea name=joketext rows=10 cols=40 wrap/textareabr /
input type=submit name=submitjoke value=SUBMIT //p
/form

?php
  else: // Default page display

// Connect to the database server
$dbcnx = @mysql_connect(localhost, root, mypasswd);
if (!$dbcnx) {
  echo( pUnable to connect to the  .
database server at this time./p );
  exit();
}

// Select the jokes database
if (! @mysql_select_db(jokes) ) {
  echo( pUnable to locate the joke  .
database at this time./p );
  exit();
}

// If a joke has been submitted,
// add it to the database.
if ($submitjoke == SUBMIT) {
  $sql = INSERT INTO Jokes SET
  JokeText='$joketext',
  JokeDate=CURDATE();
  if (@mysql_query($sql)) {
echo(pYour joke has been added./p);
  } else {
echo(pError adding submitted joke:  .
 mysql_error() . /p);
  }
}

echo(p Here are all the jokes in our database: /p);

// Request the text of all the jokes
$result = @mysql_query(SELECT JokeText FROM Jokes);
if (!$result) {
  echo(pError performing query:  . mysql_error() . /p);
  exit();
}

// Display the text of each joke in a paragraph

RE: [PHP] PHP Apache

2003-01-31 Thread John W. Holmes
 $name = ab;
 Notice: Use of undefined constant ab - assumed 'ab' in
 c:\inetpub\wwwroot\sdd\pages\nameage.php on line 3

rant
Honestly, do you read the error messages or do you just post them to the
list? You need to stop using us for the easy answer and do a little
looking yourself. For example... when I see that error, I'm going to ask
my self why is PHP thinking ab is a constant? Do I mean it to be a
constant? If so, I must of forgot to define() it somewhere. If it's not
supposed to be a constant, what is it supposed to be? An integer... well
a and b don't make very good integers, so probably not. It's supposed to
be a string, right? So why is PHP thinking it's a constant? At this
point, if I didn't know what was going on, I'd go to the manual and read
the chapter on variable types and the sections on constants and
strings... to learn what the difference is. I'll guarantee that if you
actually read those sections, you'd realize... on your own... (imagine
that) that strings have to be surrounded by quotes... either single or
double (the section will even explain the difference). So now you'd know
the answer, you found it yourself, you maybe learned a few other things
as you read, and I bet you would have gotten your answer a lot faster
than waiting for answers on a mailing list...
/rant

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] RE: iCal parser and importing iCal to database

2003-01-31 Thread Jerry Artman
Just drop on over to 

http://phpicalendar.sourceforge.net/nuke/

and I think you'll find what you are looking for.

Jerry Artman
Budget and Reimbursement
[EMAIL PROTECTED]


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




Re: [PHP] Send commands to a shell program

2003-01-31 Thread Marek Kilimajer
popen might help you, but if you want to control programs from a 
browser, you will encounter one problem - once your script is finished, 
your program is closed too.

Antti wrote:

I want to for example give commands to mpg321 when it is executed with 
the -R option (remote control mode). Is this possible with exec() or 
other execute php functions. What I mean is to execute commands while 
being in a shell program. Hope you got it!

antti




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




[PHP] Unable to upload multiple files

2003-01-31 Thread Antti
When I push the submit button it starts to send the request to my server 
and uploads a file, but if I upload more than one at a time it doesn't 
even start to upload them. My upload max should be like 50M in php.ini. 
What is the problem.

antti


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



Re: [PHP] reading attachmentsl

2003-01-31 Thread Chris Hayes
At 11:11 31-1-2003, you wrote:

hi all

I'm writing a mail client and I got problem with attachments. I have no
idea how to read and save attachments. Mayby someone already did something
like that a can help me with some advice or giving me link to some
resourses.

Maybe it helps to see how an attachment is send, then you can try to 
reverse the process to read in attachments.


assume that $filedata holds the data you want to attach
the encoding can done in many ways, so read the headers carefully

//prepare mail body
   $filedata = chunk_split(base64_encode($filedata));
   $type = application/octet-stream;
   $encoding = base64;
mt_srand((double)microtime()*100);
$boundary = '--b'.md5(uniqid(mt_rand())) . getmypid();//so the 
boundary line can be quite diverse
$mailbody = From: PHP backup script by Arakrys\n
.MIME-Version: 1.0\n
.Content-Type: multipart/mixed; 
.boundary=\$boundary\\n\n
.This is a MIME encoded message. \n\n
.--$boundary\n
.Content-Type: text/plain;
//if ($this-charset != ) $mailbody .= ; charset=$this-charset;
$mailbody .=\n
.Content-Transfer-Encoding: 8bit\n\n
.$message . \n\n\n--$boundary;
   $data = Content-Type: $type.; name = \$filename\
.\n .Content-Transfer-Encoding: $encoding
.\n\n$filedata\n;
   $mailbody .= \n$data\n--$boundary
.--\n;

//send mail
mail($mailto, $MYSQL_DB.' database backup '.date(d M Y H:i), ' ', 
$mailbody) or die ('Could not send email!');
}


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



[PHP] Exclusion in Regex not working

2003-01-31 Thread SLanger
Hello Everyone

This might be slightly offtopic since I'm not sure its php related but
I'm working on a script where some inputdata is taken for further 
processing. For validation purposes I want to make sure certain chars are 
not part of the input. Basically stuff like $ * :; etc... 

So I'm using ereg(pattern, input) to see if the pattern matches or not. 

Example

if(ereg($pattern, $input))
{
// do allowed stuff
}
else
{
// do something for the illegal input
}
SO for exclusion I build the following pattern [^$] and pass it to ereg 
above.  So if the input includes a $ the ereg should return false and the 
processing shouldn't take place.

Well the thing is for $pattern = '[^$]' it doesn't work. Input including 
'$' is still passed to the allowed stuff code block.
So am I doing something wrong or is there a problem with the character 
coding of my editor

BtW I'm using W2K with PHP 4.1.x Apache 1.3.X and TextPad 4.x for editing. 
I save my scripts as ANSI format. Meaning only legal ASCII Characters + 
German extended code page.

Can anybody help me?

I also tried [^a] as a pattern but the input can contain a and slip 
through. 




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Justin French
Firstly, try uploading two SMALL files (say, no more than 1k each), just to
check if it's an issue with *two files*, or an issue with *file size*,
*script time outs* (maximum execution time) or something else.

Start ruling them out, one at a time.

Justin


on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:

 When I push the submit button it starts to send the request to my server
 and uploads a file, but if I upload more than one at a time it doesn't
 even start to upload them. My upload max should be like 50M in php.ini.
 What is the problem.
 
 antti
 


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




Re: [PHP] Exclusion in Regex not working

2003-01-31 Thread Chris Hayes
At 14:11 31-1-2003, you wrote:


So I'm using ereg(pattern, input) to see if the pattern matches or not.

SO for exclusion I build the following pattern [^$] and pass it to ereg
above.  So if the input includes a $ the ereg should return false and the
processing shouldn't take place.

Well the thing is for $pattern = '[^$]' it doesn't work. Input including
'$' is still passed to the allowed stuff code block.

I remember something like $ had to be double escaped like \\$


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




Re: [PHP] Exclusion in Regex not working

2003-01-31 Thread Justin French
Can I make a suggestion?

I tend to look at the issue of user input the other way around... rather
than excluding things I don't think I want, I choose in allow things I *DO*
want... so instead of saying a username shouldn't contain
!@#$%^*()_+-=?:';, I say it should contain a-zA-Z0-9_-.

This means that I allow what I trust, rather than assuming I can think of
every possible bad character the user might choose.

?
// a-zA-Z0-9_ are valid in this case
if(preg_match(/^[a-zA-Z0-9_]*$/, $username))
{
// good
}
else
{
// bad
}
?


To answer your question, (and i've got ZERO experience with regexp's, and
the above regexp was written for me by someone on this list!) is that you
need to escape some characters, like a $ sign, with a \.

Cheers,

Justin





on 01/02/03 12:11 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

 Hello Everyone
 
 This might be slightly offtopic since I'm not sure its php related but
 I'm working on a script where some inputdata is taken for further
 processing. For validation purposes I want to make sure certain chars are
 not part of the input. Basically stuff like $ * :; etc...
 
 So I'm using ereg(pattern, input) to see if the pattern matches or not.
 
 Example
 
 if(ereg($pattern, $input))
 {
 // do allowed stuff
 }
 else
 {
 // do something for the illegal input
 }
 SO for exclusion I build the following pattern [^$] and pass it to ereg
 above.  So if the input includes a $ the ereg should return false and the
 processing shouldn't take place.
 
 Well the thing is for $pattern = '[^$]' it doesn't work. Input including
 '$' is still passed to the allowed stuff code block.
 So am I doing something wrong or is there a problem with the character
 coding of my editor
 
 BtW I'm using W2K with PHP 4.1.x Apache 1.3.X and TextPad 4.x for editing.
 I save my scripts as ANSI format. Meaning only legal ASCII Characters +
 German extended code page.
 
 Can anybody help me?
 
 I also tried [^a] as a pattern but the input can contain a and slip
 through. 
 
 


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




Re: [PHP] + in filenames

2003-01-31 Thread Marek Kilimajer
I use this:
   $name=strtr( $name,
 ?*#$%^:+=/\,
__);

Victor wrote:


I DO want preserve the filenames, and the pluses come from the user
(beta testers that deliberately try to hack the script) . all I want to
do is make sure the the script doeasnt breack when a user uploads a file
that has the + character in it's name.

- Vic

-Original Message-
From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 5:32 PM
To: Victor
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] + in filenames

Victor!

What are you trying to accomplish?
Do you want to preserve the original filename?
Why not give uploaded files uniformly unique names?

In other words, where are the +'s coming from?

So, a little more detail, please!

RW


Quoting Victor [EMAIL PROTECTED]:

### Here is some sample code:
### 
### 
### 
### $file_name = explode(., $_FILES['picture']['name']);
### 		$name = str_replace('', '_', $file_name[0]);
### 		
### 		# check if file uploaded is good
### 		if 
### 		(
### 			!in_array($_FILES['picture']['type'],
### $file_type) 
### 			|| trim($_FILES['picture']['tmp_name']) ==  
### 			|| trim($_FILES['picture']['tmp_name']) ==
### none
### 		)
### 		{
### 			echo ('You can upload a JPG or JPEG filetype
### only.');
### 			
### 			exit;
### 		}
### 		
### 		# Add slashes to prevent certain errors
### 		$picture_name = strip_tags($_FILES['picture']['name']);
### 		$picture_name = addslashes($picture_name);
### 		$picture_name = str_replace(\r\n, , $picture_name);
### 		$picture_name = str_replace( , , $picture_name);
### 
### 
### 
### -Original Message-
### From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
### Sent: Saturday, January 25, 2003 5:12 PM
### To: Victor
### Cc: [EMAIL PROTECTED]
### Subject: Re: [PHP] + in filenames
### 
### Some sample code would help, but maybe try urldecode('$filename');
### 
### RW
### 
### Quoting Victor [EMAIL PROTECTED]:
### 
### ### I have a file upload field, and some filename checking code, but
it
### ### breaks the code whenever a + is inside the filename it verifies
### space
### ### and other tags but breaks on + in the name. Anyone know a fix
for
### this
### ### please? 
### ### 
### ### - Vic
### ### 
### ###
###
__ 
### ### Post your free ad now! http://personals.yahoo.ca
### ### 
### ### -- 
### ### PHP General Mailing List (http://www.php.net/)
### ### To unsubscribe, visit: http://www.php.net/unsub.php
### ### 
### ### 
### 
### 
### -- 
### Richard Whitney
### Transcend Development
### Producing the next phase of your internet presence.
### [EMAIL PROTECTED]
### http://xend.net
### 602-971-2791
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
###
__ 
### Post your free ad now! http://personals.yahoo.ca
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


 



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




[PHP] HTTP || FTP Upload? Wich one?

2003-01-31 Thread Evan
Hi to all!
I'm working at a simple script that let me upload files in a Intranet.
The problem is that these files are videos, so really big (in the order of
Gbytes).
I think that HTTP upload doesn't fit to solve this problem so I thought
about FTP.
Can you tell me what do you think about this?
What are the maxsizes given for HTTP and FTP in the RFC (don't care about
php.ini)?
HTTP maxfilesize == 2Gb is it correct?
Do you think is better developing a simple application with C++Builder?

Thanks for your attention,
Evan



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




Re: [PHP] Making a file manager with PHP?

2003-01-31 Thread Marek Kilimajer
Search www.hotscripts.com, I'm sure you will find something

Max Tappenden wrote:


Clear DayHello there.
Basically I'm trying to make a file manager with PHP.
Here's what I need to do
Ok I have artists and coders working for my site
No FTP
I want them to be able to upload/download files from me as and when they please without having to email me the files
The files that will be uploaded and downloaded are with these extentions
.htm
.html
.php
.phps
.jpg
.gif
.swf
I can scrape together the upload bit, but the download bit just runs the file rather than brings up the download feature of the web browser. How can I make it download it?
TIA!
 



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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
Justin French wrote:

Firstly, try uploading two SMALL files (say, no more than 1k each), just to
check if it's an issue with *two files*, or an issue with *file size*,
*script time outs* (maximum execution time) or something else.

Start ruling them out, one at a time.

Justin


on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:



When I push the submit button it starts to send the request to my server
and uploads a file, but if I upload more than one at a time it doesn't
even start to upload them. My upload max should be like 50M in php.ini.
What is the problem.

antti






Two 1 kb files went trough but not two mp3's. What are the critical 
lines in php.ini in this case? Maybe I have missed something...?

antti


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



RE: [PHP] Introduction

2003-01-31 Thread Julie Williams
Thanks for the welcome!  And naturally, I need help. :-)

I am just learning PHP, although I have taken programming classes in C and
am a little familiar with writing small scripts.

My husband wrote a simple PHP script for a client of ours, which I have the
pleasure of fine-tuning, the idea being to get me to learn PHP.

Well, the script doesn't do what it should, and neither I nor even my
husband can figure out why.  Hopefully, someone here can guide us as to what
we are doing wrong. :-)

Basically, all the script does (or should do) is build an e-mail to a client
based on a set of variables defined by the user, using an HTML form.  It is
also supposed to warn the user with a print message whenever a variable is
missing.  The form is at the following address:
http://www.swedishengineering.com/newsite/requestresponse.html

I've saved the script in text format so that you can look at, it is located
at the following address:
http://www.swedishengineering.com/newsite/requestresponse.rtf

The errors are as follows:

When the customer's e-mail is omitted, a print message should appear, to the
effect of Hey, you need to specify the e-mail!.  However, when the e-mail
is omitted *and* one of the options is clicked, the message does not appear,
but rather, the user gets re-directed to the index page.

When the Parts option is chosen, but no parts are indicated, a print
message should appear to let the user know that a part number needs to be
entered.  However, the script bypasses this and builds the e-mail anyway.

I hope this makes sense and would greatly appreciate any help.

Thanks!!

Julie

-Original Message-
From: Mike Kercher [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 6:21 PM
To: 'Julie Williams'
Subject: RE: [PHP] Introduction


You have the right address and welcome

-Original Message-
From: Julie Williams [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 11:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Introduction


Hello everyone,

I just subscribed to the list and wanted to say hello.  Also to check if I
have the right address.

:-)

Julie Williams


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


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




[PHP] Newsletter using PHP and MySQL

2003-01-31 Thread Steve Vernon
Hiya,
I have nearly finished a project I am working on, and completely forgot about 
having a newsletter service! Basically its a website, and on the registration page 
people opt in or out of the newsletter, and this is a field in the database.

So either once a week, or randomly I want to be able to send a newsletter to about 
a million people (hopefully if all goes to plan). 

What I did envisage was running a PHP script through the command line, which got 
the first 100 or so which wanted the newsletter, then the next 100 etc, till all the 
users who wanted the newsletter got it. Now my Linux is a bit hazy, but I think I can 
run this low priority, because Iam not bothered if it will take a day or so to send 
them all.

Sommat like this:

1- Read the first 100 emails that want the newsletter

2- Email them

3- If read 100, then go to 1 (but start from 100), if not quit

So basically my questions are:

1- Is this the best way? Or should I use some mailing list software? I do want 
them to subsribe/unsubsribe through the website

2- Is there a point when the script would time out? I know in Apache, u can 
set a time limit for a script, but would a command line PHP script have the same 
problem? Ihave never run PHP through the command line. 

 Thanks a lot, any advive or links would be great...

Oh yeh nearly forgot, although it will be hosted on Linux, it will be tested on 
Windows 2k, so hopefully the mehtod would work for Win 2k but this is not necessary...

Steve

PS I have looked at a few archives, and searched the net but not seen anything that 
helpful... 


Re: [PHP] + in filenames

2003-01-31 Thread ed


On Fri, 31 Jan 2003, Marek Kilimajer wrote:

 I use this:
 $name=strtr( $name,
  ?*#$%^:+=/\,
 __);
 


I'm hoping that double quote was a typo??

Ed




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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer
check max_post_size in php.ini

Antti wrote:


When I push the submit button it starts to send the request to my 
server and uploads a file, but if I upload more than one at a time it 
doesn't even start to upload them. My upload max should be like 50M in 
php.ini. What is the problem.

antti




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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 21:47, Antti wrote:
 Justin French wrote:
  Firstly, try uploading two SMALL files (say, no more than 1k each), just
  to check if it's an issue with *two files*, or an issue with *file size*,
  *script time outs* (maximum execution time) or something else.
 
  Start ruling them out, one at a time.


  on 01/02/03 12:03 AM, Antti ([EMAIL PROTECTED]) wrote:
 When I push the submit button it starts to send the request to my server
 and uploads a file, but if I upload more than one at a time it doesn't
 even start to upload them. My upload max should be like 50M in php.ini.
 What is the problem.
 
 antti

 Two 1 kb files went trough but not two mp3's. What are the critical
 lines in php.ini in this case? Maybe I have missed something...?

As Justin suggested Start ruling them out, one at a time. You've ruled out 
one (number of files). Now figure out whether it's the size. Upload 
successfully larger files until it fails (or otherwise).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To stay youthful, stay useful.
*/


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




Re: [PHP] Introduction

2003-01-31 Thread Jason Wong
On Saturday 01 February 2003 00:47, Julie Williams wrote:

 Basically, all the script does (or should do) is build an e-mail to a
 client based on a set of variables defined by the user, using an HTML form.
  It is also supposed to warn the user with a print message whenever a
 variable is missing.  The form is at the following address:
 http://www.swedishengineering.com/newsite/requestresponse.html

 I've saved the script in text format so that you can look at, it is located
 at the following address:
 http://www.swedishengineering.com/newsite/requestresponse.rtf

If your code isn't humungous then you should include it (inline, not as an 
attachment) with your post. There are many reasons why people would not click 
on a link to see your code (laziness, or fear of being social-engineered to 
spread the latest MS-related exploit etc).

If your code _is_ humungous, then a link might be appropriate and note saying 
_why_ you're posting a link would be nice.


Also, your intent to make the code look pretty(?) by converting to RTF seems 
misguided. Stick to plain-text. 

 The errors are as follows:

 When the customer's e-mail is omitted, a print message should appear, to
 the effect of Hey, you need to specify the e-mail!.  However, when the
 e-mail is omitted *and* one of the options is clicked, the message does not
 appear, but rather, the user gets re-directed to the index page.

 When the Parts option is chosen, but no parts are indicated, a print
 message should appear to let the user know that a part number needs to be
 entered.  However, the script bypasses this and builds the e-mail anyway.

 I hope this makes sense and would greatly appreciate any help.

It's good you that you explain what you're trying to do, and what you expect 
the program to do, and what actually happens instead. (Some people just say 
here's my code, it doesn't work, what's wrong? -- or words to that effect)

However it would make more sense if we could see some code :)


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Sleep is for the weak and sickly.
*/


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




[PHP] checkboxes and php...

2003-01-31 Thread Mr. BuNgL3
Hi...
can you give me some lights in this subject? How checkboxes work with php?
Or where i can find some info about this? Or both :)
Ex: if i want to erase from db all data with the checkbox active...

thanks...



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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
Marek Kilimajer wrote:

check max_post_size in php.ini

Antti wrote:


When I push the submit button it starts to send the request to my 
server and uploads a file, but if I upload more than one at a time it 
doesn't even start to upload them. My upload max should be like 50M in 
php.ini. What is the problem.

antti





Ok now I am able to send the request. I set the post_max_size into 50M 
and now when the request is sent the whole apache goes down giving: The 
document containd no data everytime I send a request. I tried also 10M 
but same happens. What the h**l is this?


antti


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



RE: [PHP] checkboxes and php...

2003-01-31 Thread Matt Schroebel
 -Original Message-
 From: Mr. BuNgL3 [mailto:[EMAIL PROTECTED]] 
 Sent: Friday, January 31, 2003 8:43 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] checkboxes and php...
 
 
 Hi...
 can you give me some lights in this subject? How checkboxes 
 work with php?
 Or where i can find some info about this? Or both :)
 Ex: if i want to erase from db all data with the checkbox active...

Search the archives ...
http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=checkboxq=b


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




Re: [PHP] mysq_connect()

2003-01-31 Thread Chris Hewitt
Cesar Rodriguez wrote:


-snip--
The message I get is:

Fatal error: Call to undefined function: mysql_pconnect() in
var/www/html/lesson/firsta.php

Seems that PHP4 does not find the MySQL library. I checked php.ini and
httpd.conf files and everything is in its place apparently. I re-installed
everything from scratch with no positive result. I would appreciate advice
on this issue.



I think the best way to prove whether you have mysql support or not 
would be to look at the output of phpinfo(). If this does not show mysql 
support then you will need to recompile php with it. Is this a standard 
RH 8.0 installation or have you modified it?

HTH
Chris







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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 Ok now I am able to send the request. I set the post_max_size into 50M
 and now when the request is sent the whole apache goes down giving: The
 document containd no data everytime I send a request. I tried also 10M
 but same happens. What the h**l is this?

Do you have this line in your form?

input type=hidden name=MAX_FILE_SIZE value=3

and is it set to a value greater than the size of all the files you're
trying to upload? Some browers actually pay attention to this.

---John Holmes...


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
1lt John W. Holmes wrote:

Ok now I am able to send the request. I set the post_max_size into 50M
and now when the request is sent the whole apache goes down giving: The
document containd no data everytime I send a request. I tried also 10M
but same happens. What the h**l is this?



Do you have this line in your form?

input type=hidden name=MAX_FILE_SIZE value=3

and is it set to a value greater than the size of all the files you're
trying to upload? Some browers actually pay attention to this.

---John Holmes...



No, I don't have that line.


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 Ok now I am able to send the request. I set the post_max_size into 50M
 and now when the request is sent the whole apache goes down giving: The
 document containd no data everytime I send a request. I tried also 10M
 but same happens. What the h**l is this?
 
 
  Do you have this line in your form?
 
  input type=hidden name=MAX_FILE_SIZE value=3
 
  and is it set to a value greater than the size of all the files you're
  trying to upload? Some browers actually pay attention to this.
 
  ---John Holmes...
 

 No, I don't have that line.

Try it then...

---John  Holmes...


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




[PHP] Problems with 4.3.0 cli and paths

2003-01-31 Thread Robert Mena
Hi,

I have upgraded my server with the 4.3.0 version.  The
cli was upgraded also and all my scripts started to
crash.

I ususally put a #!/husr/local/bin/php -q in all
scripts that need to be executed from the crontab.

All the sudden the scripts ended with error messages
such as Warning: main(../php/define.php)
[http://www.php.net/function.main]: failed to create
stream: No such file or directory in
/home/httpd/html/script.php on line 11

What's going on ?

Do I need to put the full path now ?

regards.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
1lt John W. Holmes wrote:

Ok now I am able to send the request. I set the post_max_size into 50M
and now when the request is sent the whole apache goes down giving: The
document containd no data everytime I send a request. I tried also 10M
but same happens. What the h**l is this?



Do you have this line in your form?

input type=hidden name=MAX_FILE_SIZE value=3

and is it set to a value greater than the size of all the files you're
trying to upload? Some browers actually pay attention to this.

---John Holmes...



No, I don't have that line.



Try it then...

---John  Holmes...



No affect. Still gives the The document contains no data.


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer
Show us the code

Antti wrote:


1lt John W. Holmes wrote:


Ok now I am able to send the request. I set the post_max_size into 
50M
and now when the request is sent the whole apache goes down 
giving: The
document containd no data everytime I send a request. I tried 
also 10M
but same happens. What the h**l is this?



Do you have this line in your form?

input type=hidden name=MAX_FILE_SIZE value=3

and is it set to a value greater than the size of all the files you're
trying to upload? Some browers actually pay attention to this.

---John Holmes...



No, I don't have that line.




Try it then...

---John  Holmes...



No affect. Still gives the The document contains no data.





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




Re: [PHP] Problems with 4.3.0 cli and paths

2003-01-31 Thread Marek Kilimajer
Generally yes, since 4.3 cli does not change the working directory

Robert Mena wrote:


Hi,

I have upgraded my server with the 4.3.0 version.  The
cli was upgraded also and all my scripts started to
crash.

I ususally put a #!/husr/local/bin/php -q in all
scripts that need to be executed from the crontab.

All the sudden the scripts ended with error messages
such as Warning: main(../php/define.php)
[http://www.php.net/function.main]: failed to create
stream: No such file or directory in
/home/httpd/html/script.php on line 11

What's going on ?

Do I need to put the full path now ?

regards.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 



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




[PHP] How to enter username and Password from PHP script?

2003-01-31 Thread Ananth Kesari
Hi,

I am working on porting PHP onto NetWare. I am testing the various
features on NetWare. In one such testing I need to be able to enter
username and password from a PHP script which is read off into PHP
through an API which can be passed to my code for usage. How can I do
it? Also, how is this done on Unix/Linux environment?

Your help in this is appreciated.

Thanks,
Ananth.


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
Marek Kilimajer wrote:

Show us the code

Antti wrote:


1lt John W. Holmes wrote:


Ok now I am able to send the request. I set the post_max_size into 
50M
and now when the request is sent the whole apache goes down 
giving: The
document containd no data everytime I send a request. I tried 
also 10M
but same happens. What the h**l is this?




Do you have this line in your form?

input type=hidden name=MAX_FILE_SIZE value=3

and is it set to a value greater than the size of all the files you're
trying to upload? Some browers actually pay attention to this.

---John Holmes...



No, I don't have that line.





Try it then...

---John  Holmes...



No affect. Still gives the The document contains no data.






 The upload form: (There are ofcourse many of of the first three inputs.)
form action='$PHP_SELF' method='POST' enctype='multipart/form-data'

input class='form' type='text' size='3' name='tracknum[]' value='$tracks'
input class='form' type='text' size='25' name='uartist[]' value='$uartist'
input class='form' type='text' size='25' name='usong[]' value=''


input type='hidden' name='MAX_FILE_SIZE' value='1'
input type='hidden' name='upload' value='yes'
input class='nappi' type='submit' name='submit' value='Upload songs'


And the php part:

$number_of_files = count($_FILES['userfile']);
for ($i=0; $i  $number_of_files; $i++)
 {
  if ($_FILES['userfile']['size'] !== 0)
{
   $namename= $uartist[$i]-$usong[$i].mp3;
   $file=$_FILES['userfile']['tmp_name'][$i];
 if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], 
/mp3/$namename))
  {
   print trtdFile $namename upload and rename 
succesful!/td/tr;
  }
}
else
{
print trtdYou have to upload some files!/td/tr;
}
  }

antti



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



[PHP] another problem with 4.3.0 : imagecreatefromjpeg undefined

2003-01-31 Thread Robert Mena
Hello again,

another problem with 4.3.0. I have gd support but
after the upgrade my scripts started complaing :

Fatal error: Call to undefined function:
imagecreatefromjpeg()

My ./configure (the same used for ages).

'./configure' '--with-apxs' '--with-ttf' '--with-xml'
'--with-gd' '--with-ftp' '--enable-session'
'--enable-trans-sid' '--with-zlib'
'--enable-inline-optimization' '--with-mcrypt'
'--enable-sigchild' '--with-config-file-path=/etc' '--with-freetype'

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Delete files via PHP

2003-01-31 Thread Miguel Brás
Hi guys,

I made a upload file's script and it works fine.

No, I wanna create a page where it will display the directory content and
will let me delete any file standing there.

Is there any way to use php for that? Where can I get info about it?

BTW, I have PHP/MySQL working on a Linux system

Thx in advance
Miguel



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




Re: [PHP] Delete files via PHP

2003-01-31 Thread Øyvind Vestavik

Read the manual first. If you can't find it, search the net (google is a
great place to start). If you still can't find it, _then_ ask on the list.

I had no idea how to do this, but it took me 30 sec to find out, and I'm a
newbie.

http://no.php.net/manual/en/function.unlink.php

vennlig hilsen
Øyvind

On Fri, 31 Jan 2003, Miguel Brás wrote:

 Hi guys,

 I made a upload file's script and it works fine.

 No, I wanna create a page where it will display the directory content and
 will let me delete any file standing there.

 Is there any way to use php for that? Where can I get info about it?

 BTW, I have PHP/MySQL working on a Linux system

 Thx in advance
 Miguel



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



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




[PHP] Global structures (newbie)

2003-01-31 Thread Karina S
Hi,

I'm a beginner in PHP and I want to access some variable all of my php
sites. I want to order them in an array, class,...

Eg.:
User.Name
User.Phone
General.Info
Camera.Type
Camera.Class
...

What is the most secure and beautiful solution for that in PHP?
Can I add an array into the $_SESSION variable?
Any tutorial on the net? I have found some but they always use only username
and userpass. What's in a big project?
An exact example would be a big help for me.

Thanks!



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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread 1LT John W. Holmes
 input type='hidden' name='MAX_FILE_SIZE' value='1'

You're saying you're only uploading 10K total... for all of the files. If
the browser is respecting this, and you're trying to upload more than 10K,
then it could not upload anything and you get your error.

If it was a PHP issue, it seems like you'd get an error or warning from PHP,
not from the web server (which is where document contains no data would
come from, I assume?)

---John Holmes...


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Marek Kilimajer



 The upload form: (There are ofcourse many of of the first three inputs.)
form action='$PHP_SELF' method='POST' enctype='multipart/form-data'

input class='form' type='text' size='3' name='tracknum[]' 
value='$tracks'
input class='form' type='text' size='25' name='uartist[]' 
value='$uartist'
input class='form' type='text' size='25' name='usong[]' value='' 

I assume here should be input class='form' type='file' size='25' 
name='userfile[]'

input type='hidden' name='MAX_FILE_SIZE' value='1'
input type='hidden' name='upload' value='yes'
input class='nappi' type='submit' name='submit' value='Upload songs'


And the php part:

$number_of_files = count($_FILES['userfile']); 

$number_of_files will be 5 if any number of files is uploaded, cause you 
count $_FILES['userfile']['size'], 
$_FILES['userfile']['name'], $_FILES['userfile']['tmp_name'], $_FILES['userfile']['error'] 
and $_FILES['userfile']['type']
You can count  $_FILES['userfile']['tmp_name'] instead


for ($i=0; $i  $number_of_files; $i++)
 {
  if ($_FILES['userfile']['size'] !== 0) 

use $_FILES['userfile']['size'][$i] here



{
   $namename= $uartist[$i]-$usong[$i].mp3;
   $file=$_FILES['userfile']['tmp_name'][$i];
 if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], 
/mp3/$namename))
  {
   print trtdFile $namename upload and rename 
succesful!/td/tr;
  }
}
else
{
print trtdYou have to upload some files!/td/tr;
}
  }

antti





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




RE: [PHP] Introduction

2003-01-31 Thread Julie Williams
Hi Jason,

Sorry, I'm very new to this.  Since my code is not huge, I have included it
below.  I removed some of the text so that it is less bulky.  I hope
everything is clear.  Thanks for your help!


?php
//Build email  Body based on customer request
IF (isset($custemail)) {
   IF ($request_type==Service_Advice) {
  $body = Thank you for your request for service information...;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Service Advice Request, $body, $headers);

  header(Location:index.html);
}
   ELSE IF ($request_type==Parts_Advice) {
 $body = Thank you for your request for parts information...;
 $body .= $comments;
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: [EMAIL PROTECTED]\r\n;
 $headers .= To: .$custemail.\r\n;

 mail($custemail, Your Parts Advice Request, $body, $headers);

 header(Location:index.html);
}
  ELSE IF ($request_type==Parts) {
 IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
 (!isset($part4))  (!isset($part5))  (!isset($part6)))
print (Please go back and include part information!);
 ELSE {
$body = Thank you for your parts request.  The information you
requested is listed below:BRnbsp;BR;
$body .= TABLE;
$body .= TRTHPart #/THTHPart
Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
IF (isset($part1))
   $body .=
TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD
$avail1/TD/TR;
IF (isset($part2))
   $body .=
TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD
$avail2/TD/TR;
IF (isset($part3))
   $body .=
TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD
$avail3/TD/TR;
IF (isset($part4))
   $body .=
TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD
$avail4/TD/TR;
IF (isset($part5))
   $body .=
TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD
$avail5/TD/TR;
IF (isset($part6)){
   $body .=
TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD
$avail6/TD/TR;
   $body .= /TABLE;
   $body .= Our Service departments are located on the following
page:BRnbsp;BR;
   $body .= $comments;
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: [EMAIL PROTECTED]\r\n;
   $headers .= To: .$custemail.\r\n;

   mail($custemail, Your Parts Request, $body, $headers);

   header(Location:index.html);
}
}
   }
   ELSE {
print (Please go back and enter the customer's request type!);
 }
}
ELSE {
  print (Please go back and enter the customer's email address!);
  }
?



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


On Saturday 01 February 2003 00:47, Julie Williams wrote:

 Basically, all the script does (or should do) is build an e-mail to a
 client based on a set of variables defined by the user, using an HTML
form.
  It is also supposed to warn the user with a print message whenever a
 variable is missing.  The form is at the following address:
 http://www.swedishengineering.com/newsite/requestresponse.html

 I've saved the script in text format so that you can look at, it is
located
 at the following address:
 http://www.swedishengineering.com/newsite/requestresponse.rtf

If your code isn't humungous then you should include it (inline, not as an
attachment) with your post. There are many reasons why people would not
click
on a link to see your code (laziness, or fear of being social-engineered to
spread the latest MS-related exploit etc).

If your code _is_ humungous, then a link might be appropriate and note
saying
_why_ you're posting a link would be nice.


Also, your intent to make the code look pretty(?) by converting to RTF seems
misguided. Stick to plain-text.

 The errors are as follows:

 When the customer's e-mail is omitted, a print message should appear, to
 the effect of Hey, you need to specify the e-mail!.  However, when the
 e-mail is omitted *and* one of the options is clicked, the message does
not
 appear, but rather, the user gets re-directed to the index page.

 When the Parts option is chosen, but no parts are indicated, a print
 message should appear to let the user know that a part number needs to be
 entered.  However, the script bypasses this and builds the e-mail anyway.

 I hope this makes sense and would greatly appreciate any help.

It's good you that you explain what you're trying to do, and what you expect
the program to do, and what actually happens instead. 

Re: [PHP] Introduction

2003-01-31 Thread John Nichel
Julie,

What version of PHP?  Where is $custemail coming from, form on another 
page/same page, database?  Global variables on or off in your php.ini?

Julie Williams wrote:
Hi Jason,

Sorry, I'm very new to this.  Since my code is not huge, I have included it
below.  I removed some of the text so that it is less bulky.  I hope
everything is clear.  Thanks for your help!


?php
//Build email  Body based on customer request
IF (isset($custemail)) {
   IF ($request_type==Service_Advice) {
  $body = Thank you for your request for service information...;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Service Advice Request, $body, $headers);

  header(Location:index.html);
	}
   ELSE IF ($request_type==Parts_Advice) {
 $body = Thank you for your request for parts information...;
 $body .= $comments;
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: [EMAIL PROTECTED]\r\n;
 $headers .= To: .$custemail.\r\n;

 mail($custemail, Your Parts Advice Request, $body, $headers);

 header(Location:index.html);
	}
  ELSE IF ($request_type==Parts) {
 IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
 (!isset($part4))  (!isset($part5))  (!isset($part6)))
print (Please go back and include part information!);
 ELSE {
$body = Thank you for your parts request.  The information you
requested is listed below:BRnbsp;BR;
$body .= TABLE;
$body .= TRTHPart #/THTHPart
Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
IF (isset($part1))
   $body .=
TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD
$avail1/TD/TR;
IF (isset($part2))
   $body .=
TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD
$avail2/TD/TR;
IF (isset($part3))
   $body .=
TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD
$avail3/TD/TR;
IF (isset($part4))
   $body .=
TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD
$avail4/TD/TR;
IF (isset($part5))
   $body .=
TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD
$avail5/TD/TR;
IF (isset($part6)){
   $body .=
TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD
$avail6/TD/TR;
   $body .= /TABLE;
   $body .= Our Service departments are located on the following
page:BRnbsp;BR;
   $body .= $comments;
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: [EMAIL PROTECTED]\r\n;
   $headers .= To: .$custemail.\r\n;

   mail($custemail, Your Parts Request, $body, $headers);

   header(Location:index.html);
 	}
	}
   }
   ELSE {
print (Please go back and enter the customer's request type!);
	 }
}
ELSE {
  print (Please go back and enter the customer's email address!);
	  }
?



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


On Saturday 01 February 2003 00:47, Julie Williams wrote:



Basically, all the script does (or should do) is build an e-mail to a
client based on a set of variables defined by the user, using an HTML


form.


It is also supposed to warn the user with a print message whenever a
variable is missing.  The form is at the following address:
http://www.swedishengineering.com/newsite/requestresponse.html

I've saved the script in text format so that you can look at, it is


located


at the following address:
http://www.swedishengineering.com/newsite/requestresponse.rtf



If your code isn't humungous then you should include it (inline, not as an
attachment) with your post. There are many reasons why people would not
click
on a link to see your code (laziness, or fear of being social-engineered to
spread the latest MS-related exploit etc).

If your code _is_ humungous, then a link might be appropriate and note
saying
_why_ you're posting a link would be nice.


Also, your intent to make the code look pretty(?) by converting to RTF seems
misguided. Stick to plain-text.



The errors are as follows:

When the customer's e-mail is omitted, a print message should appear, to
the effect of Hey, you need to specify the e-mail!.  However, when the
e-mail is omitted *and* one of the options is clicked, the message does


not


appear, but rather, the user gets re-directed to the index page.

When the Parts option is chosen, but no parts are indicated, a print
message should appear to let the user know that a part number needs to be
entered.  However, the script bypasses this and builds the e-mail anyway.

I hope this makes sense and would greatly appreciate any 

Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 22:33, 1LT John W. Holmes wrote:
  Ok now I am able to send the request. I set the post_max_size into 50M
  and now when the request is sent the whole apache goes down giving:
   The document containd no data everytime I send a request. I tried
   also 10M but same happens. What the h**l is this?
  
   Do you have this line in your form?
  
   input type=hidden name=MAX_FILE_SIZE value=3
  
   and is it set to a value greater than the size of all the files you're
   trying to upload? Some browers actually pay attention to this.

  No, I don't have that line.

 Try it then...

Please don't perpetuate this urban legend :-)

_Not_ having that line has no effect on uploads (ie does NOT prevent uploads).

However _having_ that line _may_ prevent uploads.

Thus if you have trouble with uploads then you should NOT have that line. As 
most browsers don't give a monkey about that line there is no reason to have 
it, period.


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Ray's Rule of Precision:
Measure with a micrometer.  Mark with chalk.  Cut with an axe.
*/


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




[PHP] How can I... force some HTML tags for all links to jpg files.

2003-01-31 Thread Al
I've got a folder with about 100 jpg files and a menu which a link to 
each one.

Works fine but looks crude.  Obviously, the image shows as a default on 
a white background, located in the upper left.

I'd like to spiffy up the appearance with a background color and 
centering the image. [e.g. with a simple html file or whatever]

I would prefer to not to redo the menu file or the jpgs.

Was hoping there would be a way to do this similar to the Apache
HeaderName directive for folder listings.

I tried in the htaccess file:

IndexOptions +FancyIndexing
AddDescription test text *.jpg

But this doesn't even show the the test text.

Thanks




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



Re: [PHP] Introduction

2003-01-31 Thread Marek Kilimajer
Take a look at http://www.php.net/manual/en/security.registerglobals.php
Basicly you should use $_REQUEST['custemail'] ...

Julie Williams wrote:


Hi Jason,

Sorry, I'm very new to this.  Since my code is not huge, I have included it
below.  I removed some of the text so that it is less bulky.  I hope
everything is clear.  Thanks for your help!


?php
//Build email  Body based on customer request
IF (isset($custemail)) {
  IF ($request_type==Service_Advice) {
 $body = Thank you for your request for service information...;
 $body .= $comments;
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: [EMAIL PROTECTED]\r\n;
 $headers .= To: .$custemail.\r\n;

 mail($custemail, Your Service Advice Request, $body, $headers);

 header(Location:index.html);
	}
  ELSE IF ($request_type==Parts_Advice) {
$body = Thank you for your request for parts information...;
$body .= $comments;
$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: [EMAIL PROTECTED]\r\n;
$headers .= To: .$custemail.\r\n;

mail($custemail, Your Parts Advice Request, $body, $headers);

header(Location:index.html);
	}
 ELSE IF ($request_type==Parts) {
IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
(!isset($part4))  (!isset($part5))  (!isset($part6)))
   print (Please go back and include part information!);
ELSE {
   $body = Thank you for your parts request.  The information you
requested is listed below:BRnbsp;BR;
   $body .= TABLE;
   $body .= TRTHPart #/THTHPart
Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
   IF (isset($part1))
  $body .=
TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD
$avail1/TD/TR;
   IF (isset($part2))
  $body .=
TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD
$avail2/TD/TR;
   IF (isset($part3))
  $body .=
TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD
$avail3/TD/TR;
   IF (isset($part4))
  $body .=
TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD
$avail4/TD/TR;
   IF (isset($part5))
  $body .=
TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD
$avail5/TD/TR;
   IF (isset($part6)){
  $body .=
TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD
$avail6/TD/TR;
  $body .= /TABLE;
  $body .= Our Service departments are located on the following
page:BRnbsp;BR;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Parts Request, $body, $headers);

  header(Location:index.html);
	}
	}
  }
  ELSE {
   print (Please go back and enter the customer's request type!);
   	 }
}
ELSE {
 print (Please go back and enter the customer's email address!);
	  }
?



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


On Saturday 01 February 2003 00:47, Julie Williams wrote:

 

Basically, all the script does (or should do) is build an e-mail to a
client based on a set of variables defined by the user, using an HTML
   

form.
 

It is also supposed to warn the user with a print message whenever a
variable is missing.  The form is at the following address:
http://www.swedishengineering.com/newsite/requestresponse.html

I've saved the script in text format so that you can look at, it is
   

located
 

at the following address:
http://www.swedishengineering.com/newsite/requestresponse.rtf
   


If your code isn't humungous then you should include it (inline, not as an
attachment) with your post. There are many reasons why people would not
click
on a link to see your code (laziness, or fear of being social-engineered to
spread the latest MS-related exploit etc).

If your code _is_ humungous, then a link might be appropriate and note
saying
_why_ you're posting a link would be nice.


Also, your intent to make the code look pretty(?) by converting to RTF seems
misguided. Stick to plain-text.

 

The errors are as follows:

When the customer's e-mail is omitted, a print message should appear, to
the effect of Hey, you need to specify the e-mail!.  However, when the
e-mail is omitted *and* one of the options is clicked, the message does
   

not
 

appear, but rather, the user gets re-directed to the index page.

When the Parts option is chosen, but no parts are indicated, a print
message should appear to let the user know that a part number needs to be
entered.  However, the script bypasses this and builds the e-mail anyway.

I hope this makes sense and would greatly appreciate any help.
   


It's good you that you explain what you're trying 

[PHP] Installing PHP on Apache 2 and FreeBSD

2003-01-31 Thread Jacob Bolton
Hey all,

Here's the situation.  I'm on a server running FreeBSD and Apache 2.
Someone else installed both.  There is software that is running on this
server, that I'm sure is dependent on certain options being compiled into
Apache.

I'm trying to install PHP on the server to make life a little easier with
some scripting.  I don't think SO is compiled into Apache and that obviously
keeps me from compiling PHP as an apache mod.

But if I complile apache and don't include options that are needed for the
software, I'll obviously break the software.

So my question is, is there a way to see what options are compiled into
Apache, so that if I recompiled it, I could make sure to include the current
options that are compiled now?  Thanks in advance everyone!

Jacob Bolton




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




Re: [PHP] PHP - mysql_info question

2003-01-31 Thread Mark McCulligh
Does Nope mean to both my questions.

Does MySQL create a log file of warnings?
and
can PHP call it?

I figure even if MySQL as a log file, PHP can't call it, because the PHP
function mysql_info was only add in 4.3.0

Mark.



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




RE: [PHP] Introduction

2003-01-31 Thread Julie Williams
Hi John,

The variables are coming from a form, located at:

http://www.swedishengineering.com/newsite/requestresponse.html

I don't know what version of PHP or if the global variables are on or off.
I would have to ask the client who their provider is and contact them.  I'm
guessing you're asking me this because you don't see anything wrong with the
script's logic?

Julie

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 8:10 AM
To: Julie Williams
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


Julie,

What version of PHP?  Where is $custemail coming from, form on another
page/same page, database?  Global variables on or off in your php.ini?

Julie Williams wrote:
 Hi Jason,

 Sorry, I'm very new to this.  Since my code is not huge, I have included
it
 below.  I removed some of the text so that it is less bulky.  I hope
 everything is clear.  Thanks for your help!


 ?php
 //Build email  Body based on customer request
 IF (isset($custemail)) {
IF ($request_type==Service_Advice) {
   $body = Thank you for your request for service information...;
   $body .= $comments;
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: [EMAIL PROTECTED]\r\n;
   $headers .= To: .$custemail.\r\n;

   mail($custemail, Your Service Advice Request, $body, $headers);

   header(Location:index.html);
   }
ELSE IF ($request_type==Parts_Advice) {
  $body = Thank you for your request for parts information...;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Parts Advice Request, $body, $headers);

  header(Location:index.html);
   }
   ELSE IF ($request_type==Parts) {
  IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
  (!isset($part4))  (!isset($part5))  (!isset($part6)))
 print (Please go back and include part information!);
  ELSE {
 $body = Thank you for your parts request.  The information you
 requested is listed below:BRnbsp;BR;
 $body .= TABLE;
 $body .= TRTHPart #/THTHPart
 Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
 IF (isset($part1))
$body .=

TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD
 $avail1/TD/TR;
 IF (isset($part2))
$body .=

TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD
 $avail2/TD/TR;
 IF (isset($part3))
$body .=

TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD
 $avail3/TD/TR;
 IF (isset($part4))
$body .=

TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD
 $avail4/TD/TR;
 IF (isset($part5))
$body .=

TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD
 $avail5/TD/TR;
 IF (isset($part6)){
$body .=

TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD
 $avail6/TD/TR;
$body .= /TABLE;
$body .= Our Service departments are located on the following
 page:BRnbsp;BR;
$body .= $comments;
$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: [EMAIL PROTECTED]\r\n;
$headers .= To: .$custemail.\r\n;

mail($custemail, Your Parts Request, $body, $headers);

header(Location:index.html);
   }
   }
}
ELSE {
 print (Please go back and enter the customer's request type!);
}
 }
 ELSE {
   print (Please go back and enter the customer's email address!);
 }
 ?



 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 31, 2003 6:15 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Introduction


 On Saturday 01 February 2003 00:47, Julie Williams wrote:


Basically, all the script does (or should do) is build an e-mail to a
client based on a set of variables defined by the user, using an HTML

 form.

 It is also supposed to warn the user with a print message whenever a
variable is missing.  The form is at the following address:
http://www.swedishengineering.com/newsite/requestresponse.html

I've saved the script in text format so that you can look at, it is

 located

at the following address:
http://www.swedishengineering.com/newsite/requestresponse.rtf


 If your code isn't humungous then you should include it (inline, not as an
 attachment) with your post. There are many reasons why people would not
 click
 on a link to see your code (laziness, or fear of being social-engineered
to
 spread the latest MS-related exploit etc).

 If your code _is_ humungous, then a link might be appropriate and note
 saying
 _why_ you're posting a link would be nice.


 Also, your intent to make 

[PHP] Strange session-problem with php-file in img src

2003-01-31 Thread Victor Spång Arthursson
Hi everyone!

I'm having a severe session problem. I'm having a file called 
createjpg.php that creates a jpg-image and returns it as a picture, 
with the correct header. This file is included on another php-file like 
this:

img src=createjpg.php?id=xyz

What I need the file createjpg.php to do is to check wether or not the 
user is logged in and if she is so, she should be able to see some 
other picture or something that will be processed in the file 
createjpg.php when it executes.

The problem is that since the file createjpg.php is'nt loaded in the 
browser as and ordinary file, it doesnt recognizes the session 
variable… I think it's because that the web server loads it or 
something like that and it does not know that a session variable 
belongs to the user who loaded the file with the img scr on…

Please, help! How can I overcome this?

Best regards,

Victor

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



Re: [PHP] Introduction

2003-01-31 Thread John Nichel
Well, one of the most common problems encountered here is forms / global 
variables.  The form on your page is using the post method, so chances 
are, you need to reference your variables by the global post array, ie

$_POST['custemail']
$_POST['request_type']
etc.

Instead of $custemail and $request_type.  If the form is using the get 
method (or any time variables are being passed in the URL), you'll want 
to use the global get array, ie

$_GET['some_variable']
$_GET['anoter_variable']

Then there's the global request array which will get all types passed to 
the page, ie.

$_REQUEST['some_variable']

You may want to take a look here for a better explanation of variables 
and scope...

http://www.php.net/manual/en/language.variables.scope.php
http://www.php.net/manual/en/language.variables.external.php

Julie Williams wrote:
Hi John,

The variables are coming from a form, located at:

http://www.swedishengineering.com/newsite/requestresponse.html

I don't know what version of PHP or if the global variables are on or off.
I would have to ask the client who their provider is and contact them.  I'm
guessing you're asking me this because you don't see anything wrong with the
script's logic?

Julie

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 8:10 AM
To: Julie Williams
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


Julie,

What version of PHP?  Where is $custemail coming from, form on another
page/same page, database?  Global variables on or off in your php.ini?

Julie Williams wrote:


Hi Jason,

Sorry, I'm very new to this.  Since my code is not huge, I have included


it


below.  I removed some of the text so that it is less bulky.  I hope
everything is clear.  Thanks for your help!


?php
//Build email  Body based on customer request
IF (isset($custemail)) {
  IF ($request_type==Service_Advice) {
 $body = Thank you for your request for service information...;
 $body .= $comments;
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: [EMAIL PROTECTED]\r\n;
 $headers .= To: .$custemail.\r\n;

 mail($custemail, Your Service Advice Request, $body, $headers);

 header(Location:index.html);
	}
  ELSE IF ($request_type==Parts_Advice) {
$body = Thank you for your request for parts information...;
$body .= $comments;
$headers .= MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= From: [EMAIL PROTECTED]\r\n;
$headers .= To: .$custemail.\r\n;

mail($custemail, Your Parts Advice Request, $body, $headers);

header(Location:index.html);
	}
 ELSE IF ($request_type==Parts) {
IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
(!isset($part4))  (!isset($part5))  (!isset($part6)))
   print (Please go back and include part information!);
ELSE {
   $body = Thank you for your parts request.  The information you
requested is listed below:BRnbsp;BR;
   $body .= TABLE;
   $body .= TRTHPart #/THTHPart
Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
   IF (isset($part1))
  $body .=



TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD


$avail1/TD/TR;
   IF (isset($part2))
  $body .=



TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD


$avail2/TD/TR;
   IF (isset($part3))
  $body .=



TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD


$avail3/TD/TR;
   IF (isset($part4))
  $body .=



TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD


$avail4/TD/TR;
   IF (isset($part5))
  $body .=



TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD


$avail5/TD/TR;
   IF (isset($part6)){
  $body .=



TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD


$avail6/TD/TR;
  $body .= /TABLE;
  $body .= Our Service departments are located on the following
page:BRnbsp;BR;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Parts Request, $body, $headers);

  header(Location:index.html);
	}
	}
  }
  ELSE {
   print (Please go back and enter the customer's request type!);
   	 }
}
ELSE {
 print (Please go back and enter the customer's email address!);
	  }
?



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


On Saturday 01 February 2003 00:47, Julie Williams wrote:




Basically, all the script does (or should do) is build an e-mail to a
client based on a set of variables defined by the user, using an HTML


form.



It is also supposed to warn the user with a print message whenever a
variable 

Re: [PHP] .php extensions versus .html

2003-01-31 Thread Chris Shiflett
--- Guru Geek [EMAIL PROTECTED] wrote:
 I was wondering, can you call a php script in the middle
 of a html page?
...
 Does anyone else know how to use php on a page and yet
 keep the .html extension?

Configure your Web server to treat .html files as PHP. This
has been discussed before, so there are probably some
examples in the archives of how to do this.

Chris

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




Re: [PHP] need some guidance

2003-01-31 Thread Seth Hopkins
Yeah, I was thinking more of the HTML way.  With the help you two and some
google searching I see that it will be difficult to pull out specific areas
of a site.

For example ---
The news headlines from yahoo.com

I've got a code that grabs that now.  I just need to tweak it a bit to get
the data to look presentable.

?php

//Define the variables
$url = ;
$start = '';
$end = '';

//Opens the file and pulls out the requested info
$openfile = fopen($url, r);
$file = fread($openfile, 5);
$data = eregi($start(.*)$end, $file, $siteinfo);

//Make it look pretty
$siteinfo[1] = strip_tags($siteinfo[1], img);

fclose($openfile);
echo $siteinfo[1];

?



Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On a major level, create or use a large CMS (content management system),
and
 use the information you have in the databases / file system to establish
 what's new, modified, etc.

 On a smaller level, you could check which files have been updated in X
days
 (I think) with PHP, and display them as a list, which some selective
 listing.

 On a pain-in-the-ass level, you could maintain a HTML page with links on
it
 to things you've recently updated, and maintain it manually.


 If you're talking about *another site* (not yours), it would be even
harder.


 Justin


 on 31/01/03 4:28 PM, Seth Hopkins ([EMAIL PROTECTED]) wrote:

  Hey everyone.  I'm wondering if someone could lead me in the right
direction
  on this one.  What could I use to see if a site has been updated and
then
  display what has been added to it?
 
  Any advice is appreciated.
  Thanks.
 
  Seth
 
 




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




Re: [PHP] Installing PHP on Apache 2 and FreeBSD

2003-01-31 Thread Chris Hewitt
Jacob Bolton wrote:



But if I complile apache and don't include options that are needed for the
software, I'll obviously break the software.

So my question is, is there a way to see what options are compiled into
Apache, so that if I recompiled it, I could make sure to include the current
options that are compiled now?  Thanks in advance everyone!



httpd -l will show options statically compiled.

HTH
Chris


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




Re: [PHP] Unable to upload multiple files

2003-01-31 Thread Antti
1lt John W. Holmes wrote:

input type='hidden' name='MAX_FILE_SIZE' value='1'



You're saying you're only uploading 10K total... for all of the files. If
the browser is respecting this, and you're trying to upload more than 10K,
then it could not upload anything and you get your error.

If it was a PHP issue, it seems like you'd get an error or warning from PHP,
not from the web server (which is where document contains no data would
come from, I assume?)

---John Holmes...



That 10 k is not the right value that I had. I had 10 but just 
edited it and it changed when I pasted it here. So that is not the proglem.

After all these changes it still doesn't work =(...

antti


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



Re: [PHP] Strange_session-problem_with_php-file_in_img_src…

2003-01-31 Thread Chris Shiflett
--- Victor [EMAIL PROTECTED] wrote:
 img src=createjpg.php?id=xyz
...
 The problem is that since the file createjpg.php is'nt
 loaded in the browser as and ordinary file, it doesnt
 recognizes the session variable.

When a browser requests an image, the request is identical
to a request for any other resource, be it a .html file or
a .php script. It will send cookies, URL variables (if they
are in the src attribute as your example shows), and
anything else that a normal request includes.

Instead of trying to tell us what the problem is, just
explain what trouble you are having. We can then tell *you*
what the problem is.

Chris

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




Re: [PHP] Strange_session-problem_with_php-file_in_img_src…

2003-01-31 Thread Victor Spång Arthursson

fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett:


Instead of trying to tell us what the problem is, just
explain what trouble you are having. We can then tell *you*
what the problem is.


Ok, first I have the function

	session_start();

	function return_session_raettighet($session = null)
	{
		if ( isset($session) )
		{
			return $session;
		}
		else
		{
			return 0;
		}
	}

I ask this function to return the value of a specifik session, that is, 
if the user is logged in the value is at least 10.

Then I perform

	if(return_session_raettighet($HTTP_SESSION_VARS[session_raettighet]) 
 10)
	{
		ImageAlphaBlending($img_des, true);
		$im_copy = imagecreatefrompng(const_picture_dir . /copyright.png);
		$copy_imgsize = GetImageSize(const_picture_dir . /copyright.png);
		$copyxloc = (($imgwidth + (2*$kant))/2)-($copy_imgsize[0]/2);
		$copyyloc = (($imgheight + (2*$kant))/2)-($copy_imgsize[1]/2);
		imagecopy($img_des, 
$im_copy,$copyxloc,$copyyloc,0,0,$copy_imgsize[0], $copy_imgsize[1]);
	}

this means, that if the user is not logged in, a copyright © sign will 
appear over the image.

And this fails… Don't know why because the same code works on other 
pages…

Sincerely

Victorr


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



[PHP] php ISA v.s. php CGI

2003-01-31 Thread Victor
What is the difference between PHP ISAPI filter and PHP CGI (which one
would be better to install on IIS 5?)

-thanks,

- vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] Question

2003-01-31 Thread Mike Tuller
I am working from an example in a book that has the following and is 
not explained very well:

# read results of query, then clean up
while ($row = mysql_fetch_row($result))
{
	print (TR\n);
	for ($i = 0; $i  mysql_num_fields ($result); $i++)
	{
		# escape any special characters and print
		printf (TD%s/TD\n, htmlspecialchars ($row[$i]));
	}
	print (/TR\n);
}

I understand most of what is going on here except for this line:

printf (TD%s/TD\n, htmlspecialchars ($row[$i]));

Can someone explain to me what the %s is?

Mike


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



[PHP] Opera form oddity

2003-01-31 Thread bill
I had a browser reporting itself as Opera 7.0  [en] fail recently in submitting
a form.

Specifically, it didn't forward the right value.

Using this html in the form

INPUT TYPE=Radio NAME=detail[1][]   VALUE=4 

The browser sent the value on instead of the value 4.  So, the form couldn't
be processed correctly.

Has anybody encountered this?  Workarounds?


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




Re: [PHP] Question

2003-01-31 Thread 1LT John W. Holmes
[snip]
 I understand most of what is going on here except for this line:

 printf (TD%s/TD\n, htmlspecialchars ($row[$i]));

 Can someone explain to me what the %s is?

www.php.net/sprintf

sprintf() and printf() have the same type of syntax and all of the %s, etc,
are explained on the sprintf() page given above.

---John Holmes...


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




[PHP] Form Processing - Multiple inputs of the same name

2003-01-31 Thread Mike Potter
Is it possible to pass an group of input boxes of the same name, then get
the values of all the checked boxes or filled out textboxes?
How do I get ALL the IDs passed.  Right now it only passes the last ID.  Do
I really have to give them all unique names?

For example...

html
head
/head
body
form action=testform.php method=post
 input type=checkbox value=0 name=DeleteIDs/input Jon Smithbr
 input type=checkbox value=1 name=DeleteIDs/input David Callowbr
 input type=checkbox value=2 name=DeleteIDs/input Peter Parkerbr
.
.
.
input type=submit value=Delete Users
/form
/body
/html

This list of DeleteIDs will be build dynamically.  I want the user to be
able to check the boxes they want to delete and pull the IDs on the posted
page.

How do I get ALL the IDs passed.  Right now it only passes the last ID.

Thanks,

Mike



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




Re: [PHP] Form Processing - Multiple inputs of the same name

2003-01-31 Thread Tracy Finifter Rotton
Change the name of your checkboxes in your HTML to something like:

name=DeleteIDs[]

This will make it an array, and you can access all the elements like

$_POST['DeleteIDs'][0]

etc.



(This should really be in a FAQ somewhere...)

-- tracy

On 1/31/03 11:17 AM, Mike Potter [EMAIL PROTECTED] wrote:

 Is it possible to pass an group of input boxes of the same name, then get
 the values of all the checked boxes or filled out textboxes?
 How do I get ALL the IDs passed.  Right now it only passes the last ID.  Do
 I really have to give them all unique names?
 
 For example...
 
 html
 head
 /head
 body
 form action=testform.php method=post
 input type=checkbox value=0 name=DeleteIDs/input Jon Smithbr
 input type=checkbox value=1 name=DeleteIDs/input David Callowbr
 input type=checkbox value=2 name=DeleteIDs/input Peter Parkerbr
 .
 .
 .
 input type=submit value=Delete Users
 /form
 /body
 /html
 
 This list of DeleteIDs will be build dynamically.  I want the user to be
 able to check the boxes they want to delete and pull the IDs on the posted
 page.
 
 How do I get ALL the IDs passed.  Right now it only passes the last ID.
 
 Thanks,
 
 Mike
 
 

-- 
Tracy F. Rotton
[EMAIL PROTECTED]
http://www.taupecat.com/

  ... I like the 49ers because they're pure of heart,
  Seattle because they've got something to prove,
  and the Raiders because they always cheat.
 -- Lisa Simpson, Lisa the Greek


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




Re: [PHP] Delete files via PHP

2003-01-31 Thread Miguel Brás
Hey, thx for your speech

In a matter of fact, I have 2 books about  PHP and all they say about the
unlink function (I use it in my upload system) is that it is suposed to
force the delete of the temporary file that it is created during the upload
process.

So, i was never thinking that the unlink fuction was able to do it.

Sorry for thge trouble
Miguel

Øyvind vestavik [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

Read the manual first. If you can't find it, search the net (google is a
great place to start). If you still can't find it, _then_ ask on the list.

I had no idea how to do this, but it took me 30 sec to find out, and I'm a
newbie.

http://no.php.net/manual/en/function.unlink.php

vennlig hilsen
Øyvind

On Fri, 31 Jan 2003, Miguel Brás wrote:

 Hi guys,

 I made a upload file's script and it works fine.

 No, I wanna create a page where it will display the directory content and
 will let me delete any file standing there.

 Is there any way to use php for that? Where can I get info about it?

 BTW, I have PHP/MySQL working on a Linux system

 Thx in advance
 Miguel



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




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




Re: [PHP] Form Processing - Multiple inputs of the same name

2003-01-31 Thread Philip Olson

On Fri, 31 Jan 2003, Tracy Finifter Rotton wrote:

 Change the name of your checkboxes in your HTML to something like:
 
 name=DeleteIDs[]
 
 This will make it an array, and you can access all the elements like
 
 $_POST['DeleteIDs'][0]
 
 etc.
 
 (This should really be in a FAQ somewhere...)


Using arrays with forms is in a faq:
  http://www.php.net/manual/en/faq.html.php#faq.html.arrays

How do you feel this should be expanded?  Mentioning that
unchecked checkboxes do not pass values, and that the
default value is 'on' (if checked) ... would be good too.

I remember posting some information on this topic in the past:
  http://marc.theaimsgroup.com/?l=php-generalm=101142826821051
  http://marc.theaimsgroup.com/?l=php-generalm=98576486229922

Anyway, I agree, just not sure if there should be one specific
faq for each form type, such as checkboxes or select boxes or... 
Ideally one faq would explain it for all types, checkboxes or
otherwise.  Making it short/concise and understandable for all
user levels (such as newbies) is the tricky part.  Well,
actually, the tricky part is convincing people to read faqs :)

Regards,
Philip


 On 1/31/03 11:17 AM, Mike Potter [EMAIL PROTECTED] wrote:
 
  Is it possible to pass an group of input boxes of the same name, then get
  the values of all the checked boxes or filled out textboxes?
  How do I get ALL the IDs passed.  Right now it only passes the last ID.  Do
  I really have to give them all unique names?
  
  For example...
  
  html
  head
  /head
  body
  form action=testform.php method=post
  input type=checkbox value=0 name=DeleteIDs/input Jon Smithbr
  input type=checkbox value=1 name=DeleteIDs/input David Callowbr
  input type=checkbox value=2 name=DeleteIDs/input Peter Parkerbr
  .
  .
  .
  input type=submit value=Delete Users
  /form
  /body
  /html
  
  This list of DeleteIDs will be build dynamically.  I want the user to be
  able to check the boxes they want to delete and pull the IDs on the posted
  page.
  
  How do I get ALL the IDs passed.  Right now it only passes the last ID.
  
  Thanks,
  
  Mike
  
  
 
 -- 
 Tracy F. Rotton
 [EMAIL PROTECTED]
 http://www.taupecat.com/
 
   ... I like the 49ers because they're pure of heart,
   Seattle because they've got something to prove,
   and the Raiders because they always cheat.
  -- Lisa Simpson, Lisa the Greek
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




[PHP] Re:_[PHP]_Strange_session-problem_with_php-file_in_img_src…

2003-01-31 Thread Chris Shiflett
--- Victor [EMAIL PROTECTED] wrote:
 I ask this function to return the value of a specifik
 session, that is, if the user is logged in the value
 is at least 10.

...

 this means, that if the user is not logged in, a
 copyright © sign will appear over the image.
 
 And this fails… Don't know why because the same code
 works on other pages…

What exactly is failing? Do you mean that a user who is not
logged in does not see the copyright sign?

If this is so, is the reason because your function is
returning a 0 or because the value of your session variable
is less than 10? I do not understand why you are checking
to make sure it is at least 10, but maybe the sessions are
working fine, and your logic needs a bit of tuning.

Chris

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




[PHP] Followup on form problems

2003-01-31 Thread Julie Williams
Hi everyone,

Well, after much debugging, turns out it was the isset command that was
causing all the problems.  By simply removing that, everything started
working properly.

Thanks to everyone for their input!

Julie Williams

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 8:53 AM
To: Julie Williams
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Introduction


Well, one of the most common problems encountered here is forms / global
variables.  The form on your page is using the post method, so chances
are, you need to reference your variables by the global post array, ie

$_POST['custemail']
$_POST['request_type']
etc.

Instead of $custemail and $request_type.  If the form is using the get
method (or any time variables are being passed in the URL), you'll want
to use the global get array, ie

$_GET['some_variable']
$_GET['anoter_variable']

Then there's the global request array which will get all types passed to
the page, ie.

$_REQUEST['some_variable']

You may want to take a look here for a better explanation of variables
and scope...

http://www.php.net/manual/en/language.variables.scope.php
http://www.php.net/manual/en/language.variables.external.php

Julie Williams wrote:
 Hi John,

 The variables are coming from a form, located at:

 http://www.swedishengineering.com/newsite/requestresponse.html

 I don't know what version of PHP or if the global variables are on or off.
 I would have to ask the client who their provider is and contact them.
I'm
 guessing you're asking me this because you don't see anything wrong with
the
 script's logic?

 Julie

 -Original Message-
 From: John Nichel [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 31, 2003 8:10 AM
 To: Julie Williams
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Introduction


 Julie,

 What version of PHP?  Where is $custemail coming from, form on another
 page/same page, database?  Global variables on or off in your php.ini?

 Julie Williams wrote:

Hi Jason,

Sorry, I'm very new to this.  Since my code is not huge, I have included

 it

below.  I removed some of the text so that it is less bulky.  I hope
everything is clear.  Thanks for your help!


?php
//Build email  Body based on customer request
IF (isset($custemail)) {
   IF ($request_type==Service_Advice) {
  $body = Thank you for your request for service information...;
  $body .= $comments;
  $headers .= MIME-Version: 1.0\r\n;
  $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
  $headers .= From: [EMAIL PROTECTED]\r\n;
  $headers .= To: .$custemail.\r\n;

  mail($custemail, Your Service Advice Request, $body, $headers);

  header(Location:index.html);
  }
   ELSE IF ($request_type==Parts_Advice) {
 $body = Thank you for your request for parts information...;
 $body .= $comments;
 $headers .= MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
 $headers .= From: [EMAIL PROTECTED]\r\n;
 $headers .= To: .$custemail.\r\n;

 mail($custemail, Your Parts Advice Request, $body, $headers);

 header(Location:index.html);
  }
  ELSE IF ($request_type==Parts) {
 IF ((!isset($part1))  (!isset($part2))  (!isset($part3))
 (!isset($part4))  (!isset($part5))  (!isset($part6)))
print (Please go back and include part information!);
 ELSE {
$body = Thank you for your parts request.  The information you
requested is listed below:BRnbsp;BR;
$body .= TABLE;
$body .= TRTHPart #/THTHPart
Name/THTHPrice/THTHShipping/THTHAvailability/TH/TR;
IF (isset($part1))
   $body .=



TRTD$part1/TDTD$partname1/TDTD$price1/TDTD$sprice1/TDTD

$avail1/TD/TR;
IF (isset($part2))
   $body .=



TRTD$part2/TDTD$partname2/TDTD$price2/TDTD$sprice2/TDTD

$avail2/TD/TR;
IF (isset($part3))
   $body .=



TRTD$part3/TDTD$partname3/TDTD$price3/TDTD$sprice3/TDTD

$avail3/TD/TR;
IF (isset($part4))
   $body .=



TRTD$part4/TDTD$partname4/TDTD$price4/TDTD$sprice4/TDTD

$avail4/TD/TR;
IF (isset($part5))
   $body .=



TRTD$part5/TDTD$partname5/TDTD$price5/TDTD$sprice5/TDTD

$avail5/TD/TR;
IF (isset($part6)){
   $body .=



TRTD$part6/TDTD$partname6/TDTD$price6/TDTD$sprice6/TDTD

$avail6/TD/TR;
   $body .= /TABLE;
   $body .= Our Service departments are located on the following
page:BRnbsp;BR;
   $body .= $comments;
   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type: text/html; charset=iso-8859-1\r\n;
   $headers .= From: [EMAIL PROTECTED]\r\n;
   $headers .= To: .$custemail.\r\n;

   mail($custemail, Your Parts Request, $body, $headers);

   header(Location:index.html);
  }
  }
   }
   ELSE {
print (Please go back and enter the customer's request type!);
   }
}
ELSE {
  print (Please go back and enter the 

Re: [PHP] Followup on form problems

2003-01-31 Thread 1LT John W. Holmes
 Well, after much debugging, turns out it was the isset command that was
 causing all the problems.  By simply removing that, everything started
 working properly.
 
 Thanks to everyone for their input!

IT COMPILES! Ship it!

---John Holmes...

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




Re: [PHP] Followup on form problems

2003-01-31 Thread 1LT John W. Holmes
 Well, after much debugging, turns out it was the isset command that was
 causing all the problems.  By simply removing that, everything started
 working properly.

 Thanks to everyone for their input!

It will also work if you replace all of your code with ? echo hello
world; ?, but is that a solution, either?

---John  Holmes...


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




[PHP] Installation problems

2003-01-31 Thread Jacob Bolton
I wrote earlier and got an answer to question, but I just seem to be
stumped.  I'm installing PHP 4.3.0 on a FreeBSD server running Apache 2.44
as a module.

I've gone through all of the installation steps verbatim at the PHP site and
a few of the recommended installation sites.

I've done the following:
1. Apache is installed correctly with mod_so
2. I've correctly done the following configure commands with no errors:

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-track-vars \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
makemake install3. I copied the libphp4.so to the modules directory in
Apache4. Copied the php.ini file to /usr/local/apache/php5. Added the
following lines to my httpd.conf file.LoadModule php4_module
modules/libphp4.so

AddType application/x-httpd-php php
Files *.php
SetOutputFilter PHP
SetInputFilter PHP
/Files

# PHP Syntax Coloring (recommended):
AddType application/x-httpd-php-source phps
Files *.phps
SetOutputFilter PHP
SetInputFilter PHP
/Files6. Completely stopped and restarted Apache7. Tried rebooting the
serverAfter all of this with no errors, I still can't get a simple php file
to display the phpinfo() function.  Anybody have any ideas what I'm doing
wrong or forgetting to do?  It's ok to not assume the obvious.  I'm still
sort of a newbie.  Thanks!Jacob Bolton



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




[PHP] move a record into a different table

2003-01-31 Thread DC
Hi all,

I want to delete a record from my table 1, but would like all the data for
that single record passed onto my (archive) table 2 at  the same time
Sounds easy!!

Any ideas??

Thanks

DC








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




[PHP] doing auto number myself to a primary key...

2003-01-31 Thread Mr. BuNgL3
 $sql=SELECT TOP(id) FROM divxtemp;
 $res=mysql_db_query(DB,$sql) or die (mysql_error());
 $reg=mysql_fetch_array($res);
 $id=$reg[id]+1;
 $sql=INSERT INTO divxtemp (titulo,cds,id) VALUES
('$titulotxt','$cdstxt','$id');
 mysql_db_query(DB,$sql) or die (mysql_error());

the id is always 1 so he can't save duplicate keys...

what i'm doing wrong? : \

thanks...




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




[PHP] Script to export MySQL structure data

2003-01-31 Thread Janos Rusiczki
Hello,

I'm looking for a premade PHP script / class or a tutorial on how to 
export the structure and data of a few given MySQL tables as seen in 
phpMyAdmin.

Any ideeas would be also appreciated.

I searched the major web sites (like hotscripts.com, phpclasses.org) and 
this list's archive but I still couldn't find any real answer for my 
problem.

-j-


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



[PHP] Re: move a record into a different table

2003-01-31 Thread Mr. BuNgL3
put the data into variables, erase the record and then create a new one in
the new table with the variable values!

Dc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I want to delete a record from my table 1, but would like all the data for
 that single record passed onto my (archive) table 2 at  the same time
 Sounds easy!!

 Any ideas??

 Thanks

 DC










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




Fw: [PHP] doing auto number myself to a primary key...

2003-01-31 Thread Kevin Stone
In MySQL you use MAX() to retrieve the maximum value from a column.

`SELECT MAX(id) as id FROM divxtemp`

-Kevin

- Original Message - 
From: Mr. BuNgL3 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 2:31 PM
Subject: [PHP] doing auto number myself to a primary key...


  $sql=SELECT TOP(id) FROM divxtemp;
  $res=mysql_db_query(DB,$sql) or die (mysql_error());
  $reg=mysql_fetch_array($res);
  $id=$reg[id]+1;
  $sql=INSERT INTO divxtemp (titulo,cds,id) VALUES
 ('$titulotxt','$cdstxt','$id');
  mysql_db_query(DB,$sql) or die (mysql_error());
 
 the id is always 1 so he can't save duplicate keys...
 
 what i'm doing wrong? : \
 
 thanks...
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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




Re: [PHP] Script to export MySQL structure data

2003-01-31 Thread Brent Baisley
I'm pretty sure you're looking in the wrong place. The command you are 
looking for is mysqldump and it is part of the mysql command set. With 
the right parameters it will create a file that can be used to restore 
your entire database to a working state.
I'm not sure how PHPAdmin does it. I use a shell script and cron to run 
the command nightly and then ftp the file to another machine. Cheap and 
easy backup.

On Friday, January 31, 2003, at 04:36 PM, Janos Rusiczki wrote:

I'm looking for a premade PHP script / class or a tutorial on how to 
export the structure and data of a few given MySQL tables as seen in 
phpMyAdmin.
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




[PHP] Help Needed

2003-01-31 Thread Pushpinder Singh Garcha
Hello All:

I am using PHP and MySQL in my application. I need to be able to allow 
ONLY authorized users access to some pages in the site. For this I am 
creating a session variable ''$valid_user, after the user has 
successfully authenticated himself with the Database. The pages that 
need to be protected are all HTML files. So far everything, works fine. 
I am wondering how to finally deploy the logic on all the pages that 
need to be protected.

Here is my point of view.

1). Change all the names of the protected documents to .php
2). Use the following script:


? session_start(); ?

if (session_is_registered($valid_user)) {

  // show the original page

PLEASE TELL me a way to display the same page

}


elseif  (!session_is_registered($valid_user)) {

 // display an error message to the user asking him to login before he 
can see this page

}

many thanks
--Pushpinder Singh


Pushpinder Singh Garcha
_
Web Architect


Fw: [PHP] move a record into a different table

2003-01-31 Thread Kevin Stone
Sorry but as convenient as PHP and MySQL are there are some things you just
have to code for yourself.  In order to move data from one table to another
you will have to:

1) SELECT the desired fields from the first table
2) extract() them from the results pointer
3) INSERT them into the second table
4) DELETE the originals from the first table

If you need any help with any part of this feel free to ask.

-Kevin

Consider reposting this to the PHP-DB list for further help.

- Original Message -
From: DC [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 2:29 PM
Subject: [PHP] move a record into a different table


 Hi all,

 I want to delete a record from my table 1, but would like all the data for
 that single record passed onto my (archive) table 2 at  the same time
 Sounds easy!!

 Any ideas??

 Thanks

 DC








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





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




Re: [PHP] Help Needed

2003-01-31 Thread Kevin Stone
Pervasive login methods such as the one you've devised are the best way to
have a password protected region on your website.  However it will only work
on pages that are parsed by PHP.  In order to protect plain text or HTML
files they will have to be stored outside of your public directory and
either included() or fopened() into the PHP script that has authenticated
the user.
-Kevin


- Original Message -
From: Pushpinder Singh Garcha [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 3:09 PM
Subject: [PHP] Help Needed


 Hello All:

 I am using PHP and MySQL in my application. I need to be able to allow
 ONLY authorized users access to some pages in the site. For this I am
 creating a session variable ''$valid_user, after the user has
 successfully authenticated himself with the Database. The pages that
 need to be protected are all HTML files. So far everything, works fine.
 I am wondering how to finally deploy the logic on all the pages that
 need to be protected.

 Here is my point of view.

 1). Change all the names of the protected documents to .php
 2). Use the following script:


  ? session_start(); ?

 if (session_is_registered($valid_user)) {

// show the original page

 PLEASE TELL me a way to display the same page

 }


 elseif  (!session_is_registered($valid_user)) {

   // display an error message to the user asking him to login before he
 can see this page

 }

 many thanks
 --Pushpinder Singh


 Pushpinder Singh Garcha
 _
 Web Architect




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




Re: [PHP] move a record into a different table

2003-01-31 Thread Paul Roberts
so how about

With INSERT ... SELECT statement you can quickly insert many rows into a table from 
one or many tables.


INSERT INTO tblTemp2 (fldID) SELECT tblTemp1.fldOrder_ID FROM tblTemp1 WHERE
tblTemp1.fldOrder_ID  100;

from the mysql manual

Best Wishes

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: Kevin Stone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 10:08 PM
Subject: Fw: [PHP] move a record into a different table


Sorry but as convenient as PHP and MySQL are there are some things you just
have to code for yourself.  In order to move data from one table to another
you will have to:

1) SELECT the desired fields from the first table
2) extract() them from the results pointer
3) INSERT them into the second table
4) DELETE the originals from the first table

If you need any help with any part of this feel free to ask.

-Kevin

Consider reposting this to the PHP-DB list for further help.

- Original Message -
From: DC [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 31, 2003 2:29 PM
Subject: [PHP] move a record into a different table


 Hi all,

 I want to delete a record from my table 1, but would like all the data for
 that single record passed onto my (archive) table 2 at  the same time
 Sounds easy!!

 Any ideas??

 Thanks

 DC








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





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





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




Re: [PHP] Script to export MySQL structure data

2003-01-31 Thread Janos Rusiczki
I knew the mysqldump method. I'm using it frequently. My problem is that
I'm writing this script for a client and I do not have shell access to
his host. Or should I run mysqldump from PHP? I want a general
solution which could be re-usable an all hosts wheter I can access
mysqldump or not.

So, a script or ideeas from somebody who already did this would be
really appreciated. Otherwise I have no other alternative than mining
the phpMyAdmin sourcecode.

Brent Baisley wrote:


I'm pretty sure you're looking in the wrong place. The command you are 
looking for is mysqldump and it is part of the mysql command set. With 
the right parameters it will create a file that can be used to restore 
your entire database to a working state.
I'm not sure how PHPAdmin does it. I use a shell script and cron to 
run the command nightly and then ftp the file to another machine. 
Cheap and easy backup.

On Friday, January 31, 2003, at 04:36 PM, Janos Rusiczki wrote:

I'm looking for a premade PHP script / class or a tutorial on how to 
export the structure and data of a few given MySQL tables as seen in 
phpMyAdmin.

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577






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




[PHP] new to php/mysql

2003-01-31 Thread Sam
hi,

i'm new to this php/mysql thing - i've defected microsoft.
when trying to pull data from a table in mysql, i get the following error:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
result resource in C:\cn\test.php on line 24


is this an error from my php page or do i not have all of the php components
installed?

thanks for your help.



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




Re: [PHP] new to php/mysql

2003-01-31 Thread Matt

Sam [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i'm new to this php/mysql thing - i've defected microsoft.
 when trying to pull data from a table in mysql, i get the following error:

 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
 result resource in C:\cn\test.php on line 24


1. echo out the sql statement and look at it to see what's wrong.
2. echo out mysql_error() and see what that does to help
3. Check the return value of mysql_query after each exec, a failed query
means bad sql, mysql_error says what.



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




Re: [PHP] new to php/mysql

2003-01-31 Thread Janos Rusiczki
Most probably you have an error in your MySQL query or you are trying to 
fetch rows from the connection identifier.
But why don't you post the code which generated this error? How can we 
guess what's wrong in it elseway?

Sam wrote:

   Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
result resource in C:\cn\test.php on line 24




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




[PHP] how can I start running a perl cgi from php

2003-01-31 Thread qt
Dear Sirs,

I want to run a perl script with a command in my php script. I think
include() is not suitable to run perl script. When I use include(), it
brings source of the perl script.

Would you help me which command is very usefull for that purpose.

Best Regards




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




RE: [PHP] doing auto number myself to a primary key...

2003-01-31 Thread John W. Holmes
  $sql=SELECT TOP(id) FROM divxtemp;
  $res=mysql_db_query(DB,$sql) or die (mysql_error());
  $reg=mysql_fetch_array($res);
  $id=$reg[id]+1;
  $sql=INSERT INTO divxtemp (titulo,cds,id) VALUES
 ('$titulotxt','$cdstxt','$id');
  mysql_db_query(DB,$sql) or die (mysql_error());
 
 the id is always 1 so he can't save duplicate keys...

I hope you having some locking around where you select the ID and then
insert it... otherwise you're asking for trouble.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

PS: You're problem is $reg[id]+1 should be $reg[TOP(id)]+1 or use AS
in your query: SELECT TOP(id) AS id ...



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




RE: [PHP] Unable to upload multiple files

2003-01-31 Thread John W. Holmes
 input class='form' type='text' size='3' name='tracknum[]'
 value='$tracks'
 input class='form' type='text' size='25' name='uartist[]'
 value='$uartist'
 input class='form' type='text' size='25' name='usong[]' value=''
 
 
 input type='hidden' name='MAX_FILE_SIZE' value='1'
 input type='hidden' name='upload' value='yes'
 input class='nappi' type='submit' name='submit' value='Upload songs'
 
 
 And the php part:
 
 $number_of_files = count($_FILES['userfile']);
 for ($i=0; $i  $number_of_files; $i++)
   {
if ($_FILES['userfile']['size'] !== 0)
  {
 $namename= $uartist[$i]-$usong[$i].mp3;
 $file=$_FILES['userfile']['tmp_name'][$i];
   if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i],
 /mp3/$namename))
{
 print trtdFile $namename upload and rename
  succesful!/td/tr;
}
  }
  else
  {
  print trtdYou have to upload some files!/td/tr;
  }
}

You don't even have a file form element, or an element named
userfile so your FOR loop will never run...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] Re: Script to export MySQL structure data

2003-01-31 Thread Mark McCulligh
When you do a sql select command, an option is to have the result exported
to a file.

Example:
SELECT name, addr, phone
INTO OUTFILE '/tmp/result.txt'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ''
 LINE TERMINATED BY '\n'
FROM customer

There are other export options that you can use to control the export file
format.
Look at MySQL Manual 6.4.1

What to you need the structure to look like. Are you trying to build
something that looks like the mysqldump results.

I have written a PHP function that does the opposite of what you are trying
to do.  A PHP page that a user can upload a file and then I use the LOAD
DATA mysql command to insert the files data.

Mark.

Janos Rusiczki [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I'm looking for a premade PHP script / class or a tutorial on how to
 export the structure and data of a few given MySQL tables as seen in
 phpMyAdmin.

 Any ideeas would be also appreciated.

 I searched the major web sites (like hotscripts.com, phpclasses.org) and
 this list's archive but I still couldn't find any real answer for my
 problem.

 -j-




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




Re: [PHP] how can I start running a perl cgi from php

2003-01-31 Thread Jason Wong
On Saturday 01 February 2003 06:00, qt wrote:
 Dear Sirs,

 I want to run a perl script with a command in my php script. I think
 include() is not suitable to run perl script. When I use include(), it
 brings source of the perl script.

 Would you help me which command is very usefull for that purpose.

Did you even try looking in the manual? Program Execution functions?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I've read SEVEN MILLION books!!
*/


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




Re: [PHP] Delete files via PHP

2003-01-31 Thread Jason Wong
On Saturday 01 February 2003 03:23, Miguel Brás wrote:
 Hey, thx for your speech

 In a matter of fact, I have 2 books about  PHP and all they say about the
 unlink function (I use it in my upload system) is that it is suposed to
 force the delete of the temporary file that it is created during the upload
 process.

 So, i was never thinking that the unlink fuction was able to do it.

Could you tell us which books they are? They seem to be giving very poor 
advice. Uploaded files are _automatically_ deleted when the script ends. 
There is no need to force deletion of those temporary files.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The best laid plans of mice and men are held up in the legal department.
*/


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




Re: [PHP] another problem with 4.3.0 : imagecreatefromjpeg undefined

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 23:22, Robert Mena wrote:
 Hello again,

 another problem with 4.3.0. I have gd support but
 after the upgrade my scripts started complaing :

 Fatal error: Call to undefined function:
 imagecreatefromjpeg()

 My ./configure (the same used for ages).

 './configure' '--with-apxs' '--with-ttf' '--with-xml'
 '--with-gd' '--with-ftp' '--enable-session'
 '--enable-trans-sid' '--with-zlib'
 '--enable-inline-optimization' '--with-mcrypt'
 '--enable-sigchild' '--with-config-file-path=/etc' '--with-freetype'

You probably need to add --with-jpeg-dir as well (and make sure you really 
do have libjpeg installed).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To love is good, love being difficult.
*/


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




[PHP] I would like to display a list of the same products only if productPublic = staff or members.

2003-01-31 Thread Philip J. Newman
I would like to list 2 possable items in a mysql queary.

SELECT * FROM products WHERE productType = '$productType AND Where
productPublic = 'staff' OR productPublic = 'members' ORDER BY productId DESC
LIMIT 10

I would like to display a list of the same products only if productPublic =
staff or members.

At the moment what i have just gives me the 1st 10 items.

Any help





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




  1   2   >