[PHP] Re: mysql_insert_id

2002-09-11 Thread Erwin

Clemson Chan wrote:
> Hi guys,
>
> I never can get mysql_insert_id?
> Is this broken with PHP4?
> Please let me know if you can get it to work. or work around.

It works here, but it returns only an ID if the table in which you add a
record has a AutoIncrement column, because it will returns the value of the
AutoIncrement column.

HTH
Erwin


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




[PHP] connection with bibit (XML)

2002-09-11 Thread Wilbert Enserink

Hi all,


I am trying to set up a connection between my site and a payment system (bibit). Does 
anybody know some good URL's which can help set up the connection and parse all XML 
messages. I'm sure this must have been done before...so there should be no reason to 
invent the wheel again.

thx. Wilbert

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


[PHP] Re: Dependent Dropdown Boxes

2002-09-11 Thread lallous

Hi,

Try to learn many things from the test code i created below:

http://lgwm.org/ozone/dynatable.htm

Good luck,

Elias

"Roger Lewis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The Situation:
>
> I'm trying to create a pair of dynamic dropdown boxes where the options in
> the second box are dependent on the selection in the first box.  I call
the
> first box "categories" and the second, "subcategories".  I want to store
the
> categories and subcategories in a mysql table(s) so that a user can
> dynamically update them.  Currently, I have a single table called
> categories, with columns: id, category, and subcategory.
>
> The primary code for selecting the options for the second box is in
> javascript.  This code makes use of the following datasets for storing the
> various categories and subcategories.  If I can get php to generate this
> text, then the dependent boxes will work.
>
> datasets=new Array();
>
datasets[0]="Category1,subCategory1_1,subCategory1_2,subCategory1_3,subCateg
> ory1_4".split(",");
>
datasets[1]="Category2,subCategory2_1,subCategory2_2,subCategory2_3".split("
> ,");
> datasets[2]="Category3,subCategory3_1, subCategory3_2,
> subCategory3_3,subCategory3_4,subCategory3_5".split(",");
>
datasets[3]="Category4,subCategory4_1,subCategory4_2,subCategory4_3,subCateg
> ory4_4".split(",");
>
datasets[4]="Category5,subCategory5_1,subCategory5_2,subCategory5_3,subCateg
> ory5_4,subCategory5_5,subCategory5_6".split(",");
> etc.
>
> The Problem:
>
> Using the following code I can get php to print the results, but only in a
> line-by-line, category/subcategory format.  Of course, this is NOT what is
> needed.  Each subcategory name should be on the same line as its
associated
> category.
>
>  $dbConnect = mysql_connect("localhost", "root", "pwd");
> mysql_select_db("new_kb",$dbConnect);
> $sql = "SELECT * from categories";
> $result = mysql_query($sql);
> for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
> {
> print "datasets[$count]=\"";
> print "$row[1],";
> print "$row[2]\"";
> }
> ?>
>
>
> datasets[0]="Category1,subCategory1_1
> datasets[1]="Category1,subCategory1_2
> datasets[2]="Category1,subCategory1_3
> datasets[3]="Category1,subCategory1_4
> datasets[4]="Category2,subCategory2_1
> datasets[5]="Category2,subCategory2_2
> etc.
>
> Can someone explain how to write the php code to output the category and
> subcategory names from the mysql table to match the javascript format
above.
>
> Thanks in advance for any help or suggestions.
>
> Roger Lewis
>
>
>



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




[PHP] not passing arguments from HTTP GET?

2002-09-11 Thread Mark Setzer

Hi all,

I am running PHP 4.2.2 on Apache 1.3.26 under MacOS X 10.2. My scripts' 
functionality seems to have gone amok, and while I am not sure this is 
the fault of php directly, I was hoping someone could help me track 
down the problem.

Basically, if I have a script that I pass arguments to on a get 
request, the argument seems to be processed (ie, it is found in 
$_SERVER["argv"][0]), but the actual argument itself has no effect. For 
example, I have a script that checks for a date variable:

if ($date) { print $date; }

and when I call it by loading http://www.../date.php?date=2002-09-11 - 
the script produces nothing, even though the argv(0) is 
"date=2002-09-11". What's at fault here, any ideas? I am using a binary 
distro (it's linked from the php site) for OSX, but I've used it in the 
past and never encountered such a problem. Other PHP functionality 
seems fine, so I don't think my webserver is in error. The code seems 
ridiculously simple.

Head-scratcher.

Thanks for any help,
Mark


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




Re: [PHP] header() problem!!!!

2002-09-11 Thread Jim lucas

This is not a bug.  This is just one of many differances between the big
browser war.  With Netscape (not sure which versions), the attachment thing
I found is required.  But with IE it kills the browser.


- Original Message -
From: "xdrag" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, September 07, 2002 7:38 PM
Subject: [PHP] header() problem


> Hi:
> is this a bug?
> [win98se + apache2.0.40 + PHP4.2.3 + IE6.0]
>
> download1.php:
>  ...
> header("Cache-Control: no-cache, must-revalidate");
> header("Content-Type:".$mime_type);
> header("Content-Disposition: filename=$filename");
> echo $filedata;
> ?>
> works well
>
> download2.php:
>  ...
> header("Cache-Control: no-cache, must-revalidate");
> header("Content-Type:".$mime_type);
> header("Content-Disposition: attachment; filename=$filename");
> echo $filedata;
> ?>
> please pay attention to header("Content-Disposition: ...")
> if you click this URL, for example "download2.php?id=1", then click the
"save" button,
> your browser will suffer a fatal error. You can not do anything else now!
>



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




[PHP] sessions nightmare

2002-09-11 Thread Chris

Greetings,

I am a new user to php and sessions and for the life of me I
cannot figure this out

I want to be able to have a user login (which is completed), they goto a
search page (completed), and search for a particular item (completed). A
page will display all the links for the items searched for (completed).
What I want out of sessions is to when they click on the link for a
particular item, the item number stay in a session so it can be called
through out each page they goto. What I have as a base of test code is the
following (this was taken from someone's example):

test1.php:



Goto next page


test2.php:





After you click the hyperlink on test1.php, test2.php will load and the
session ID is in the URL, but nothing is displayed in the echo for
$SESSION[item] in test2.php. What is going on?!#!#!$#


Thanks a million in advance!!
- Chris



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




Re: [PHP] sessions nightmare

2002-09-11 Thread John Wards

I can't see anything sticking out...but why have you done this...

$test2Url = "test2.php?PHPSESSID=" . session_id(  );

You don't need to do this. Try doing this

$test2Url = "test2.php";

Your server might be set up to use a different name for sessions

John Wards
SportNetwork.net
- Original Message -
From: "Chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 9:47 AM
Subject: [PHP] sessions nightmare


> Greetings,
>
> I am a new user to php and sessions and for the life of me I
> cannot figure this out
>
> I want to be able to have a user login (which is completed), they goto a
> search page (completed), and search for a particular item (completed). A
> page will display all the links for the items searched for (completed).
> What I want out of sessions is to when they click on the link for a
> particular item, the item number stay in a session so it can be called
> through out each page they goto. What I have as a base of test code is the
> following (this was taken from someone's example):
>
> test1.php:
>
>  session_start(  );
> session_register("SESSION");
>
> *** THE FOLLOWING VARIABLE ($retrived_itemno) WOULD NEED TO BE SET ON THE
> *** SEARCH PAGE ***
> $SESSION["item"] = $retrived_itemno;
>
> $test2Url = "test2.php?PHPSESSID=" . session_id(  );
>
> ?>
>
> Goto next page
>
>
> test2.php:
>
>  session_start( );
> echo "the retrived value equals: $SESSION[item]";
> ?>
>
>
>
> After you click the hyperlink on test1.php, test2.php will load and the
> session ID is in the URL, but nothing is displayed in the echo for
> $SESSION[item] in test2.php. What is going on?!#!#!$#
>
>
> Thanks a million in advance!!
> - Chris
>
>
>
> --
> 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: Help, Parse error caused by quotes andapostrophes in function, How do I fix this?

2002-09-11 Thread lallous

try this:

exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill red -gravity
southeast -draw "text 10,10 \'my text to add to picture\'"
text-overlay.jpg');

when you start with a single quote -> you have to end with a single quote
while escaping (using "\") all its occurences in the used string.

Elias,

"Kurtis Harper" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The following is the format needed in order to run the convert command
from
> command line, but I have a problem in exec() format:
>
>
>
> convert picture.jpg  -font Arial-Bold -pointsize 20 -fill red -gravity
> southeast -draw "text 10,10 'my text to add to picture'" text-overlay.jpg
>
>
>
>
> this causes problems "Parse error: parse error, unexpected T_STRING":
>
>
>
> exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill
red -gravity
> southeast -draw "text 10,10 'my text to add to picture'"
text-overlay.jpg');
>
>
>
> I am positive the it is due to all the "s and 's within the command, I
have
> tried the specialchars for quotes andapostrophes but I am still missing
> something:
>
>
>
> exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill
red -gravity
> southeast -draw "text 10,10 \'my text to add to picture\'"
> text-overlay.jpg');
>
>
>
> If anyone has any ides on how to avoid probles with quotes andapostrophes
> inside the exec() I am all ears :o)
>
>
>
>
>
> Thanks
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
>
>



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




[PHP] Re: sessions nightmare

2002-09-11 Thread lallous

I use JavaScript cookie to accomplish what you're doing in your case:


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
  ((expires) ? "; expires=" + expires.toGMTString() : "") +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "") +
  ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function nav(value)
{
  setCookie('searcheditem', value);
  location.replace('after-search-click.php');
}


now in my search result display i do:

.
.
then in whatever page I want the search result item, i access it as:
$searchitem (as named in setCookie() call)


good luck,
Elias


"Chris" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greetings,
>
> I am a new user to php and sessions and for the life of me I
> cannot figure this out
>
> I want to be able to have a user login (which is completed), they goto a
> search page (completed), and search for a particular item (completed). A
> page will display all the links for the items searched for (completed).
> What I want out of sessions is to when they click on the link for a
> particular item, the item number stay in a session so it can be called
> through out each page they goto. What I have as a base of test code is the
> following (this was taken from someone's example):
>
> test1.php:
>
>  session_start(  );
> session_register("SESSION");
>
> *** THE FOLLOWING VARIABLE ($retrived_itemno) WOULD NEED TO BE SET ON THE
> *** SEARCH PAGE ***
> $SESSION["item"] = $retrived_itemno;
>
> $test2Url = "test2.php?PHPSESSID=" . session_id(  );
>
> ?>
>
> Goto next page
>
>
> test2.php:
>
>  session_start( );
> echo "the retrived value equals: $SESSION[item]";
> ?>
>
>
>
> After you click the hyperlink on test1.php, test2.php will load and the
> session ID is in the URL, but nothing is displayed in the echo for
> $SESSION[item] in test2.php. What is going on?!#!#!$#
>
>
> Thanks a million in advance!!
> - Chris
>
>



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




[PHP] Re: sessions nightmare

2002-09-11 Thread Erwin

> I want to be able to have a user login (which is completed), they
> goto a search page (completed), and search for a particular item
> (completed). A page will display all the links for the items searched
> for (completed). What I want out of sessions is to when they click on
> the link for a particular item, the item number stay in a session so
> it can be called through out each page they goto. What I have as a
> base of test code is the following (this was taken from someone's
> example):
>
> test1.php:
>
>  session_start(  );
> session_register("SESSION");
>
> *** THE FOLLOWING VARIABLE ($retrived_itemno) WOULD NEED TO BE SET ON
> THE *** SEARCH PAGE ***
> $SESSION["item"] = $retrived_itemno;

> test2.php:
>
>  session_start( );
> echo "the retrived value equals: $SESSION[item]";
> ?>

In test2.php:
Your echo line is incorrect. $SESSION[item] is not defined, $SESSION["item"]
probably is...but why are you storing an array in a session?

Try using $_SESSION instead of session_register, e.g.:

test1.php:
$SESSION["item"] = $retrieved_itemno;
$_SESSION["SESSION"] = $SESSION;

test2.php:
$SESSION= $_SESSION["SESSION"];
echo "The retrieved value equals to " . $SESSION["item"];

HTH
Erwin


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




Re: [PHP] Strore Data in File

2002-09-11 Thread Marek Kilimajer

You may use either dBase ( http://www.php.net/manual/en/ref.dbase.php ) or 

http://www.php.net/manual/en/ref.dba.php



Ram K wrote:

> Hi
>
> I want to store the data of a table in a file and read that file just 
> as one would read a table. For e.g. I have a table t_data with cols 
> name,number,cost and my data file data.txt would have the following data:
> ---
> john,1,100
> mark,2,200
> spencer,3,200
> ---
>
> Now on the web page when the visitor clicks on a link on "john" then 
> this file (data.txt) must be read and the data should be displayed for 
> "john" i.e.
> name = john
> number = 1
> cost = 100
> must be displayed
>
> Can anyone please give me the code to parse this file and read the 
> data for john and get all the data for that row. Please see that 
> "john" functions as the primary key in the table
>
> Regards
> Ram
>
>
> __
> Give your Company an email address like
> ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
> Know more. http://www.rediffmailpro.com/signup/
>
>


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




[PHP] Re: sessions nightmare

2002-09-11 Thread Philippe Saladin

Your variable in session is called "Item", so session_register("SESSION") is
wrong. It should be session_register("Item"). But, as you use directly the
new syntax ($_SESSION) to affect the variable, you don't need
session_register. The variable "Item" will be automatically registered when
you write $_SESSION["Item"] = $retrived_itemno;
And, be careful for the typo : it is $_SESSION["Item"] and not
$SESSION[Item] (notice the _ and the "").
Regards,
Philippe

A tip : display what is in your session with this code :
echo '';
print_r($_SESSION);
echo '';



"Chris" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> Greetings,
>
> I am a new user to php and sessions and for the life of me I
> cannot figure this out
>
> I want to be able to have a user login (which is completed), they goto a
> search page (completed), and search for a particular item (completed). A
> page will display all the links for the items searched for (completed).
> What I want out of sessions is to when they click on the link for a
> particular item, the item number stay in a session so it can be called
> through out each page they goto. What I have as a base of test code is the
> following (this was taken from someone's example):
>
> test1.php:
>
>  session_start(  );
> session_register("SESSION");
>
> *** THE FOLLOWING VARIABLE ($retrived_itemno) WOULD NEED TO BE SET ON THE
> *** SEARCH PAGE ***
> $SESSION["item"] = $retrived_itemno;
>
> $test2Url = "test2.php?PHPSESSID=" . session_id(  );
>
> ?>
>
> Goto next page
>
>
> test2.php:
>
>  session_start( );
> echo "the retrived value equals: $SESSION[item]";
> ?>
>
>
>
> After you click the hyperlink on test1.php, test2.php will load and the
> session ID is in the URL, but nothing is displayed in the echo for
> $SESSION[item] in test2.php. What is going on?!#!#!$#
>
>
> Thanks a million in advance!!
> - Chris
>
>



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




Re: [PHP] Questions regarding inserting and updating data into aMySQL db

2002-09-11 Thread Marek Kilimajer

mysql_insert_id() will tell you the number of last auto_increment 
insert, you can use this, but you must keep it using session on the 
server side for security reasons. But better solution be to use session 
or hidden fields in your forms to pass the values from page to page and 
insert them at once on the last page.

Axis Computers wrote:

> Hi,
>  
> I'm developing a web application that uses forms for user input and 
> then after each form is filled shows something like Welcome Bob to our 
> site ... bla. bla... inserts data in a table and on the same page 
> continues with the rest of the data, and goes to another form and so on.
>  
> I have no problems inserting the data from the first form in the 
> table, display the personalized message, and then connect to the mySQL 
> db, my problem is some fields in the table which must be filled are 
> null in this first instance, and then on the second form they are filled,
> but my I don´t know how can I fill the gaps and leave all the data in 
> one row, because the first field auto increments, and I'm worried the 
> data instead of filling one row spreads accross two or three.
>  
> i.e
>  
> First: Bob
> Last: Evans
> //user submits form
> ///On the second form
> says "Welcome Bob Evans and congratulations ... bla bla ..."
> // inserts data into table
> // Then asks for more data
> Address : Somewhere 555
> Ocupation: Something
> // user submits form
> // data is inserted into the table and the gaps are filled or is updated ?
>  here is what I don't know if data is still on the same row and 
> effectively filled the gaps, or it is inserted into another road ... 
> using insert or update ?
>  
> Thanks for your tips
>  
> TIA
>  
> Rick
>   
> ** 
> *__*
>
> *ICQ#: 37031810*
> *Current ICQ status:*  
>
> *+*  *More ways to contact me * 
> *__*




[PHP] PHP as a tool for developing enterprise systems.

2002-09-11 Thread Scott Houseman

Dear all.

I have just had a discussion in which it was said that PHP cannot be used
to develop a *true* enterprise system.
In light of this, I would be very interested to hear you
comments/opinions/arguments on:
1. What would you consider to be a true enterprise system?
2.Is his statement correct? If so, what features does PHP lack which make
this so?
3.If this is not true, what arguments can I use to refute this?

Regards

-|Scott

////
// Scott Houseman //
// Jam Warehouse http://www.jamwarehouse.com/ //
// Smart Business Innovation  //
// +27 21 4477440 / +27 82 4918021//
////


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




[PHP] header question

2002-09-11 Thread Meltem Demirkus

Hi ,

I want to know if there is any way to send data in
header("Location:login.php") .I know how to send like this but I need to use header and I dont know howto
do this?...

thanks alot

meltem demirkus


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




[PHP] Sending Attachements through php email form

2002-09-11 Thread Heidi Belal


Hi,

I was wondering if anybody could tell me the best way and how to code sending an 
attachement with an email form.  I want the user to be able to browse and select the 
file he wants to attach, and i want the reciepent to be able to see the file that has 
been attached with the email.

Thanks,



Heidi Belal
Web Developer
www.code-corner.com

A bus stops at a bus station; 
a train stops at a train station; 
and on my desk i have a work station ...

 



-
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost


Re: [PHP] header question

2002-09-11 Thread Chris Wesley

On Wed, 11 Sep 2002, Meltem Demirkus wrote:

> I want to know if there is any way to send data in
> header("Location:login.php") .I know how to send like thishref=\"login.php?id=$ID\">  but I need to use header and I dont know howto
> do this?...

header( "Location: login.php?id=${ID}" );

~Chris


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




[PHP] Sessions problem and unsettling Session variables

2002-09-11 Thread David Russell

Hi all,

I have a problem...

I have 3 pages in a search mechanism.

Page 1 (Search.php) 
unsets all related session variables. 
It then displays a form which allows the user to specify search
criteria. Submission sends us to Page 2

Page 2 (generateListSQL.php)
Sets up the basic database search query
Adds the filters specified in page 1 to the search query
Each filter is saved as a session variable (using $_SESSION['varname'] =
$_GET['varname'];) to re-process later if needed
Saves the final (working) SQL queries as session variables
Calls Page 3

Page 3 (ListBPF.php)
Displays the filter conditions (from the Session Variables)
Executes the query
Displays the results in a table.

This all works - on the first attempt. Subsequent attempts will happily
overwrite the session variables, but will not remove them (as specified
in page 1)
Page 1 startes with:

Session_start();
$_SESSION['variablename1'] = null;
unset ($_SESSION['Variablename1'];
$_SESSION['variablename2'] = null;
unset ($_SESSION['Variablename2'];
$_SESSION['variablename3'] = null;
unset ($_SESSION['Variablename3'];

And so on.
Why will this not work? I refresh the page. I am using PHP 4.2.2.
Register Globals - Off, Track Vars - on. Any ideas why the session
variables refuse to be unset?

Thanks


David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



smime.p7s
Description: application/pkcs7-signature


RE: [PHP] not passing arguments from HTTP GET?

2002-09-11 Thread Jay Blanchard

[snip]
I am running PHP 4.2.2 on Apache 1.3.26 under MacOS X 10.2. My scripts'
functionality seems to have gone amok, and while I am not sure this is
the fault of php directly, I was hoping someone could help me track
down the problem.

Basically, if I have a script that I pass arguments to on a get
request, the argument seems to be processed (ie, it is found in
$_SERVER["argv"][0]), but the actual argument itself has no effect. For
example, I have a script that checks for a date variable:

if ($date) { print $date; }

and when I call it by loading http://www.../date.php?date=2002-09-11 -
the script produces nothing, even though the argv(0) is
"date=2002-09-11". What's at fault here, any ideas? I am using a binary
distro (it's linked from the php site) for OSX, but I've used it in the
past and never encountered such a problem. Other PHP functionality
seems fine, so I don't think my webserver is in error. The code seems
ridiculously simple.
[/snip]

Check the status of register_globals in your php.ini . If it is off, get
variables are available from $_GET['variable_name'] such as $_GET['date'].

You could choose to turn register_variables ON (it used to be on by default
in earlier versions of PHP) or you could choose to turn it on in an
.htaccess directive by folder since you're running Apache.

HTH!

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




[PHP] PHP, ask questions

2002-09-11 Thread Ralf Bengl

hallo ...,

my name is ralf and i read the comments from the last weeks about
"download a file" with php on
http://www.php.net/manual/en/function.header.php.

i tryed a few of this examples, but i have still a problem with downloading
a file,
i.e. a "ms-word file" or a pdf-file or something else:

i can not open these files because of every file is damaged after  the
download.
 i work with windows xp, apache server(apache_2.0.40-win32-) , mysql and of
course php(php-4.0.4).
do you have any idea of the problem or can you give me an avice where i can
ask this question?

maybe it's  a very simple and known problem for you.  i work with php since
a few weeks and it seems to be very difficult to solve this problem for me.

thanks

ralf



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




[PHP] How to pass null as value?

2002-09-11 Thread Chuck PUP Payne

I know this may have been asked a thousand times but how do you pass null on
to a page as a value. Let say in a field where you have a yes and no. Null
needs to equal no. Is this more mysql? Can it be done in php?

Chuck Payne
Magi Design and Support


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




RE: [PHP] How to pass null as value?

2002-09-11 Thread Jon Haworth

Hi Chuck,

> how do you pass null on to a page as a value. 
> Let say in a field where you have a yes and no. 
> Null needs to equal no. 

Pass from where?

If it's a checkbox on a form, just use isset() to test for the existence of
the variable: true means it's ticked, false means it isn't.

If it's from MySQL I'd suggest using an ENUM('y','n') or a TINYINT field
instead, but I suppose you could test for things like empty or zero-length
strings.

Cheers
Jon

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




[PHP] Unable to flush output

2002-09-11 Thread PHP

Hi all,
Until yesterday i was running Apache/2.0.36 (Unix) mod_ssl/2.0.36 OpenSSL/0.9.6c 
PHP/4.2.1  and was able to flush script output to browser (using flush() ), before the 
script stops executing. I upgraded to Apache/2.0.40 (Unix) mod_ssl/2.0.40 
OpenSSL/0.9.6g PHP/4.2.3 and on the same script/browser configuration i have to wait 
untill the script stops running before i can see any output. I wish to say that it is 
not browser-related, because i tried different browsers, tried sending spaces to 
browser before the actual contents (300 spces for IE) and data is not in a table. I am 
running Slackware 8.1
I did't find any information on how to change this behaviour up to now, so i would be 
thankfull for any ideas





RE: [PHP] PHP as a tool for developing enterprise systems.

2002-09-11 Thread Jay Blanchard

[snip]
I have just had a discussion in which it was said that PHP cannot be used
to develop a *true* enterprise system.
In light of this, I would be very interested to hear you
comments/opinions/arguments on:

1. What would you consider to be a true enterprise system?
[/snip]

Here is one definition --

"Enterprise System is an industry term for the broad set of activities
supported by multi-module application software that helps a manufacturer or
other business manage the important parts of its business, including product
planning, parts purchasing, maintaining inventories, interacting with
suppliers, providing customer service, and tracking orders. ERP can also
include application modules for the finance and human resources aspects of a
business. Typically, a system uses or is integrated with a relational
database system. The deployment of an enterprise system can involve
considerable business process analysis, employee retraining, and new work
procedures. "

Here I receive 100's of 1000's of business call records a day. PHP is used
to
-- retrieve the records
-- parse the records
-- import the records into the database
-- select the proper records to be rated
-- prepare the records for the billing system (a legacy application)
-- shipping the prepared records to the billing system
-- report on the records
-- archive the records

We also use PHP for (not limited to this list);
-- contract matrix
-- collections
-- content management systems
-- project tracking and collaboration
-- sales enhancement tools

As each day goes by we are using PHP to replace and improve upon current
business processes one module at a time. Because of PHP's flexibility and
power we are able to do this very easily. The above is an example of what we
do as an enterprise, and we have many other modules handling many other
tasks. We have the need to track millions of call records per month and
handle them accurately and efficiently.

[snip]
2.Is his statement correct? If so, what features does PHP lack which make
this so?
[/snip]

I believe his statement to be incorrect, but I would need to know what he
means by "true" enterprise system in order to refute his argument. My bet is
that he does not have any facts to support what appears to be an
off-the-cuff statement. There are many presentations being made this year at
the International PHP Conference and PHPCON2002 concerning the use of PHP to
develop enterprise systems.

PHP has so many built in functions, and then there are the extensions and
classes (most of which are available for free) that perform many tasks that
not even Visual Basic can do out-of-the-box. While PHP lacks some Object
Oriented Programming features we have come to know and love it still has
very robust OOP features and more are coming.

Again, I would need to know his arguement(s).

[snip]
3.If this is not true, what arguments can I use to refute this?
[/snip]

D. All of the above.

HTH!

Jay


*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




Re: [PHP] header question

2002-09-11 Thread Krzysztof Dziekiewicz

> On Wed, 11 Sep 2002, Meltem Demirkus wrote:

>> I want to know if there is any way to send data in
>> header("Location:login.php") .I know how to send like this   > href=\"login.php?id=$ID\">  but I need to use header and I dont know howto
>> do this?...

> header( "Location: login.php?id=${ID}" );

What for {} ?
Rather: header( "Location: login.php?id=$ID" );


-- 
Krzysztof Dziekiewicz


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




[PHP] basilix

2002-09-11 Thread sonjaya

I have installed basilix 1.1.0 , I have imap too also php support for
imap but why every I get to basilix always get error like this:
xx.xx.xx.xx - - [12/Sep/2002:19:09:45 -0400] "GET index.php?testCookie=1
HTTP/1.1" 302 5 
 
 
looping until I stop the browser .. any one how to solve this problem.
#i use Rh 7.3 + apache+mod_ssl+openssl+mysql+php
# php is upport imap to, also running imap itu ini xinetd
 



Re: [PHP] Sending Attachements through php email form

2002-09-11 Thread Justin French

Hi,

I'm not aware of any existing code/samples for this, but the individual
components you need to break it down into are pretty straight forward:

1. Learn about forms, validation of user input, and in particular file
uploads (which there is a perfect library of working code in the manual:
http://www.php.net/manual/en/features.file-upload.php)

2. Then learn about the filesystem functions, in particular, how to read the
contents of the uploaded file into a string, then later about deleting
files, etc etc.

from the manual http://php.net/fread:


3. Then learn a bit about mail() (http://php.net/mail), but really what you
need to do from there is to go over to phpclasses.org, and look at manual
lemos' mime-mail class (unsure of the exact name), which deals with HTML
mail, multi part email, attachments to emails, and everything else you could
possibly need to send an email with an attachment.


Justin



on 11/09/02 12:07 AM, Heidi Belal ([EMAIL PROTECTED]) wrote:

> 
> Hi,
> 
> I was wondering if anybody could tell me the best way and how to code sending
> an attachement with an email form.  I want the user to be able to browse and
> select the file he wants to attach, and i want the reciepent to be able to see
> the file that has been attached with the email.
> 
> Thanks,
> 
> 
> 
> Heidi Belal
> Web Developer
> www.code-corner.com
> 
> A bus stops at a bus station;
> a train stops at a train station;
> and on my desk i have a work station ...
> 
> 
> 
> 
> 
> -
> Yahoo! - We Remember
> 9-11: A tribute to the more than 3,000 lives lost


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




[PHP] Image Upload

2002-09-11 Thread Sascha Braun

Hi Freaks,

I got a problem to solve. This script i wrote seems to have an failure but I don't 
know why.

The Error Message is telling me, that I don't have the permission to do the action I 
want to do. I thought it has some to do with my windows apache installation, but on 
linux its the same behavior.

  if(!file_exists('../images/upload_tmp')) {
   $dir = '../images/upload_tmp';
   mkdir($dir);
   chmod($dir, 07557);
   $path = dirname($PATH_TRANSLATED).$dir.'/';
   for ($i = 0; $i < 10; $i++) {
switch($i) {
 case $i:
  $source = $image[$i];
  $source_name = $image_name[$i];
  break;
}
if ($source <> "none") {
 if ($error <> 1) {
  $dest = $path.$source_name;
  if (copy($source, $dest)) {
   echo ''.$source_name-' wurde hochgeladen';
  } else {
   echo 'Schreibrechte im Zielverzeichnis fehlen';
   $error = 1;
  }
 }
 @unlink($source);
}
   }
  } else {
   echo 'Verzeichnis ist vorhanden';
  }


If want the script to upload mulitple files, so the form is made like this:



Will this be working ?


Thanks



Re: [PHP] Apache compile

2002-09-11 Thread William Allmendinger

I deleted the entire source upacked again then did the new
compile for the apache module.
I have the approprate lines in the httpd.conf file to load
the php modules. I just did httpd-l and made sure that the
module is loaded.

And the cgi iss for local scripting on the server only and I
do have the command at the top of those files to run them.

On Tue, 10 Sep 2002 19:17:35 -0400
 "MET" <[EMAIL PROTECTED]> wrote:
> Did you delete the config.cache file in the PHP directory
> after the
> first "configure, make, make install, and make clean"
> commands?
> 
> Did you add the appropriate info into apache's httpd.conf
> file so that
> is knows what .php files are and what to parse them with?
> 
> Did you add the appropriate command to the top of your
> PHP page that
> will be run through as a CGI ( #!/usr/local/bin/php ||
> that should not
> be inside of any PHP tags...just at the tip top of your
> page)?
> 
> Answering these questions will help us solve your
> problem.
> 
> ~ Matthew
> 
> -Original Message-
> From: William Allmendinger [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, September 10, 2002 7:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Apache compile
> 
> 
> Hello,
> I am currently working on compilling php as both a cgi
> ands
> as an apache module on the same server. The cgi compile,
> which I did first with ./configure --with-ldap={ldap dir}
> --with-mysql,
> went jsut fine. However, when I try to compile it as an
> apache module,
> both as ./configure --with-ldap={ldap dir} --with-mysql
> --with-apxs or
> ./configure --with-ldap={ldap dir} --with-mysql
> --with-apache={src}, I
> get errors when trying to load a page. 
> The following is my php file I  try to open in a browser
> called phpinfo.php
> 
>  echo "hi";
> ?>
>  And this generates the following error: 
> 
> warning: failed opening '/usr/web/phpinfo.php' for
> inclusion
> (include_path='.:/usr/local/lib/php') in Unknown on line
> 0
> 
> Any help would be great.
> 
> 
> 
> William F. Allmendinger
> Network Manager
> University of Detroit Mercy
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




William F. Allmendinger
Network Manager
University of Detroit Mercy

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




[PHP] Image upload

2002-09-11 Thread Sascha Braun

Please Excuse,

the code must look like this:


  if(!file_exists('../images/upload_tmp')) {
   $dir = '../images/upload_tmp';
   mkdir($dir);
   chmod($dir, 0777);
   $path = dirname($PATH_TRANSLATED).$dir.'/';
   for ($i = 0; $i < 10; $i++) {
switch($i) {
 case $i:
  $source = $image[$i];
  $source_name = $image_name[$i];
  break;
}
if ($source <> "none") {
 if ($error <> 1) {
  $dest = $path.$source_name;
  if (copy($source, $dest)) {
   echo ''.$source_name-' wurde hochgeladen';
  } else {
   echo 'Schreibrechte im Zielverzeichnis fehlen';
   $error = 1;
  }
 }
 @unlink($source);
}
   }
  } else {
   echo 'Verzeichnis ist vorhanden';
  }



Re: [PHP] Unable to flush output

2002-09-11 Thread Marek Kilimajer

Didn't you enable some apache extentions, like compression.

PHP wrote:

>Hi all,
>Until yesterday i was running Apache/2.0.36 (Unix) mod_ssl/2.0.36 OpenSSL/0.9.6c 
>PHP/4.2.1  and was able to flush script output to browser (using flush() ), before 
>the script stops executing. I upgraded to Apache/2.0.40 (Unix) mod_ssl/2.0.40 
>OpenSSL/0.9.6g PHP/4.2.3 and on the same script/browser configuration i have to wait 
>untill the script stops running before i can see any output. I wish to say that it is 
>not browser-related, because i tried different browsers, tried sending spaces to 
>browser before the actual contents (300 spces for IE) and data is not in a table. I 
>am running Slackware 8.1
>I did't find any information on how to change this behaviour up to now, so i would be 
>thankfull for any ideas
>
>
>
>  
>


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




Re: [PHP] PHP, ask questions

2002-09-11 Thread Marek Kilimajer

Make sure you are not outputing anything besides the headers and actual 
content of the file, you may also try looking at the downloaded file if 
there are any php errors and/or warnings.

Ralf Bengl wrote:

>hallo ...,
>
>my name is ralf and i read the comments from the last weeks about
>"download a file" with php on
>http://www.php.net/manual/en/function.header.php.
>
>i tryed a few of this examples, but i have still a problem with downloading
>a file,
>i.e. a "ms-word file" or a pdf-file or something else:
>
>i can not open these files because of every file is damaged after  the
>download.
> i work with windows xp, apache server(apache_2.0.40-win32-) , mysql and of
>course php(php-4.0.4).
>do you have any idea of the problem or can you give me an avice where i can
>ask this question?
>
>maybe it's  a very simple and known problem for you.  i work with php since
>a few weeks and it seems to be very difficult to solve this problem for me.
>
>thanks
>
>ralf
>
>
>
>  
>


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




[PHP] upload

2002-09-11 Thread Sascha Braun

This is the original code:

 "none") {
 if ($error <> 1) {
  $dest = $path.$source_name;
  if (copy($source, $dest)) {
   echo ''.$source_name-' wurde hochgeladen';
  } else {
   echo 'Schreibrechte im Zielverzeichnis fehlen';
   $error = 1;
  }
 }
 @unlink($source);
}
   }
  } else {
   echo 'Verzeichnis ist vorhanden';
  }

?>



[PHP] Upload

2002-09-11 Thread Sascha Braun

This is the Error Message:

value of $source : C:\WINNT\TEMP\php98.tmp

Error:

0
Warning: Unable to open '' for reading: Permission denied in 
C:\Webverzeichnis\docs\living_sports\living_sports\lsadmin\includes\image.handling.inc.php
 on line 129



[PHP] Comments in code

2002-09-11 Thread Gerard Samuel

I just started writing comments in my code for use with phpdocumentor.
And Im beginning to wonder if too many comments is a *bad* thing.
I was wondering about file size, but dont think that can be avoided, and
php's parser speed.
Nothing bad, just looking to see what others have to say about it.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




RE: [PHP] Comments in code

2002-09-11 Thread Jay Blanchard

[snip]
I just started writing comments in my code for use with phpdocumentor.
And Im beginning to wonder if too many comments is a *bad* thing.
I was wondering about file size, but dont think that can be avoided, and
php's parser speed.
Nothing bad, just looking to see what others have to say about it.
Thanks
[/snip]

Zen & The Art of Commenting Code

1. Comment only that which does not make obvious sense, and comment well on
that. Explain as clearly, but succinctly  as possible. If 2 words suffice,
do not use 14.
2. Comments are only part of the documentation.

:^]

Jay



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




[PHP] question

2002-09-11 Thread Meltem Demirkus

Hi,
I am working on a process which turn to the previous page when the user
enter something wrong in the form on a page .But I also want to warn the
user with an error message on this page ...I know using heder : location but
I couldn't  add the message ...
can anybody help me ? How can I add this message to the page..
thanks alot

metos


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




Re: [PHP] question

2002-09-11 Thread John Wards

pass the message as a variable

header:location.php?message=$message


- Original Message -
From: "Meltem Demirkus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 2:31 PM
Subject: [PHP] question


> Hi,
> I am working on a process which turn to the previous page when the user
> enter something wrong in the form on a page .But I also want to warn the
> user with an error message on this page ...I know using heder : location
but
> I couldn't  add the message ...
> can anybody help me ? How can I add this message to the page..
> thanks alot
>
> metos
>
>
> --
> 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] Unable to flush output

2002-09-11 Thread PHP

I do not have compression in apache

- Original Message -
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 3:38 PM
Subject: Re: [PHP] Unable to flush output


> Didn't you enable some apache extentions, like compression.
>
> PHP wrote:
>
> >Hi all,
> >Until yesterday i was running Apache/2.0.36 (Unix) mod_ssl/2.0.36
OpenSSL/0.9.6c PHP/4.2.1  and was able to flush script output to browser
(using flush() ), before the script stops executing. I upgraded to
Apache/2.0.40 (Unix) mod_ssl/2.0.40 OpenSSL/0.9.6g PHP/4.2.3 and on the same
script/browser configuration i have to wait untill the script stops running
before i can see any output. I wish to say that it is not browser-related,
because i tried different browsers, tried sending spaces to browser before
the actual contents (300 spces for IE) and data is not in a table. I am
running Slackware 8.1
> >I did't find any information on how to change this behaviour up to now,
so i would be thankfull for any ideas
> >
> >
> >
> >
> >
>
>
> --
> 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]question

2002-09-11 Thread Meltem Demirkus


Thanks ...But I know this way about carrying data from one page to another..
I want this message to be seen on the page without my doing anythingand
I cant do that?..

- Original Message -
From: "John Wards" <[EMAIL PROTECTED]>
To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 4:36 PM
Subject: Re: [PHP] question


> pass the message as a variable
>
> header:location.php?message=$message
>
>
> - Original Message -
> From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 2:31 PM
> Subject: [PHP] question
>
>
> > Hi,
> > I am working on a process which turn to the previous page when the user
> > enter something wrong in the form on a page .But I also want to warn the
> > user with an error message on this page ...I know using heder : location
> but
> > I couldn't  add the message ...
> > can anybody help me ? How can I add this message to the page..
> > thanks alot
> >
> > metos
> >
> >
> > --
> > 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] question

2002-09-11 Thread Miles Thompson

Julie Meloni to the rescue again - http://www.thickbookcom, you'll find a 
tutorial on custom error messages.
In fact, after working on that you may rethink your approach.

Miles Thompson

At 04:31 PM 9/11/2002 +0300, Meltem Demirkus wrote:
>Hi,
>I am working on a process which turn to the previous page when the user
>enter something wrong in the form on a page .But I also want to warn the
>user with an error message on this page ...I know using heder : location but
>I couldn't  add the message ...
>can anybody help me ? How can I add this message to the page..
>thanks alot
>
>metos
>
>
>--
>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




Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Meltem Demirkus

I think because of my bad english I made you misunderstand..I ment this :
for example  when a person miss an input  to fill on the from  and then
press the submit button I want him to be back to the same form page with a
special message that I entered (something like :you left . place
empty).But I dont want to copy the same form page accoring to the possible
mistakes .. I want to learn if there is an easier way to do this...
thanks to everyone..

meltem
- Original Message -
From: "Meltem Demirkus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 4:40 PM
Subject: [PHP] Re:[PHP]question


>
> Thanks ...But I know this way about carrying data from one page to
another..
> I want this message to be seen on the page without my doing
anythingand
> I cant do that?..
>
> - Original Message -
> From: "John Wards" <[EMAIL PROTECTED]>
> To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 4:36 PM
> Subject: Re: [PHP] question
>
>
> > pass the message as a variable
> >
> > header:location.php?message=$message
> >
> >
> > - Original Message -
> > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 11, 2002 2:31 PM
> > Subject: [PHP] question
> >
> >
> > > Hi,
> > > I am working on a process which turn to the previous page when the
user
> > > enter something wrong in the form on a page .But I also want to warn
the
> > > user with an error message on this page ...I know using heder :
location
> > but
> > > I couldn't  add the message ...
> > > can anybody help me ? How can I add this message to the page..
> > > thanks alot
> > >
> > > metos
> > >
> > >
> > > --
> > > 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




[PHP] Displaying value different from actual value

2002-09-11 Thread Dave Rosenberg

I'm not sure this is possible, but here's what I'd like to do:
I know that in order for a set of records from MySQL to display in 
numerical order on a web page, you need to make the column type 
"Integer," but here's my situation:

I'm creating a database of contracts that my organization has. 
Normally, there is a dollar amount on these contracts, and I'd like to 
be able to sort by that value (therefore the Integer column type). 
However, we have some fee-based contracts, and I'd like a way to display 
the amount as "Fee Based" even though I can't enter this in the database 
because of the column type.  Is there a way in PHP to have it display 
this although with some kind of if/then statement or something of that sort?

Contract A  Fee-based
Contract B  7
Contract C   1250
Contract D  5


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




Re: [PHP] Re:[PHP]question

2002-09-11 Thread John Wards

right...


  
  
  

  


To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 2:53 PM
Subject: Fw: [PHP] Re:[PHP]question


> I think because of my bad english I made you misunderstand..I ment this :
> for example  when a person miss an input  to fill on the from  and then
> press the submit button I want him to be back to the same form page with a
> special message that I entered (something like :you left . place
> empty).But I dont want to copy the same form page accoring to the possible
> mistakes .. I want to learn if there is an easier way to do this...
> thanks to everyone..
>
> meltem
> - Original Message -
> From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 4:40 PM
> Subject: [PHP] Re:[PHP]question
>
>
> >
> > Thanks ...But I know this way about carrying data from one page to
> another..
> > I want this message to be seen on the page without my doing
> anythingand
> > I cant do that?..
> >
> > - Original Message -
> > From: "John Wards" <[EMAIL PROTECTED]>
> > To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 11, 2002 4:36 PM
> > Subject: Re: [PHP] question
> >
> >
> > > pass the message as a variable
> > >
> > > header:location.php?message=$message
> > >
> > >
> > > - Original Message -
> > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, September 11, 2002 2:31 PM
> > > Subject: [PHP] question
> > >
> > >
> > > > Hi,
> > > > I am working on a process which turn to the previous page when the
> user
> > > > enter something wrong in the form on a page .But I also want to warn
> the
> > > > user with an error message on this page ...I know using heder :
> location
> > > but
> > > > I couldn't  add the message ...
> > > > can anybody help me ? How can I add this message to the page..
> > > > thanks alot
> > > >
> > > > metos
> > > >
> > > >
> > > > --
> > > > 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


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




RE: [PHP] Displaying value different from actual value

2002-09-11 Thread Jay Blanchard

[snip]
I'm not sure this is possible, but here's what I'd like to do:
I know that in order for a set of records from MySQL to display in
numerical order on a web page, you need to make the column type
"Integer," but here's my situation:

I'm creating a database of contracts that my organization has.
Normally, there is a dollar amount on these contracts, and I'd like to
be able to sort by that value (therefore the Integer column type).
However, we have some fee-based contracts, and I'd like a way to display
the amount as "Fee Based" even though I can't enter this in the database
because of the column type.  Is there a way in PHP to have it display
this although with some kind of if/then statement or something of that sort?

Contract A  Fee-based
Contract B  7
Contract C   1250
Contract D  5
[/snip]

Pseudocode

if($contract_amount == "" || $contract_amount == NULL){
   print("Fee-based");
}

HTH! Peace ...

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




[PHP] Re: mysql query

2002-09-11 Thread bill

function mysql_one_element($query, $element) {
  // quickly returns just one element from a query
  $one=mysql_query($query);
  // add error checking here if you wish
  $r=mysql_fetch_array($one);
  $thisvalue=$r[$element];
  return($thisvalue);
}

$row=mysql_one_element("select euro from brandstofprijzen where id=2", "euro");

Chris Schoeman wrote:

> I use the script below to get one value out of a database:
>
> $result = mysql_query("select euro from brandstofprijzen where id=2")
> or die (mysql_error());
> while ($row = mysql_fetch_array($result))
> {
> $euro = $row["euro"];
> }
> mysql_free_result($result);
>
> This is working fine, but is there an easier (less code) way to do
> this?
>
> Thankx


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




Re: Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Support @ Fourthrealm.com

Meltem,

You're much better off to use JavaScript to perform the form 
validation.  This way, when the user clicks on the Submit button, 
JavaScript can make sure that values are filled in, or that they are within 
range, and can then pop up a message advising them of any errors, and that 
they can't continue until the info is corrected.  This saves the hassle of 
you having to create a system that will send details to/from various pages, 
and the user doesn't have to fill in the entire form all over again, as 
their values stay on the page.

I use this site quite often for javascript code:
http://javascript.internet.com/

Peter


At 04:53 PM 9/11/2002 +0300, you wrote:
>I think because of my bad english I made you misunderstand..I ment this :
>for example  when a person miss an input  to fill on the from  and then
>press the submit button I want him to be back to the same form page with a
>special message that I entered (something like :you left . place
>empty).But I dont want to copy the same form page accoring to the possible
>mistakes .. I want to learn if there is an easier way to do this...
>thanks to everyone..
>
>meltem
>- Original Message -
>From: "Meltem Demirkus" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, September 11, 2002 4:40 PM
>Subject: [PHP] Re:[PHP]question
>
>
> >
> > Thanks ...But I know this way about carrying data from one page to
>another..
> > I want this message to be seen on the page without my doing
>anythingand
> > I cant do that?..
> >
> > - Original Message -
> > From: "John Wards" <[EMAIL PROTECTED]>
> > To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 11, 2002 4:36 PM
> > Subject: Re: [PHP] question
> >
> >
> > > pass the message as a variable
> > >
> > > header:location.php?message=$message
> > >
> > >
> > > - Original Message -
> > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, September 11, 2002 2:31 PM
> > > Subject: [PHP] question
> > >
> > >
> > > > Hi,
> > > > I am working on a process which turn to the previous page when the
>user
> > > > enter something wrong in the form on a page .But I also want to warn
>the
> > > > user with an error message on this page ...I know using heder :
>location
> > > but
> > > > I couldn't  add the message ...
> > > > can anybody help me ? How can I add this message to the page..
> > > > thanks alot
> > > >
> > > > metos
> > > >
> > > >
> > > > --
> > > > 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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Displaying value different from actual value

2002-09-11 Thread Dave Rosenberg

Thanks Jay.  How would that work into something like:

printf("Total Budget:  $%s\n", mysql_result($result,0,"budget"));

or

printf("%s%s%s%s%s%s%s\n",
 
$myrow[0], $myrow[0], $myrow[4], $myrow[8], $myrow[9],  $myrow[7], 
$myrow[10]);

Thanks,
Dave

Jay Blanchard wrote:
> [snip]
> I'm not sure this is possible, but here's what I'd like to do:
> I know that in order for a set of records from MySQL to display in
> numerical order on a web page, you need to make the column type
> "Integer," but here's my situation:
> 
> I'm creating a database of contracts that my organization has.
> Normally, there is a dollar amount on these contracts, and I'd like to
> be able to sort by that value (therefore the Integer column type).
> However, we have some fee-based contracts, and I'd like a way to display
> the amount as "Fee Based" even though I can't enter this in the database
> because of the column type.  Is there a way in PHP to have it display
> this although with some kind of if/then statement or something of that sort?
> 
> Contract A  Fee-based
> Contract B  7
> Contract C   1250
> Contract D  5
> [/snip]
> 
> Pseudocode
> 
> if($contract_amount == "" || $contract_amount == NULL){
>print("Fee-based");
> }
> 
> HTH! Peace ...
> 
> Jay
> 
> *
> * Texas PHP Developers Conf  Spring 2003*
> * T Bar M Resort & Conference Center*
> * New Braunfels, Texas  *
> * Contact [EMAIL PROTECTED]   *
> *   *
> * Want to present a paper or workshop? Contact now! *
> *
> 
> 


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




RE: [PHP] Re: mysql query

2002-09-11 Thread David Buerer

Look into the LIMIT command, it will limit the number of rows in the result
set to the number you specify

-Original Message-
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: mysql query


function mysql_one_element($query, $element) {
  // quickly returns just one element from a query
  $one=mysql_query($query);
  // add error checking here if you wish
  $r=mysql_fetch_array($one);
  $thisvalue=$r[$element];
  return($thisvalue);
}

$row=mysql_one_element("select euro from brandstofprijzen where id=2",
"euro");

Chris Schoeman wrote:

> I use the script below to get one value out of a database:
>
> $result = mysql_query("select euro from brandstofprijzen where id=2")
> or die (mysql_error());
> while ($row = mysql_fetch_array($result))
> {
> $euro = $row["euro"];
> }
> mysql_free_result($result);
>
> This is working fine, but is there an easier (less code) way to do
> this?
>
> Thankx


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




[PHP] Re: Fw: Questions regarding inserting and updating data into a MySQL db

2002-09-11 Thread bill



comments below
Axis Computers wrote:

 
- Original Message -
From: Axis
Computers
To: [EMAIL PROTECTED]
; PHPSent:
Tuesday, September 10, 2002 4:51 PMSubject: Questions regarding
inserting and updating data into a MySQL db
 Hi, I'm
developing a web application that uses forms for user input and then after
each form is filled shows something like Welcome Bob to our site ... bla.
bla... inserts data in a table and on the same page continues with the
rest of the data, and goes to another form and so on. I
have no problems inserting the data from the first form in the table, display
the personalized message, and then connect to the mySQL db, my problem
is some fields in the table which must be filled are null in this first
instance, and then on the second form they are filled,but
my I don´t know how can I fill the gaps and leave all the data in
one row, because the first field auto increments, and I'm worried the data
instead of filling one row spreads accross two or three. i.e First:
BobLast: Evans//user
submits form
Isn't this where you do the INSERT?
 
 ///On
the second formsays "Welcome
Bob Evans and congratulations ... bla bla ..."//
inserts data into table
get mysql_insert_id() here
$thisid=mysql_insert_id();
 
 //
Then asks for more dataAddress
: Somewhere 555Ocupation:
Something
add the id, perhaps as a hidden input
on the form.

 
 //
user submits form// data
is inserted into the table and the gaps are filled or is updated ?
instead of inserting, do an update.
UPDATE mytable
SET address='$Address', ocupation='Ocupation'
WHERE id=thisid
 
here is what I don't know if data is still on the same row and effectively
filled the gaps, or it is inserted into another road ... using insert or
update ? Thanks for
your tips TIA Rick  __
ICQ#:
37031810 





Current
ICQ status:




+ 
More ways to contact me
__





[PHP] Multiple user session management confusion?

2002-09-11 Thread Ian Thurlbeck


Dear All

We are testing a multi-user quiz system with PHP session management.
Everything has been fine until we tested the system with about 12 users...

Each user gets an individual instantiation of some questions and they
type in some answers and submit them for marking.  To remember the
question instantiations across script invocations we store them in a
$_SESSION variable (nb. I don't use session_register or similar, I just set 
$_SESSION['var'] directly). Upon submission we log the questions, the correct
answers (all from the $_SESSION variable), and the user answers (from $_POST) 
in a database for marking later.  Everything seemed to work fine, except...

One user is absolutely sure that the question instantiations logged
in the database are NOT the ones he saw on his browser! I've reviewed 
the code paths and I am also sure (!) that the questions cannot be 
re-instantiated across script invocations. So that leaves me looking for 
another reason. Could the session management in PHP have gotten confused and 
he got someone elses SESSION variable??

Is this possible ? Or am I being naive and should look harder at my code?

Setup is:

Server:
RedHat 7.3
Apache 1.3.26
PHP 4.2.2
MySQL 3.23.52

Client:
Win2000 Professional  5.00 SP2
Internet Explorer 6.0.2600

Any tips gratefully received!

Thanks

Ian

-- 
Ian Thurlbeckhttp://www.stams.strath.ac.uk/
Statistics and Modelling Science, University of Strathclyde
Livingstone Tower, 26 Richmond Street, Glasgow, UK,  G1 1XH
Tel: +44 (0)141 548 3667   Fax: +44 (0)141 552 2079

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




Re: [PHP] Re:[PHP]question

2002-09-11 Thread John Wards

oh missed something out...
function your_form_html($var_1=null, $var_2=null){
 global $message

echo $message;
?>etc...

This will print out your form again with the variables the user submited
plus the message.

Is this what you need?
John

> I think it only prints out the message .. am I wrong?
>
> - Original Message -
> From: "John Wards" <[EMAIL PROTECTED]>
> To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 5:09 PM
> Subject: Re: [PHP] Re:[PHP]question
>
>
> > right...
> >  > function your_form_html($var_1=null, $var_2=null){
> > global $message;
> > ?>
> > 
> >   
> >   
> >   
> > 
> >   
> > 
> >  > }
> > if($Submit =="Submit){
> > if($var_1 != "whatever" OR $var_2 != "this") {
> > $message = "You did wrong...";
> > your_form_html($var_1, $var_2);
> > }
> > else{
> > echo "whoo hoo done";
> > }
> > }else{
> > your_form_html();
> > }
> >
> > Is that what you are after?
> >
> > John
> > - Original Message -
> > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 11, 2002 2:53 PM
> > Subject: Fw: [PHP] Re:[PHP]question
> >
> >
> > > I think because of my bad english I made you misunderstand..I ment
this
> :
> > > for example  when a person miss an input  to fill on the from  and
then
> > > press the submit button I want him to be back to the same form page
with
> a
> > > special message that I entered (something like :you left . place
> > > empty).But I dont want to copy the same form page accoring to the
> possible
> > > mistakes .. I want to learn if there is an easier way to do this...
> > > thanks to everyone..
> > >
> > > meltem
> > > - Original Message -
> > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, September 11, 2002 4:40 PM
> > > Subject: [PHP] Re:[PHP]question
> > >
> > >
> > > >
> > > > Thanks ...But I know this way about carrying data from one page to
> > > another..
> > > > I want this message to be seen on the page without my doing
> > > anythingand
> > > > I cant do that?..
> > > >
> > > > - Original Message -
> > > > From: "John Wards" <[EMAIL PROTECTED]>
> > > > To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> > > > <[EMAIL PROTECTED]>
> > > > Sent: Wednesday, September 11, 2002 4:36 PM
> > > > Subject: Re: [PHP] question
> > > >
> > > >
> > > > > pass the message as a variable
> > > > >
> > > > > header:location.php?message=$message
> > > > >
> > > > >
> > > > > - Original Message -
> > > > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, September 11, 2002 2:31 PM
> > > > > Subject: [PHP] question
> > > > >
> > > > >
> > > > > > Hi,
> > > > > > I am working on a process which turn to the previous page when
the
> > > user
> > > > > > enter something wrong in the form on a page .But I also want to
> warn
> > > the
> > > > > > user with an error message on this page ...I know using heder :
> > > location
> > > > > but
> > > > > > I couldn't  add the message ...
> > > > > > can anybody help me ? How can I add this message to the page..
> > > > > > thanks alot
> > > > > >
> > > > > > metos
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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
> >
> >


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




RE: [PHP] Displaying value different from actual value

2002-09-11 Thread Jay Blanchard

[snip]
Thanks Jay.  How would that work into something like:

printf("Total Budget:  $%s\n", mysql_result($result,0,"budget"));

or

printf("%s%s%s%s%s%s%s\n",
$myrow[0], $myrow[0], $myrow[4], $myrow[8], $myrow[9],  $myrow[7],
$myrow[10]);
[/snip]

You have to do the test prior to the output, checking the value of $myrow[n]
that represents the contract value. I would have to see more of your code to
see where to implement the test.

HTH! Peace ...

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




[PHP] ucwords()?

2002-09-11 Thread Tommi Virtanen

Hi!

I'll try to convert field first char to upper by using ucwords(). Well,
this doesn't
seem to work correct. 

Well maybe error came, because that characteres are not standard (they
are special characterers, finnish language). 

Example:

$work_text = "perhepäivähoitaja";

$work_text = ucwords (strtolower ($work_text);

print $work_name -> PerhepäIväHoitaja). Every char after finnish-ä is
upper.


How I can correct this error??

gustavus 



RE: [PHP] ucwords()? and åäö

2002-09-11 Thread Ville Mattila

I can't say correct answer to this, but want also notify that
strtoupper() -function doesn't affect to those special charters å, ä and ö
that are very common in Finnish language.

Ville


-Original Message-
From: Tommi Virtanen [mailto:[EMAIL PROTECTED]]
Sent: 11. syyskuuta 2002 17:14
To: [EMAIL PROTECTED]
Subject: [PHP] ucwords()?


Hi!

I'll try to convert field first char to upper by using ucwords(). Well,
this doesn't
seem to work correct.

Well maybe error came, because that characteres are not standard (they
are special characterers, finnish language).

Example:

$work_text = "perhepäivähoitaja";

$work_text = ucwords (strtolower ($work_text);

print $work_name -> PerhepäIväHoitaja). Every char after finnish-ä is
upper.


How I can correct this error??

gustavus


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




RE: [PHP] Re: Dependent Dropdown Boxes

2002-09-11 Thread Roger Lewis

Thanks Elias,

I took a look at the code and there are indeed many things to learn;
however, it's all in js.
I'm trying to have php write the js, but I don't know enough about arrays
and manipulating their elements.

Roger

-Original Message-
From: lallous [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 2:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Dependent Dropdown Boxes

Hi,

Try to learn many things from the test code i created below:

http://lgwm.org/ozone/dynatable.htm

Good luck,

Elias

"Roger Lewis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The Situation:
>
> I'm trying to create a pair of dynamic dropdown boxes where the options in
> the second box are dependent on the selection in the first box.  I call
the
> first box "categories" and the second, "subcategories".  I want to store
the
> categories and subcategories in a mysql table(s) so that a user can
> dynamically update them.  Currently, I have a single table called
> categories, with columns: id, category, and subcategory.
>
> The primary code for selecting the options for the second box is in
> javascript.  This code makes use of the following datasets for storing the
> various categories and subcategories.  If I can get php to generate this
> text, then the dependent boxes will work.
>
> datasets=new Array();
>
datasets[0]="Category1,subCategory1_1,subCategory1_2,subCategory1_3,subCateg
> ory1_4".split(",");
>
datasets[1]="Category2,subCategory2_1,subCategory2_2,subCategory2_3".split("
> ,");
> datasets[2]="Category3,subCategory3_1, subCategory3_2,
> subCategory3_3,subCategory3_4,subCategory3_5".split(",");
>
datasets[3]="Category4,subCategory4_1,subCategory4_2,subCategory4_3,subCateg
> ory4_4".split(",");
>
datasets[4]="Category5,subCategory5_1,subCategory5_2,subCategory5_3,subCateg
> ory5_4,subCategory5_5,subCategory5_6".split(",");
> etc.
>
> The Problem:
>
> Using the following code I can get php to print the results, but only in a
> line-by-line, category/subcategory format.  Of course, this is NOT what is
> needed.  Each subcategory name should be on the same line as its
associated
> category.
>
>  $dbConnect = mysql_connect("localhost", "root", "pwd");
> mysql_select_db("new_kb",$dbConnect);
> $sql = "SELECT * from categories";
> $result = mysql_query($sql);
> for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
> {
> print "datasets[$count]=\"";
> print "$row[1],";
> print "$row[2]\"";
> }
> ?>
>
>
> datasets[0]="Category1,subCategory1_1
> datasets[1]="Category1,subCategory1_2
> datasets[2]="Category1,subCategory1_3
> datasets[3]="Category1,subCategory1_4
> datasets[4]="Category2,subCategory2_1
> datasets[5]="Category2,subCategory2_2
> etc.
>
> Can someone explain how to write the php code to output the category and
> subcategory names from the mysql table to match the javascript format
above.
>
> Thanks in advance for any help or suggestions.
>
> Roger Lewis
>
>
>



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

2002-09-11 Thread Justin French

Hi,

I'm looking to implement very basic like it | hate it voting for a product
on a site, but I'd like to implement some simple (or not so simple) ways of
ensuring people don't vote over and over and over.

1. I could set a cookie.  Sure, they could delete the cookie and re-vote
though, and those without cookies will be able to repeat vote.

2. To prevent automated voting, I can make sure that the votes are POSTed,
not done through GET, but if people really wanted, they could still get
around it.

3. I can restrict voting to logged in members, but I don't think I want to
be that restrictive.


Am I missing something obvious?  Or do you just use a combo of 1 + 2???


Justin French


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




[PHP] Re: mysql query

2002-09-11 Thread bill

Ooops, for clarity, I shouldn't have named the result of the function "row" but
"euro".  It should be:

$euro=mysql_one_element("select euro from brandstofprijzen where id=2", "euro");

Bill wrote:

> function mysql_one_element($query, $element) {
>   // quickly returns just one element from a query
>   $one=mysql_query($query);
>   // add error checking here if you wish
>   $r=mysql_fetch_array($one);
>   $thisvalue=$r[$element];
>   return($thisvalue);
> }
>
> $row=mysql_one_element("select euro from brandstofprijzen where id=2", "euro");
>
> Chris Schoeman wrote:
>
> > I use the script below to get one value out of a database:
> >
> > $result = mysql_query("select euro from brandstofprijzen where id=2")
> > or die (mysql_error());
> > while ($row = mysql_fetch_array($result))
> > {
> > $euro = $row["euro"];
> > }
> > mysql_free_result($result);
> >
> > This is working fine, but is there an easier (less code) way to do
> > this?
> >
> > Thankx


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




Re: [PHP] Re:[PHP]question

2002-09-11 Thread John Wards

Meltem,

Your english is very good but you have lost me :) could you explain more
slowly

John
- Original Message -
From: "Meltem Demirkus" <[EMAIL PROTECTED]>
To: "John Wards" <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 3:32 PM
Subject: Re: [PHP] Re:[PHP]question


> then it is what I want ..:)) thanks alot..but one last thing I did not
> understand which part calling the whole form page (the other paragraphs
> written on the ame  page beside the form ) ..
> meltem
> - Original Message -
> From: "John Wards" <[EMAIL PROTECTED]>
> To: "Meltem Demirkus" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 5:26 PM
> Subject: Re: [PHP] Re:[PHP]question
>
>
> > oh missed something out...
> > function your_form_html($var_1=null, $var_2=null){
> >  global $message
> >
> > echo $message;
> > ?>etc...
> >
> > This will print out your form again with the variables the user submited
> > plus the message.
> >
> > Is this what you need?
> > John
> >
> > > I think it only prints out the message .. am I wrong?
> > >
> > > - Original Message -
> > > From: "John Wards" <[EMAIL PROTECTED]>
> > > To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> > > <[EMAIL PROTECTED]>
> > > Sent: Wednesday, September 11, 2002 5:09 PM
> > > Subject: Re: [PHP] Re:[PHP]question
> > >
> > >
> > > > right...
> > > >  > > > function your_form_html($var_1=null, $var_2=null){
> > > > global $message;
> > > > ?>
> > > > 
> > > >   
> > > >   
> > > >   
> > > > 
> > > >   
> > > > 
> > > >  > > > }
> > > > if($Submit =="Submit){
> > > > if($var_1 != "whatever" OR $var_2 != "this") {
> > > > $message = "You did wrong...";
> > > > your_form_html($var_1, $var_2);
> > > > }
> > > > else{
> > > > echo "whoo hoo done";
> > > > }
> > > > }else{
> > > > your_form_html();
> > > > }
> > > >
> > > > Is that what you are after?
> > > >
> > > > John
> > > > - Original Message -
> > > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Wednesday, September 11, 2002 2:53 PM
> > > > Subject: Fw: [PHP] Re:[PHP]question
> > > >
> > > >
> > > > > I think because of my bad english I made you misunderstand..I ment
> > this
> > > :
> > > > > for example  when a person miss an input  to fill on the from  and
> > then
> > > > > press the submit button I want him to be back to the same form
page
> > with
> > > a
> > > > > special message that I entered (something like :you left .
place
> > > > > empty).But I dont want to copy the same form page accoring to the
> > > possible
> > > > > mistakes .. I want to learn if there is an easier way to do
this...
> > > > > thanks to everyone..
> > > > >
> > > > > meltem
> > > > > - Original Message -
> > > > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, September 11, 2002 4:40 PM
> > > > > Subject: [PHP] Re:[PHP]question
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks ...But I know this way about carrying data from one page
to
> > > > > another..
> > > > > > I want this message to be seen on the page without my doing
> > > > > anythingand
> > > > > > I cant do that?..
> > > > > >
> > > > > > - Original Message -
> > > > > > From: "John Wards" <[EMAIL PROTECTED]>
> > > > > > To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
> > > > > > <[EMAIL PROTECTED]>
> > > > > > Sent: Wednesday, September 11, 2002 4:36 PM
> > > > > > Subject: Re: [PHP] question
> > > > > >
> > > > > >
> > > > > > > pass the message as a variable
> > > > > > >
> > > > > > > header:location.php?message=$message
> > > > > > >
> > > > > > >
> > > > > > > - Original Message -
> > > > > > > From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> > > > > > > To: <[EMAIL PROTECTED]>
> > > > > > > Sent: Wednesday, September 11, 2002 2:31 PM
> > > > > > > Subject: [PHP] question
> > > > > > >
> > > > > > >
> > > > > > > > Hi,
> > > > > > > > I am working on a process which turn to the previous page
when
> > the
> > > > > user
> > > > > > > > enter something wrong in the form on a page .But I also want
> to
> > > warn
> > > > > the
> > > > > > > > user with an error message on this page ...I know using
heder
> :
> > > > > location
> > > > > > > but
> > > > > > > > I couldn't  add the message ...
> > > > > > > > can anybody help me ? How can I add this message to the
page..
> > > > > > > > thanks alot
> > > > > > > >
> > > > > > > > metos
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > 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/)
> > > > > T

RE: [PHP] basic voting

2002-09-11 Thread David Buerer

Justin, you've just asked for a way to restrict the possible number of votes
from any one person to 1, however, you don't want to find out anything about
that person!

Although I certainly understand your position, you either have to get from
them some information specific to the person, like, name, email, DL, SSN,
and only allow one vote entry per id, or you have track based on cookie, ip
address, etc.  A simple non-obtrusive way would be to track by IP, but then
you've got the problem of users behind proxies, or multiple users at one
computer, or 

You pretty much have to ask for something like email or name, or be willing
to accept multiple votes from the same person.

Sorry.


-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:34 AM
To: php
Subject: [PHP] basic voting


Hi,

I'm looking to implement very basic like it | hate it voting for a product
on a site, but I'd like to implement some simple (or not so simple) ways of
ensuring people don't vote over and over and over.

1. I could set a cookie.  Sure, they could delete the cookie and re-vote
though, and those without cookies will be able to repeat vote.

2. To prevent automated voting, I can make sure that the votes are POSTed,
not done through GET, but if people really wanted, they could still get
around it.

3. I can restrict voting to logged in members, but I don't think I want to
be that restrictive.


Am I missing something obvious?  Or do you just use a combo of 1 + 2???


Justin French


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




Re: [PHP] header() problem!!!!

2002-09-11 Thread Henrik Hudson

I have not had any problems on IE 6 with this. The code I am using on numerous 
scripts looks like this:

header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/octet-stream");
fpassthru($filehandle);
fclose($filehandle);

Maybe the the combination of using the echo and the attachment field? The echo 
might not treat it as a "real" file? Just a thought.


On Wednesday 11 September 2002 03:33, Jim lucas wrote:
> This is not a bug.  This is just one of many differances between the big
> browser war.  With Netscape (not sure which versions), the attachment thing
> I found is required.  But with IE it kills the browser.
>
> 
> define('MSIE', (preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT])?1:0));
> header("Cache-Control: no-cache, must-revalidate");
> header("Content-Type:".$mime_type);
> header("Content-Disposition: ".(MSIE?'':'attachment;
> ')."filename=$filename");
> echo $filedata;
>
> ?>
> - Original Message -
> From: "xdrag" <[EMAIL PROTECTED]>
> To: "PHP Mailing List" <[EMAIL PROTECTED]>
> Sent: Saturday, September 07, 2002 7:38 PM
> Subject: [PHP] header() problem
>
> > Hi:
> > is this a bug?
> > [win98se + apache2.0.40 + PHP4.2.3 + IE6.0]
> >
> > download1.php:
> >  > ...
> > header("Cache-Control: no-cache, must-revalidate");
> > header("Content-Type:".$mime_type);
> > header("Content-Disposition: filename=$filename");
> > echo $filedata;
> > ?>
> > works well
> >
> > download2.php:
> >  > ...
> > header("Cache-Control: no-cache, must-revalidate");
> > header("Content-Type:".$mime_type);
> > header("Content-Disposition: attachment; filename=$filename");
> > echo $filedata;
> > ?>
> > please pay attention to header("Content-Disposition: ...")
> > if you click this URL, for example "download2.php?id=1", then click the
>
> "save" button,
>
> > your browser will suffer a fatal error. You can not do anything else now!

-- 

Henrik Hudson
[EMAIL PROTECTED]

Note:  Beware of Dragons - Thou art crunchy and taste good with ketchup.


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




RE: [PHP] Re: mysql query

2002-09-11 Thread David Buerer

sorry bill, i misunderstood your question.  I thought you wanted to only
return one row, not just get one value. Given my new understanding, I would
do something like this which is only a slight variant on what you did
 
 $result = mysql_query("select euro from brandstofprijzen where id=2") or
die (mysql_error()); 
$row=mysql_fetch_array($result);
$euro =$row[0]; 

 -Original Message-
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:50 AM
To: David Buerer
Subject: Re: [PHP] Re: mysql query



Maybe I wasn't clear.  The value returned should be called "euro" not "row" 

I didn't think I needed LIMIT because the query should be written to only
get one row; at least the function only returns the first row. 


kind regards, 


bill 


David Buerer wrote: 


  

Look into the LIMIT command, it will limit the number of rows in the result
set to the number you specify 


-Original Message- 
From: bill [ mailto:[EMAIL PROTECTED]  ] 
Sent: Wednesday, September 11, 2002 7:10 AM 
To: [EMAIL PROTECTED] 
Subject: [PHP] Re: mysql query 


function mysql_one_element($query, $element) { 
  // quickly returns just one element from a query 
  $one=mysql_query($query); 
  // add error checking here if you wish 
  $r=mysql_fetch_array($one); 
  $thisvalue=$r[$element]; 
  return($thisvalue); 
} 


$row=mysql_one_element("select euro from brandstofprijzen where id=2",
"euro"); 


Chris Schoeman wrote: 


> I use the script below to get one value out of a database: 
> 
> $result = mysql_query("select euro from brandstofprijzen where id=2") 
> or die (mysql_error()); 
> while ($row = mysql_fetch_array($result)) 
> { 
> $euro = $row["euro"]; 
> } 
> mysql_free_result($result); 
> 
> This is working fine, but is there an easier (less code) way to do 
> this? 
> 
> Thankx 


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




Re: [PHP] basic voting

2002-09-11 Thread Justin French

on 12/09/02 12:12 AM, David Buerer ([EMAIL PROTECTED]) wrote:

> Justin, you've just asked for a way to restrict the possible number of votes
> from any one person to 1, however, you don't want to find out anything about
> that person!

I'd consider that a restriction to getting lots of votes in a quick
manner... :)


> Although I certainly understand your position, you either have to get from
> them some information specific to the person, like, name, email, DL, SSN,
> and only allow one vote entry per id, or you have track based on cookie, ip
> address, etc.  A simple non-obtrusive way would be to track by IP, but then
> you've got the problem of users behind proxies, or multiple users at one
> computer, or 

IP address' aren't an option.

> You pretty much have to ask for something like email or name, or be willing
> to accept multiple votes from the same person.

There's NOTHING to stop me from entering 24 different names or email
address', so I don't consider these options either.


> Sorry.

It's not your fault :)


Justin French


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




Re: [PHP] basic voting

2002-09-11 Thread Adam Williams

Most sites log by IP but if its the IP of a firewall, it would only be one
vote from everyone behind the firewall.

Adam

On Thu, 12 Sep 2002, Justin French wrote:

> Hi,
>
> I'm looking to implement very basic like it | hate it voting for a product
> on a site, but I'd like to implement some simple (or not so simple) ways of
> ensuring people don't vote over and over and over.
>
> 1. I could set a cookie.  Sure, they could delete the cookie and re-vote
> though, and those without cookies will be able to repeat vote.
>
> 2. To prevent automated voting, I can make sure that the votes are POSTed,
> not done through GET, but if people really wanted, they could still get
> around it.
>
> 3. I can restrict voting to logged in members, but I don't think I want to
> be that restrictive.
>
>
> Am I missing something obvious?  Or do you just use a combo of 1 + 2???
>
>
> Justin French
>
>
>


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




[PHP] is php4.2 supported on freebsd-4.2

2002-09-11 Thread Anil Garg

Hi,
i am using php.4.1.2. on freebsd 4.2
i  want to upgrade from 4.1.2 to 4.2.2...

The problem is:
1. Is php 4.2.2 supported on freebsd-4.2 ?
2. Can this happen that after upgrade(of php).some code doesnt work on
4.2.2 which was working on 4.1.2.

thanx and regards
anil


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




RE: [PHP] basic voting

2002-09-11 Thread James E Hicks III

How bout this for just a little better than IP logging.



-Original Message-
From: Adam Williams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 11:24 AM
To: Justin French
Cc: php
Subject: Re: [PHP] basic voting


Most sites log by IP but if its the IP of a firewall, it would only be one
vote from everyone behind the firewall.

Adam




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




RE: [PHP] basic voting

2002-09-11 Thread David Buerer

Since you haven't divulged your task, I'm guessing from comments that
receving 24 votes from faked emails is a really bad thing. In that case you
have no choice but to thoroughly authenticate your users!  Hey, at least
it's not a complicated thing to do, just kind of pain on everyones end.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 8:10 AM
To: David Buerer; '[EMAIL PROTECTED]'
Subject: Re: [PHP] basic voting


on 12/09/02 12:12 AM, David Buerer ([EMAIL PROTECTED]) wrote:

> Justin, you've just asked for a way to restrict the possible number of
votes
> from any one person to 1, however, you don't want to find out anything
about
> that person!

I'd consider that a restriction to getting lots of votes in a quick
manner... :)


> Although I certainly understand your position, you either have to get from
> them some information specific to the person, like, name, email, DL, SSN,
> and only allow one vote entry per id, or you have track based on cookie,
ip
> address, etc.  A simple non-obtrusive way would be to track by IP, but
then
> you've got the problem of users behind proxies, or multiple users at one
> computer, or 

IP address' aren't an option.

> You pretty much have to ask for something like email or name, or be
willing
> to accept multiple votes from the same person.

There's NOTHING to stop me from entering 24 different names or email
address', so I don't consider these options either.


> Sorry.

It's not your fault :)


Justin French




[PHP] IPlanet Webserver

2002-09-11 Thread Chris Boget

Do any of you guys have experience setting PHP up
with the IPlanet webserver?  We are trying it out (for
a client) and we can't seem to get to so that PHP 
gets the POST or GET variables passed from a form
and would like to talk with someone who's had experience
working with or around this problem.

Chris




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




RE: [PHP] is php4.2 supported on freebsd-4.2

2002-09-11 Thread MET

I'm guessing that pages requiring passing data isn't working correctly
right?  If so here's what you do.

cd php-4.2.2

./configure  (whatever options you want here)

make && make install && make clean

(add the appropriate lines to your httpd.conf file, the ones you have
from 4.1.2 should be just fine)

cp /path/to/php/php-4.2.2/php.ini-dist /usr/local/lib/php.ini

Open /usr/local/lib/php.ini in your prefered text editor and search for
this "register_globals"

Change the value of 'register_globals' to On from Off

...And then your done.

And read this so you understand why this was done:
http://www.zend.com/zend/art/art-sweat4.php


~ Matthew


-Original Message-
From: Anil Garg [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 11:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] is php4.2 supported on freebsd-4.2


Hi,
i am using php.4.1.2. on freebsd 4.2
i  want to upgrade from 4.1.2 to 4.2.2...

The problem is:
1. Is php 4.2.2 supported on freebsd-4.2 ?
2. Can this happen that after upgrade(of php).some code doesnt work
on 4.2.2 which was working on 4.1.2.

thanx and regards
anil


-- 
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] Illegal characters in HTML form element names.

2002-09-11 Thread Jared Williams

Hi,
The HTML standard defines the set of characters that are valid in form
element names. It does not include [ or ] and yet this seems to be the only
way to get a set of form elements grouped into an array for server side
processing.

Why doesnt PHP do (Perl/ASP) automatically create an array when there is
more than one form element with the same name in the post/get data?




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




[PHP] Session Vars problem

2002-09-11 Thread Krispi

Hi,

I have a problem when registering Session variables.
Let me describe.

I have 2 files. In the first one initialization is done and some session
registering.
The second one is my main application. If I call a method from the first
file in my main file , variables are not registered. I use session_start in
both files.


Thx,

  Krispi



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




Re: [PHP] question

2002-09-11 Thread Adam Williams

I just wanted to chime in here and say that Julie Meloni's books are
awesome.  I have PHP Essentials and her Teach yourself PHP in 24 hours
book.  I plan to buy her PHP Fast and Easy 2nd edition very soon.

Adam

On Wed, 11 Sep 2002, Miles Thompson wrote:

> Julie Meloni to the rescue again - http://www.thickbookcom, you'll find a
> tutorial on custom error messages.
> In fact, after working on that you may rethink your approach.
>
> Miles Thompson
>
> At 04:31 PM 9/11/2002 +0300, Meltem Demirkus wrote:
> >Hi,
> >I am working on a process which turn to the previous page when the user
> >enter something wrong in the form on a page .But I also want to warn the
> >user with an error message on this page ...I know using heder : location but
> >I couldn't  add the message ...
> >can anybody help me ? How can I add this message to the page..
> >thanks alot
> >
> >metos
> >
> >
> >--
> >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: IPlanet Webserver

2002-09-11 Thread Neophyte

If PHP is setup and working fine and simply not getting POST or GET vars, it
can depend on the PHP version you have installed. but the

$HTTP_POST_VARS and $HTTP_GET_VARS should work on any version of PHP4.

If your still having trouble and using those arrays then im unsure as to
what else could be wrong without seeing the code.

"Chris Boget" <[EMAIL PROTECTED]> wrote in message
00fc01c259a9$e4eede40$8c01a8c0@ENTROPY">news:00fc01c259a9$e4eede40$8c01a8c0@ENTROPY...
> Do any of you guys have experience setting PHP up
> with the IPlanet webserver?  We are trying it out (for
> a client) and we can't seem to get to so that PHP
> gets the POST or GET variables passed from a form
> and would like to talk with someone who's had experience
> working with or around this problem.
>
> Chris
>
>
>



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




Re: [PHP] Mail() function problem

2002-09-11 Thread Alva Chew

Hi,

does that mean I can do nothing about it?

Alva

"Pekka Saarinen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 9/10/2002, you wrote:
> >Hi Everyone,
> >
> >I did a simple test with this script:
> >
> > >mail("[EMAIL PROTECTED]", "test", "this is a test mail");
> >echo "done";
> >?>
> >
> >I run the script from web accounts on different servers. I can receive
the
> >test mail from some but not from others. Is there any configurations that
I
> >am missing here?
>
> My guesses:
>
> Many mail servers are configured so that they send mail only if the sender
> receives mail at the same time. One other possible pitfall is that reverse
> IP lookup is not working correctly and your server rejects the mail as it
> cannot verify the sender host. Also, many (well configured) servers do not
> send when there is no live account for that sender.
>
>
> -
> Pekka Saarinen
> http://photography-on-the.net
> -
>
>



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




Re: [PHP] IPlanet Webserver

2002-09-11 Thread Henrik Hudson

Make sure you're accessing your variables correctly as well. Remember, 
register_globals is now off by default, so you can't just access POST and GET 
vars by variable name, but insterad use $_POST[varname] or $_GET[varname]

On Wednesday 11 September 2002 10:42, Chris Boget wrote:
> Do any of you guys have experience setting PHP up
> with the IPlanet webserver?  We are trying it out (for
> a client) and we can't seem to get to so that PHP
> gets the POST or GET variables passed from a form
> and would like to talk with someone who's had experience
> working with or around this problem.
>
> Chris

-- 

Henrik Hudson
[EMAIL PROTECTED]

Note:  Beware of Dragons - Thou art crunchy and taste good with ketchup.


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




[PHP] PHP And Apache

2002-09-11 Thread Glenn

Can anyone tell me if the latest version of PHP works with the latest Apache
web server?  When I try to build the server it says its not, but I wondered
if there were any patches or changes I could make for them to work properly?

Thanks,

glenn



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




Re: [PHP] PHP And Apache

2002-09-11 Thread Rasmus Lerdorf

Use the latest Apache 1.3.x and the latest PHP.  Works just fine.  Apache
2.0.x is a completely different beast.

-Rasmus

On Wed, 11 Sep 2002, Glenn wrote:

> Can anyone tell me if the latest version of PHP works with the latest Apache
> web server?  When I try to build the server it says its not, but I wondered
> if there were any patches or changes I could make for them to work properly?
>
> Thanks,
>
> glenn
>
>
>
> --
> 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] Need PHP programmer ASAP..

2002-09-11 Thread Michael Plasse

Hello,

I need a PHP programmer ASAP to help with site updates on large childrens
webiste.

Please reply to: [EMAIL PROTECTED]



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




[PHP] PHP help needed

2002-09-11 Thread Michael Plasse

Hello,

I need a PHP programmer to assist me with updates to childrens website.


Mike



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




Re: [PHP] PHP And Apache

2002-09-11 Thread Glenn

ok then...

thanks

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Use the latest Apache 1.3.x and the latest PHP.  Works just fine.  Apache
> 2.0.x is a completely different beast.
>
> -Rasmus
>
> On Wed, 11 Sep 2002, Glenn wrote:
>
> > Can anyone tell me if the latest version of PHP works with the latest
Apache
> > web server?  When I try to build the server it says its not, but I
wondered
> > if there were any patches or changes I could make for them to work
properly?
> >
> > Thanks,
> >
> > glenn
> >
> >
> >
> > --
> > 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: Sending Attachements through php email form

2002-09-11 Thread Manuel Lemos

Hello,

On 09/10/2002 11:07 AM, Heidi Belal wrote:
> Hi,
> 
> I was wondering if anybody could tell me the best way and how to code sending an 
>attachement with an email form.  I want the user to be able to browse and select the 
>file he wants to attach, and i want the reciepent to be able to see the file that has 
>been attached with the email.

You may want to try this class that lets you do what you want:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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




[PHP] PHP and Special Characters

2002-09-11 Thread Rick King

Apache: 1.3.23
PHP: 4.1.2

Hello PHP Guru's!

I have created a simple web form. When the form is complete and submitted,
the results are emailed to an email account. But I have noticed that the '
character is escaped.
Example: John O\ 'Connor, instead of getting John O'Connor.

Is this a problem within PHP or HTML?
Has anyone else encountered this problem before? If so, what was the
workaround?

Any help would be greatly appreciated!

Rick



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




Re: [PHP] PHP and Special Characters

2002-09-11 Thread Adam Williams

use stripslashes() or turn on magic quotes in php.ini

On Wed, 11 Sep 2002, Rick King wrote:

> Apache: 1.3.23
> PHP: 4.1.2
>
> Hello PHP Guru's!
>
> I have created a simple web form. When the form is complete and submitted,
> the results are emailed to an email account. But I have noticed that the '
> character is escaped.
> Example: John O\ 'Connor, instead of getting John O'Connor.
>
> Is this a problem within PHP or HTML?
> Has anyone else encountered this problem before? If so, what was the
> workaround?
>
> Any help would be greatly appreciated!
>
> Rick
>
>
>
>


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




[PHP] is php-4.2.3 a stable version?

2002-09-11 Thread Anil Garg

Hi,

i am using freebsd4.2
I couldnt find if the latest php-versiono 4.2.3 a stable version ?? i mean
shall i use 4.2.2 or 4.2.3 ?

thanx and regards
anil


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




[PHP] help with making an xslt class

2002-09-11 Thread Geoff

I am trying to make a class to process xslt transformations.

Here is the class:
class xslTransformer extends makexml{
var $xh;
function xslTransformer($xslfile)   {
$this->xh = xslt_create();
$result=xslt_process($this->xh,$this->xmlstr,$xslfile); //errorsif
($result) {
print $result;
}
else {
print "Sorry, the xml could not be transformed by the xsl into";print
"  the \$result variable the reason is that . "xslt_error($this->xh) . 
print " and the error code is " . xslt_errno($this->xh);
}
xslt_free($this->xh);
}
} 

I call it as 

$this->xmlstr is valid xml (I have checked) the makexml class works fine
as well.

Here is the error I get:
Warning: Sablotron error on line 1: XML parser error 3: no element found
in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
Sorry, the xml could not be transformed by the xsl into and the error
code is 2 the $result variable the reason is that XML parser error 3: no
element found






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




RE: [PHP] is php-4.2.3 a stable version?

2002-09-11 Thread MET

PHP 4.2.3 is mainly fixes to 4.2.2 but yes it is stable and a suggested
update.

~ Matthew

-Original Message-
From: Anil Garg [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is php-4.2.3 a stable version?


Hi,

i am using freebsd4.2
I couldnt find if the latest php-versiono 4.2.3 a stable version ?? i
mean shall i use 4.2.2 or 4.2.3 ?

thanx and regards
anil


-- 
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 with making an xslt class

2002-09-11 Thread Brian V Bonini

Isn't this what the salbatron library is for?

> -Original Message-
> From: Geoff [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 2:52 PM
> To: php list
> Subject: [PHP] help with making an xslt class
> 
> 
> I am trying to make a class to process xslt transformations.
> 
> Here is the class:
> class xslTransformer extends makexml  {
>   var $xh;
>   function xslTransformer($xslfile)   {
>   $this->xh = xslt_create();
>   $result=xslt_process($this->xh,$this->xmlstr,$xslfile); 
> //errors  if
> ($result) {
>   print $result;
>   }
>   else {
>   print "Sorry, the xml could not be transformed by the xsl 
> into";print
> "  the \$result variable the reason is that . "xslt_error($this->xh) . 
>   print " and the error code is " . xslt_errno($this->xh);
>   }
>   xslt_free($this->xh);
>   }
> } 
> 
> I call it as 
> 
> $this->xmlstr is valid xml (I have checked) the makexml class works fine
> as well.
> 
> Here is the error I get:
> Warning: Sablotron error on line 1: XML parser error 3: no element found
> in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
> Sorry, the xml could not be transformed by the xsl into and the error
> code is 2 the $result variable the reason is that XML parser error 3: no
> element found
> 
> 
> 
> 
> 
> 
> -- 
> 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] How do I upgrade my version of PHP?

2002-09-11 Thread Monty

I've downloaded the patch file for 4.2.2 to 4.2.3 from the PHP website, but,
not sure what to do with this file. I have a Linux 7.x server. Can anyone
tell me how to patch my version of PHP or point me to a source that explains
how this is done?

Thanks!


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




Re: [PHP] Mail system with folders?

2002-09-11 Thread Leonid Mamtchenkov

Dear Leif K-Brooks,

Once you wrote about "[PHP] Mail system with folders?":
> I'm designing a site, and I want to put mail with folders on it.  Fairly 
> simply, but I'm not sure what to do for the default folders.  I want to 
> have three precreated folders: inbox, trash, and sent.  I'm not sure 
> about the best way to do these.  Any ideas?

I think you should investigate more on the subject of "web mail" if that
is what you need to do.  Usually, php (or any other language) is used to
create an interface for an operational mail server, which can be
accessed via IMAP.  You can find lots of examples at
http://www.freshmeat.net or any other software repository.

Do not reinvent the wheel. ;)

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

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




RE: [PHP] help with making an xslt class

2002-09-11 Thread Geoff

I am using the sablotron xslt library I just want to make a class to 
minimize the code I need to write and make it easier to maintain.

When I do it like so:
// create XSLT processor 
$xh = xslt_create();

// call xslt processor
// Process the document
$result = xslt_process($xh, 'arg:/_xml', $xmldoc->xslstr, NULL,
$arguments); 
if ($result) {
print $result;
}
else {
print "Sorry, the xml could not be transformed by the xsl into";
print "  the \$result variable the reason is that " . xslt_error($xh)
. 
print " and the error code is " . xslt_errno($xh);
}
xslt_free($xh);
it works fine. I just don't seem to be able to make it work in a class.


On Wed, 2002-09-11 at 14:18, Brian V Bonini wrote:
> Isn't this what the salbatron library is for?
> 
> > -Original Message-
> > From: Geoff [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 11, 2002 2:52 PM
> > To: php list
> > Subject: [PHP] help with making an xslt class
> > 
> > 
> > I am trying to make a class to process xslt transformations.
> > 
> > Here is the class:
> > class xslTransformer extends makexml{
> > var $xh;
> > function xslTransformer($xslfile)   {
> > $this->xh = xslt_create();
> > $result=xslt_process($this->xh,$this->xmlstr,$xslfile); 
> > //errorsif
> > ($result) {
> > print $result;
> > }
> > else {
> > print "Sorry, the xml could not be transformed by the xsl 
> > into";  print
> > "  the \$result variable the reason is that . "xslt_error($this->xh) . 
> > print " and the error code is " . xslt_errno($this->xh);
> > }
> > xslt_free($this->xh);
> > }
> > } 
> > 
> > I call it as 
> > 
> > $this->xmlstr is valid xml (I have checked) the makexml class works fine
> > as well.
> > 
> > Here is the error I get:
> > Warning: Sablotron error on line 1: XML parser error 3: no element found
> > in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
> > Sorry, the xml could not be transformed by the xsl into and the error
> > code is 2 the $result variable the reason is that XML parser error 3: no
> > element found
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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




[PHP] Query result to an array

2002-09-11 Thread Christian Ista

Hello,

A query return x rows, by rows there are 4 fields. I'd like to put the
result in an array, a 2 dimensions array. Could you tell me how to do
that ?

Bye



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




Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On September 11, 2002 14:12, Christian Ista wrote:
> Hello,
>
> A query return x rows, by rows there are 4 fields. I'd like to put the
> result in an array, a 2 dimensions array. Could you tell me how to do
> that ?

  Something like this may work for you:

# Connect to db, make query, etc.

while( $temp = mysql_fetch_row($mysql_result_handle) ) {
$array[] = array(
'key0' = array(
'keya' => $temp[0],
'keyb' => $temp[1],
),
'key1' = array(
'keya' => $temp[2],
'keyb' => $temp[3],
)
);
}

Good luck!
- --zak
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9f6tAb6QONwsK8bIRAvjKAJwKN0yvbGaztQzZOKYiy22FMqQ5EgCeP3AH
4sGpVTTX6gUJp8fZJ8xXEfQ=
=eaeg
-END PGP SIGNATURE-


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




Re: [PHP] Displaying value different from actual value

2002-09-11 Thread Zak Greant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On September 11, 2002 07:57, Dave Rosenberg wrote:
> I'm not sure this is possible, but here's what I'd like to do:
> I know that in order for a set of records from MySQL to display in
> numerical order on a web page, you need to make the column type
> "Integer," but here's my situation:
>
> I'm creating a database of contracts that my organization has.
> Normally, there is a dollar amount on these contracts, and I'd like to
> be able to sort by that value (therefore the Integer column type).
> However, we have some fee-based contracts, and I'd like a way to display
> the amount as "Fee Based" even though I can't enter this in the database
> because of the column type.  Is there a way in PHP to have it display
> this although with some kind of if/then statement or something of that
> sort?
>
> Contract A  Fee-based
> Contract B  7
> Contract C   1250
> Contract D  5

  Hi Dave,

  You can also do this in your SQL query.

  For example:

  If your table contains this:
+--+-+
| contract | amount  |
+--+-+
| Jillco   | 100 |
| Jackco   |   1 |
| ChrisInc |NULL |
+--+-+

  The the following select:

SELECT contract, IFNULL(amount, "Fee Based") amount FROM contracts;

  will return:
Jillco  100
Jackco  1
ChrisincFee Based

Cheers!
- -- 
Zak Greant <[EMAIL PROTECTED]>
MySQL Community Advocate

Feed the Dolphin! Order MySQL support from the MySQL developers at
https://order.mysql.com/?ref=mzgr

"Gosh, Batman! The nobility of the almost-human porpoise." --Robin
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9f6iab6QONwsK8bIRAjoJAJ9rswcUKNzR5z9wD7HaKqJ42raiwgCeOzVs
TMSVwY5J18Y3zeEmRut9Wyg=
=G1gi
-END PGP SIGNATURE-


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




[PHP] cookie problem...

2002-09-11 Thread rtrt

we are using apache 1.3.12 server, php 4.2.3 on linux.
Before, we didn't write cookies.txt on harddisk. We changed some
configuration in httpd.conf like.
We disabled  mod_proxy module and then cookie had been wrote. But now, we
are not reading
cookie variables from cookies.txt (Netscape). I konw problem could be very
easy but.
I am unsleepy two days.


Tansel Akgul




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




Re: [PHP] ucwords()? and åäö

2002-09-11 Thread Zak Greant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Here is a quick replacement script* for ucwords() that can be made to handle 
accented characters or interesting casing rules. It is a bit uppercase happy 
- - uppercasing any letter that comes after a non-letter character.

*(Taken from the PHP Functions Essential Reference 
(http://fooassociates.com/phpfer/))

 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D',
   'e' => 'E', 'f' => 'F', 'g' => 'G', 'h' => 'H',
   'i' => 'I', 'j' => 'J', 'k' => 'K', 'l' => 'L',
   'm' => 'M', 'n' => 'N', 'o' => 'O', 'p' => 'P',
   'q' => 'Q', 'r' => 'R', 's' => 'S', 't' => 'T',
   'u' => 'U', 'v' => 'V', 'w' => 'W', 'x' => 'X',
   'y' => 'Y', 'z' => 'Z'
);

$string = <<<_JABBERWOCKY_
"and, has thou slain the jabberwock?
come to my arms, my beamish boy!
o frabjous day! callooh! callay!"
he chortled in his joy.
_JABBERWOCKY_;

echo custom_ucwords($map, $string);
?>


Cheers!
- --zak



On September 11, 2002 08:27, Ville Mattila wrote:
> I can't say correct answer to this, but want also notify that
> strtoupper() -function doesn't affect to those special charters å, ä and ö
> that are very common in Finnish language.
>
> Ville
>
>
> -Original Message-
> From: Tommi Virtanen [mailto:[EMAIL PROTECTED]]
> Sent: 11. syyskuuta 2002 17:14
> To: [EMAIL PROTECTED]
> Subject: [PHP] ucwords()?
>
>
> Hi!
>
> I'll try to convert field first char to upper by using ucwords(). Well,
> this doesn't
> seem to work correct.
>
> Well maybe error came, because that characteres are not standard (they
> are special characterers, finnish language).
>
> Example:
>
> $work_text = "perhepäivähoitaja";
>
> $work_text = ucwords (strtolower ($work_text);
>
> print $work_name -> PerhepäIväHoitaja). Every char after finnish-ä is
> upper.
>
>
> How I can correct this error??
>
> gustavus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9f6nlb6QONwsK8bIRAhANAJ9Xab9JmsjKxlp+KF01822QmK8zFQCbBXW+
92J2XRJgKmRXRAlhp7QbwTM=
=QEMR
-END PGP SIGNATURE-


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




RE: [PHP] Query result to an array

2002-09-11 Thread Christian Ista

> while( $temp = mysql_fetch_row($mysql_result_handle) ) {
>   $array[] = array(
>   'key0' = array(
>   'keya' => $temp[0],
>   'keyb' => $temp[1],
>   ),
>   'key1' = array(
>   'keya' => $temp[2],
>   'keyb' => $temp[3],
>   )
>   );
> }

Hello,

Thanks for your help. But that's not work at all.

bye



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




[PHP] open_basedir without safe mode?

2002-09-11 Thread Ville Mattila

Hi there,

I was wondering if there is a possibility to get open_basedir preferences
(also set via .htaccess) active in a server running not PHP in open_basedir.
I should create a small home site space for some users with PHP equipped,
but I don't like to put safe mode on as there are some other advanced (not
runnable in safe mode) scripts on the same machine. open_basedir would limit
the user's access to their own directories, but it seems not to work wihtout
safe mode.

Any ideas?

Ville


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




[PHP] Re: How do I upgrade my version of PHP?

2002-09-11 Thread nicos

You should use the patch command, feel free to "man patch".

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Monty" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I've downloaded the patch file for 4.2.2 to 4.2.3 from the PHP website,
but,
> not sure what to do with this file. I have a Linux 7.x server. Can anyone
> tell me how to patch my version of PHP or point me to a source that
explains
> how this is done?
>
> Thanks!
>



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




Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On September 11, 2002 15:05, Christian Ista wrote:
> > while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> > $array[] = array(
> > 'key0' = array(
> > 'keya' => $temp[0],
> > 'keyb' => $temp[1],
> > ),
> > 'key1' = array(
> > 'keya' => $temp[2],
> > 'keyb' => $temp[3],
> > )
> > );
> > }
>
> Hello,
>
> Thanks for your help. But that's not work at all.

  Dear Christian,

  I assume that you encountered some syntax errors in the code?
  (or was there another problem?)

  Anyhow, here is the corrected version

while( $temp = mysql_fetch_row($mysql_result_handle) ) {
$array[] = array(
'key0' => array(
'keya' => $temp[0],
'keyb' => $temp[1]
),
'key1' => array(
'keya' => $temp[2],
'keyb' => $temp[3]
)
);
}

- --zak
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9f7K3b6QONwsK8bIRAiATAJ9TPv/28hZiF136TePF5SXTgDinUACgkg6w
BJVDvRVsVzqplDLOD/u5u4E=
=NbgV
-END PGP SIGNATURE-


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




Re: [PHP] open_basedir without safe mode?

2002-09-11 Thread Rasmus Lerdorf

safe mode and open_basedir are completely separate.

On Thu, 12 Sep 2002, Ville Mattila wrote:

> Hi there,
>
> I was wondering if there is a possibility to get open_basedir preferences
> (also set via .htaccess) active in a server running not PHP in open_basedir.
> I should create a small home site space for some users with PHP equipped,
> but I don't like to put safe mode on as there are some other advanced (not
> runnable in safe mode) scripts on the same machine. open_basedir would limit
> the user's access to their own directories, but it seems not to work wihtout
> safe mode.
>
> Any ideas?
>
> Ville
>
>
> --
> 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




  1   2   >