Re: [PHP] md5 question

2002-12-05 Thread Chris Wesley
On Fri, 6 Dec 2002, conbud wrote:

> Hey. Is there a way to get the actual word/phrase from the long string that
> the md5 hash creates. Lets say, is there a way find out what
> b9f6f788d4a1f33a53b2de5d20c338ac
> stands for in actuall words ?

In all cases, an md5sum string means, "You've got better things to do
besides trying to figure out what this string means, trust me."  ;)

Check RFC 1321.  http://www.ietf.org/rfc/rfc1321.txt

~Chris


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




[PHP] md5 question

2002-12-05 Thread conbud
Hey. Is there a way to get the actual word/phrase from the long string that
the md5 hash creates. Lets say, is there a way find out what
b9f6f788d4a1f33a53b2de5d20c338ac
stands for in actuall words ?

Lee



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




Re: [PHP] MySQL ?

2002-12-05 Thread Tom Rogers
Hi,

Friday, December 6, 2002, 2:08:42 AM, you wrote:
h> I am really sorry but i can't find any good mySQL good mailing list...

h> How can i make a little php function to check if a table exists ?

h> Thanks a lot,
h> Hacook




 function table_exists($table){
  return (@mysql_query('SELECT count(*) FROM '.$table));
 }
 
 //usage
 $con = @mysql_connect("host" , "user" , "password");
 $table = "database.table";
 if(table_exists($table)){
echo "Table $table exists. ";
 }else{
echo "Table $table does not exist.";
 }



-- 
regards,
Tom


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




RE: [PHP] Need Redirection Trick...

2002-12-05 Thread @ Nilaab
Great Jason, thanks a lot. I was just looking for some direction and I think
you just helped me find it. Thanks for taking the time to look at my
problem.:)

- Nilaab

> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 05, 2002 11:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Need Redirection Trick...
>
>
> On Friday 06 December 2002 11:35, [EMAIL PROTECTED] wrote:
> > Hello Everyone,
>
> [lots of irrelevant stuff snipped]
>
> > The second thing that should happen is that if there are actually no
> > subcategories for the selected category then subcat_id should
> equal 0 and
> > the script should redirect back to the same page with the GET
> variables of
> > cat_id and subcat_id (which is equal to zero at this point).
> The problem is
> > that I cannot redirect with a header() function because content
> is already
> > sent to the browser at the beginning of the script (the list of
> > categories). Is there any other way that I can redirect and send the
> > variables of cat_id and subcat_id to the page in the second situation
> > mentioned earlier? Register Globals is on.
>
> 1) BEFORE you output anything make your check whether you need to
> redirect.
> After all, if you're going to be redirecting, why output anything at all?
>
> or
>
> 2) Use the output buffering functions.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Do not drink coffee in early A.M.  It will keep you awake until noon.
> */
>
>
> --
> 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] Need Redirection Trick...

2002-12-05 Thread Roger Lewis
Nilaab,

This sounds similar to what I was trying to do recently, i.e creating
dependent dropdown boxes.  Here's a link to a demo of the code that might be
of interest to you.
http://www.onlinetools.org/tools/easyselectdata/index.html

Cheers.

Roger

-Original Message-
From: @ Nilaab [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 7:36 PM
To: Php-General
Subject: [PHP] Need Redirection Trick...

Hello Everyone,

I have a simple problem that, I think, might require a little trick to be
used. I have a list of products in a database that is organized by
categories and subcategories. Categories can have as many subcategories as
it wants, but some categories don't need to have a subcategory at all.

In the following code "cat" refers to category and "subcat" refers to
subcategory.

cat_data and subcat_data refers to a multi-dimentional array, pulled from
the DB, with values of an id and a name.
example: cat_data[row_number][name_of_category] and
cat_data[row_number][id].

Ok, before I ask the question, here's the code:

[-- snip --]
get_cat_data();
for ($i=0; $i < count($cat_data); $i++) {
   echo '' .
$cat_data[$i]["name"] . "\n";
   if ($cat_id) {
  $subcat_data = $db->get_subcat_data($cat_id);
  if ($subcat_data != 0 && ($cat_id == $cat_data[$i]["id"])) {
 for ($j=0; $j < count($subcat_data); $j++) {
echo '- ' .
$subcat_data[$j]["name"] . "\n";
 }
  }
  elseif ($subcat_data == 0 && ($cat_id == $cat_data[$i]["id"])) {
 $subcat_id = 0;
 header("Location: $PHP_SELF?cat_id=$cat_id&subcat_id=$subcat_id");
  }
   }
}

?>
[-- snip --]

What this does is it lists all the categories in the database, initially.
When the user clicks on a category, the script will check if the category
has any subcategories associated with it. One of two things should happen
after this.

First, it should list all the subcategories directly below the category it
is associated with, with a little indention to specify that they are
subcategories. The subcategories listed will be a link that passes over the
cat_id and subcat_id GET variables to the same page.

example:category 1
category 2
   - subcategory 1
   - subcategory 2
   - subcategory 3
category 3
.
.
.

This part of the script works fine.

The second thing that should happen is that if there are actually no
subcategories for the selected category then subcat_id should equal 0 and
the script should redirect back to the same page with the GET variables of
cat_id and subcat_id (which is equal to zero at this point). The problem is
that I cannot redirect with a header() function because content is already
sent to the browser at the beginning of the script (the list of categories).
Is there any other way that I can redirect and send the variables of cat_id
and subcat_id to the page in the second situation mentioned earlier?
Register Globals is on.

- Nilaab



--
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] Need Redirection Trick...

2002-12-05 Thread Jason Wong
On Friday 06 December 2002 11:35, [EMAIL PROTECTED] wrote:
> Hello Everyone,

[lots of irrelevant stuff snipped]

> The second thing that should happen is that if there are actually no
> subcategories for the selected category then subcat_id should equal 0 and
> the script should redirect back to the same page with the GET variables of
> cat_id and subcat_id (which is equal to zero at this point). The problem is
> that I cannot redirect with a header() function because content is already
> sent to the browser at the beginning of the script (the list of
> categories). Is there any other way that I can redirect and send the
> variables of cat_id and subcat_id to the page in the second situation
> mentioned earlier? Register Globals is on.

1) BEFORE you output anything make your check whether you need to redirect. 
After all, if you're going to be redirecting, why output anything at all?

or

2) Use the output buffering functions.

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

/*
Do not drink coffee in early A.M.  It will keep you awake until noon.
*/


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




Re: [PHP] MySQL ?

2002-12-05 Thread Justin French
1. there is a MySQL mailing list, details can be found on mysql.com

2. i just did a really simple search on php net for "mysql table", and got
the following amongst a few results:

mysql_field_table()
mysql_list_tables()
mysql_tablename()

it would be good if you could search the php (and mysql) sites before
posting.


Justin



on 06/12/02 3:08 AM, hacook ([EMAIL PROTECTED]) wrote:

> I am really sorry but i can't find any good mySQL good mailing list...
> 
> How can i make a little php function to check if a table exists ?
> 
> Thanks a lot,
> Hacook
> 
> 

Justin French

http://Indent.com.au
Web Development & 
Graphic Design



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




[PHP] empty string parameters to backslashes?

2002-12-05 Thread andyw
Hey all -
I'm trying to track down a problem with someone else's
code. Our hosting service changed PHP versions on us
(up to 4.0.6), and everything broke. I think I have
tracked down at least part of the problem. We have a
function:

   funA($args)
   {
 $file = substr($args[0],0, -1); //file to open from path
 $alt  = $args[1]; //if invalid/no file, use this file
 $name = $args[2]; //the name associated with the tabs
 $size = $args[3]; //size to make the box (optional)

 print "funA START: file: " . $file . ", name: " . $name . ", alt: " . $alt . ", 
size: " . $size . "";

 . . .
   }

Called like this:
   funA("nameString", " ", " ", "177");

But the output of the print statement looks like this:

funA START: file: productBrief, name: \, alt: \, size: 177\

So where did the darned backslashes come from? Any ideas?

thanks,
andy wallace
[EMAIL PROTECTED]


-- 
Have you been SCROOMed? http://www.scroom.com
   Andy Wallace, Publisher   [EMAIL PROTECTED]
 Get the Opera Browser!http://www.opera.com

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




[PHP] Re:

2002-12-05 Thread Karl James
Help need one on one 
I was wondering if anyone would be willing to be a mentor 
While im doing this project.
 
Im using mysql and php
 
To do a login script with username and passwords.
And also to do insert to database from a register form.
 
Then I want to do a online fantasy football league where you 
Can trade players and add/drop players of your roster.
 
Please email me if interested.
 
Thanks 
Karl james
 



Re: [PHP] PHP includes without access to the default directory

2002-12-05 Thread Morgan Hughes
On Thu, 5 Dec 2002, Gundamn wrote:

> I have a hosted account. As such, I am unable to use the default location
> for files when used with the include command. So could somebody tell me how
> I can either make it go to a different directory, or to link to something
> (and how to add the variable as the filename)?
>
> Thank you in advance.

  My usual approach is to have an includes/ directory, at the same level
  as the htdocs/ directory, and thus outside the webspace.  In this
  includes/ directory I put an include.php file which includes any other
  files needed with include_once, like so:

  

  In htdocs/ I put another include.php, which basically says:
  

  In any subdirectories of htdocs/ I put a similar file, except one level
  deeper it'd be:
  

  For each subdir level, add a ../ to the define.

  On a hosted account, you may instead have to put your includes/
  directory elsewhere.  In this case, the include.php in htdocs/ would
  just be
  

  and the sub-directory scripts just
  

  Either way, the goal though is to have an include.php file in each
  directory of your webspace that references a single include.php file
  with relative (../) paths.  Coupled with keeping your includes outside
  the webroot, this can make include files a lot less troublesome.

  A bit of overhead, true, but it keeps my configs, db passwords, and
  library code entirely out of the webspace.  I've used it successfully in
  a large site (150 user-accessible scripts, 25 library scripts, totalling
  about 1M of php)

  One big warning about include files... PHP's include functions work
  counter-intuitively in that all relative paths are relative to the
  script that caught the user's request.  Thus if you have a bunch of
  scripts in a lib/ directory, they can't include each other without
  taking into account the path from the calling script...  Thus why I try
  to define INC_DIR as early as possible if it's relative.

  Hope this helps...

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356




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




[PHP] Need Redirection Trick...

2002-12-05 Thread @ Nilaab
Hello Everyone,

I have a simple problem that, I think, might require a little trick to be
used. I have a list of products in a database that is organized by
categories and subcategories. Categories can have as many subcategories as
it wants, but some categories don't need to have a subcategory at all.

In the following code "cat" refers to category and "subcat" refers to
subcategory.

cat_data and subcat_data refers to a multi-dimentional array, pulled from
the DB, with values of an id and a name.
example: cat_data[row_number][name_of_category] and
cat_data[row_number][id].

Ok, before I ask the question, here's the code:

[-- snip --]
get_cat_data();
for ($i=0; $i < count($cat_data); $i++) {
   echo '' .
$cat_data[$i]["name"] . "\n";
   if ($cat_id) {
  $subcat_data = $db->get_subcat_data($cat_id);
  if ($subcat_data != 0 && ($cat_id == $cat_data[$i]["id"])) {
 for ($j=0; $j < count($subcat_data); $j++) {
echo '- ' .
$subcat_data[$j]["name"] . "\n";
 }
  }
  elseif ($subcat_data == 0 && ($cat_id == $cat_data[$i]["id"])) {
 $subcat_id = 0;
 header("Location: $PHP_SELF?cat_id=$cat_id&subcat_id=$subcat_id");
  }
   }
}

?>
[-- snip --]

What this does is it lists all the categories in the database, initially.
When the user clicks on a category, the script will check if the category
has any subcategories associated with it. One of two things should happen
after this.

First, it should list all the subcategories directly below the category it
is associated with, with a little indention to specify that they are
subcategories. The subcategories listed will be a link that passes over the
cat_id and subcat_id GET variables to the same page.

example:category 1
category 2
   - subcategory 1
   - subcategory 2
   - subcategory 3
category 3
.
.
.

This part of the script works fine.

The second thing that should happen is that if there are actually no
subcategories for the selected category then subcat_id should equal 0 and
the script should redirect back to the same page with the GET variables of
cat_id and subcat_id (which is equal to zero at this point). The problem is
that I cannot redirect with a header() function because content is already
sent to the browser at the beginning of the script (the list of categories).
Is there any other way that I can redirect and send the variables of cat_id
and subcat_id to the page in the second situation mentioned earlier?
Register Globals is on.

- Nilaab



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




Re: [PHP] Sending no content-type header?

2002-12-05 Thread Leif K-Brooks
 Ok, thanks a lot.  For what it's worth, here's my simple .bat file for 
executing php files:
@ECHO OFF
IF NOT EXIST %1.php goto usage
php.exe -q %1.php
goto end
:usage
echo ÚÄÄÄ¿
echo ³   USAGE   ³
echo ³Type "php.bat" (without quotes)³
echo ³ followed by the  name of a³
echo ³valid php file without the .php³
echo ³extension. ³
echo ÀÄÄÄÙ
:end

Chris Wesley wrote:

On Thu, 5 Dec 2002, Leif K-Brooks wrote:
 

I'm running a few simple php scripts from the (windows) command line.
Since I'm not using a web browser to view it, the HTTP headers are
annoying and pointless.  I've turned expose_php off in php.ini, but
commenting out default_mimetype changes nothing, and setting it to an
empty string sends a blank content-type header.  Is there any way to do
this?
   


php.exe -q

   ~Chris


 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.





Re: [PHP] Sending no content-type header?

2002-12-05 Thread Chris Wesley
On Thu, 5 Dec 2002, Leif K-Brooks wrote:
> I'm running a few simple php scripts from the (windows) command line.
>  Since I'm not using a web browser to view it, the HTTP headers are
> annoying and pointless.  I've turned expose_php off in php.ini, but
> commenting out default_mimetype changes nothing, and setting it to an
> empty string sends a blank content-type header.  Is there any way to do
> this?

php.exe -q

~Chris


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




[PHP] Sending no content-type header?

2002-12-05 Thread Leif K-Brooks
I'm running a few simple php scripts from the (windows) command line. 
Since I'm not using a web browser to view it, the HTTP headers are 
annoying and pointless.  I've turned expose_php off in php.ini, but 
commenting out default_mimetype changes nothing, and setting it to an 
empty string sends a blank content-type header.  Is there any way to do 
this?

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



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



RE: [PHP] Easy array stuff I think for those who can I guess.

2002-12-05 Thread John W. Holmes
If this is mysql, you can use

SELECT * FROM konkuranse ORDER BY RAND() LIMIT 1

To get a random row and skip all that stuff you have...

---John Holmes...

> -Original Message-
> From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 05, 2002 5:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Easy array stuff I think for those who can I guess.
> 
> Hi!
> 
> I am trying to get out a value of an array that I have made from a
query
> and
> deliver the value into a variable. I have made this code. Am I totally
> lost?
> 
> 
> while ($myrow = mysql_fetch_array($result));
> {
> 
>  $id = $myrow['id'];
> 
>  $deltaker[] = array ($id);
> 
> }
> 
> $limit = count($deltaker);
> 
> 
> $finn_vinner = rand(0,$limit);
> 
> $vinner_deltaker = $deltaker[$finn_vinner];
> 
> $vinner_id = current($vinner_deltaker);
> 
> 
> $sql2 = "SELECT * FROM konkuranse WHERE id = '$vinner_id'";
> 
> 
> Best regards Raymond
> 
> 
> 
> --
> 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] Hiding Errors

2002-12-05 Thread John W. Holmes
> Is there a way to have errors in script not output to the screen? I
have a
> page that creates an error which really isn't a problem and I don't
want
> users to see the error message.

If this is a production machine, you should have display.errors OFF in
php.ini

---John Holmes...



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




[PHP] PHP includes without access to the default directory

2002-12-05 Thread Gundamn
I have a hosted account. As such, I am unable to use the default location
for files when used with the include command. So could somebody tell me how
I can either make it go to a different directory, or to link to something
(and how to add the variable as the filename)?

Thank you in advance.



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




[PHP] Re: PHP and Ensim Question

2002-12-05 Thread UberGoober
For those that don't know what ensim is, its a virtual hosting software
(www.ensim.com),

Mike - There is another setting in /etc/httpd/conf/httpd.conf to set safe
mode off. I don't suggest you do this though.

I would suggest you use the ensim bulliten board for these questions IMOHO.

--

"Mike Bowers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have a question regarding PHP Safe-Mode and Ensim. On my master confing
(/etc/php.ini) safe mode is off. But on each domain and site I installed on
the server the local config file for that site turns safemode on. Doesn
anyone know where Ensim puts the config files? I've tried to find them and a
few of my scripts I run my site with wont work with safe mode.

Mike Bowers
PlanetModz Gaming Network Webmaster
http://www.planetmodz.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002



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




[PHP] phpOpenTracker.

2002-12-05 Thread Dave Mc
Hi,
Is anyone on the list using this package? I've searched and can
find no examples of its use, outside those provided on the OpenTracker
Website. Is it possible to use the package on multiple hosted sites? All
my virtuals show up as one site and the referers include my site.
Confused and looking for pointers.


Dave.





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




Re: [PHP] Advice with encrypting+storing sensitive data

2002-12-05 Thread bahwi
Sorry, it was late at night. I'm glad you have the SSL and everything 
else already taken care of.

What I meant was for you to build your own session system, so that it is 
secure, instead of using PHP's built in session system. Someone once 
said that it has a 1% chance of cleaning up the sessions, and that would 
be the secure data(the passphrase, even if encrypted) on the system. If 
you build your own, you can change that 1%. There may be another way. 
Also, if you build it yourself, you will understand what happens exactly 
and will be able to hide the data perhaps a bit more than the regular 
sessions.

I hope this makes more sense. If not, tell me and I'll try to explain it 
again. Sorry! =)

Robert Mena wrote:

I do not think I understood your ideia : 
 

The next best thing is to store it in session
variables, but build your own system perhaps, and
   

yes, encrypt it lightly with some system and a 
 

system passphrase
   

--Joseph Guhlin 
http://www.josephguhlin.com/ 
Web Programmer / Unix Consultant / PHP Programmer




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



Re: [PHP] Advice with encrypting+storing sensitive data

2002-12-05 Thread Robert Mena
Thanks Bahwi, 

I agree with you regarding the client-side aspect.
But since we are talking about a regular web-based
application in php I think I will have to deal with
that.

The other security concerns are already addressed,
such as the use of SLL to encrypt the traffic and
possibly the use of an encoder do hide the source
code.

I do not think I understood your ideia : 
>The next best thing is to store it in session
> variables, but build your own system perhaps, and
yes, encrypt it lightly with some system and a 
> system passphrase




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

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




[PHP] SuSE 8.0 php 4.1.2 .spec file

2002-12-05 Thread Razvan Cosma
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

  Hello,

 Maybe I should post this to the -install mlist, but it is not the
installation (./configure, make...) that causes problems, but the fact
that I want to keep dependencies. So - does anyone have a working $subj?
 Thank you very much for any hint.


http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xAD674062
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE979y1lDG6Z61nQGIRAm9rAJ9VL3dDzD/B1gxFbA7y4YED8SeZggCg3zyB
2HGLx0vyi5cNLmjzntyfe8c=
=xqqI
-END PGP SIGNATURE-


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




[PHP] PHP and Ensim Question

2002-12-05 Thread Mike Bowers



I have a question 
regarding PHP Safe-Mode and Ensim. On my master confing (/etc/php.ini) safe mode 
is off. But on each domain and site I installed on the server the local config 
file for that site turns safemode on. Doesn anyone know where Ensim puts 
the config files? I've tried to find them and a few of my scripts I run my site 
with wont work with safe mode.
 
Mike Bowers
PlanetModz Gaming Network Webmaster 
http://www.planetmodz.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for 
viruses
using Norton AV 2002


[PHP] Easy array stuff I think for those who can I guess.

2002-12-05 Thread Raymond Lilleodegard
Hi!

I am trying to get out a value of an array that I have made from a query and
deliver the value into a variable. I have made this code. Am I totally lost?


while ($myrow = mysql_fetch_array($result));
{

 $id = $myrow['id'];

 $deltaker[] = array ($id);

}

$limit = count($deltaker);


$finn_vinner = rand(0,$limit);

$vinner_deltaker = $deltaker[$finn_vinner];

$vinner_id = current($vinner_deltaker);


$sql2 = "SELECT * FROM konkuranse WHERE id = '$vinner_id'";


Best regards Raymond



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




Re: [PHP] Looping Addition

2002-12-05 Thread Stephen
No, I wasn't going to ask that. But thanks for the info. :P


- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "Kevin Stone" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 3:14 PM
Subject: Re: [PHP] Looping Addition


> > But then, if the user entered 5 - 6, it should be -1 but it'd return
> > positive one... Is there another way?
>
> Come on, man... this is addition and subtraction. You can't figure it out?
>
> > > You simply need the absolute value of the difference.  So taking
> Stephen's
> > > example below..
> > >
> > > $total = 0;
>
> Look, right here, you're setting the total to zero, so now everything will
> be subtracted from zero. If you want everything to be subtracted from the
> first number, the set $total equal to the first number and loop through
the
> remainder.
>
> $total = $_POST['nums'][0];
>
> $cnt = count($_POST['nums']);
> for($x=1;$x<$cnt;$x++)
> { $total -= $_POST['nums'][$x]; }
>
> And I'm sure your next post will be "but how will I use that if I want to
go
> back to addition/multiplication/division???";
>
> Here, assuming $mode can be set to "add","sub","mul" or "div":
>
> $total = $_POST['nums'][0];
> $cnt = count($_POST['nums']);
> for($x=1;$x<$cnt;$x++)
> {
>   switch($mode)
>   {
> case "add": $total += $_POST['nums'][$x]; break;
> case "sub": $total -= $_POST['nums'][$x]; break;
> case "mul": $total *= $_POST['nums'][$x]; break;
> case "div": $total /= $_POST['nums'][$x]; break;
>   }
> }
> echo $total;
>
> Plenty of other ways to do it, too, that may be more efficient. And I
> couldn't honestly tell you if *= and /= work and I don't want to go see.
>
> Hope that helps. Good luck.
>
> ---John Holmes...
>
>
> --
> 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] Hiding Errors

2002-12-05 Thread Brad Pauly
On Thu, 2002-12-05 at 14:32, vernon wrote:
> Is there a way to have errors in script not output to the screen? I have a
> page that creates an error which really isn't a problem and I don't want
> users to see the error message.

You can also use set_error_handler to deal with errors however you like.

http://www.php.net/manual/en/function.set-error-handler.php

HTH,
Brad


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




[PHP] Re: Passthru / exec question - '127' returned

2002-12-05 Thread Lee P. Reilly
Ahhh... no reply necessary.
safe_mode :-o


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




[PHP] Passthru / exec question - '127' returned

2002-12-05 Thread Lee P. Reilly
Hi,

I've ran into a problem using the passthru/exec commands with RH8. When
I try and run my program (or even "pwd", "ls", etc) the number '127' is
returned every_time. With passthru, the size of the optional return
array is 0. Can anyone fathom a guess at the problem? Is the 127 value
signifcant?

Thanks in advance.

- Best regards,

   Lee



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




Re: [PHP] Hiding Errors

2002-12-05 Thread bahwi
I'm not too familiar with this method, but trying putting the @ symbol
in front of the statement.

ex:

$file = @fopen(.);

Hope this helps.

--Joseph Guhlin 
http://www.josephguhlin.com/ 
Web Programmer / Unix Consultant / PHP Programmer




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



Re: [PHP] Hiding Errors

2002-12-05 Thread Richard Baskett
If it is a function that you are getting an error on, just go ahead and put
a '@' sign before the function so for example @fopen(); or you can change
the error reporting in the php.ini file.  I do believe there is an error
reporting function also, but off the top of my head I cant remember what it
is.

Cheers!

Rick

"The human mind is not capable of grasping the Universe. We are like a
little child entering a huge library. The walls are covered to the ceilings
with books in many different tongues. The child knows that someone must have
written these books. It does not know who or how. It does not understand the
languages in which they are written. But the child notes a definite plan in
the arrangement of the books---a mysterious order which it does not
comprehend, but only dimly suspects." - Albert Einstein

> From: "vernon" <[EMAIL PROTECTED]>
> Date: Thu, 5 Dec 2002 16:32:31 -0500
> To: [EMAIL PROTECTED]
> Subject: [PHP] Hiding Errors
> 
> Is there a way to have errors in script not output to the screen? I have a
> page that creates an error which really isn't a problem and I don't want
> users to see the error message.
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




[PHP] Hiding Errors

2002-12-05 Thread vernon
Is there a way to have errors in script not output to the screen? I have a
page that creates an error which really isn't a problem and I don't want
users to see the error message.

Thanks



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




[PHP] Re: [PEAR-DEV] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Arnaud Limbourg
> Where's the PEAR context within the marketing text?

Please, don't start any troll/flame war.

Arnaud.

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




Re: [PHP] Q: Use getImageSize() on image data from email?

2002-12-05 Thread Morgan Hughes
On Thu, 5 Dec 2002, Mans Jonasson wrote:

> Hi all,
> I am trying to use getImageSize() on imagedata I am receiving in an
> e-mail and collecting with imap_fetchstructure() et al. What I have in
> my $image variable is just the actual image data - no headers or
> anything, and of course getImageSize() doesn't work that way.
(snip)

  The imageCreateFromString() function may help you here, this is exactly
  what it's for.  Unfortunately many people have had trouble with it.  In
  your situation, I'd write the thing out to a temporary file.

  In that case I'd consider using ImageMagick's identify command rather
  than getImageSize(), since it handles many more image types.  Depending
  on what you need you may find the -verbose option helpful, as it gives
  tons of information, but is slow...

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356




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




Re: [PHP] Looping Addition

2002-12-05 Thread 1LT John W. Holmes
> But then, if the user entered 5 - 6, it should be -1 but it'd return
> positive one... Is there another way?

Come on, man... this is addition and subtraction. You can't figure it out?

> > You simply need the absolute value of the difference.  So taking
Stephen's
> > example below..
> >
> > $total = 0;

Look, right here, you're setting the total to zero, so now everything will
be subtracted from zero. If you want everything to be subtracted from the
first number, the set $total equal to the first number and loop through the
remainder.

$total = $_POST['nums'][0];

$cnt = count($_POST['nums']);
for($x=1;$x<$cnt;$x++)
{ $total -= $_POST['nums'][$x]; }

And I'm sure your next post will be "but how will I use that if I want to go
back to addition/multiplication/division???";

Here, assuming $mode can be set to "add","sub","mul" or "div":

$total = $_POST['nums'][0];
$cnt = count($_POST['nums']);
for($x=1;$x<$cnt;$x++)
{
  switch($mode)
  {
case "add": $total += $_POST['nums'][$x]; break;
case "sub": $total -= $_POST['nums'][$x]; break;
case "mul": $total *= $_POST['nums'][$x]; break;
case "div": $total /= $_POST['nums'][$x]; break;
  }
}
echo $total;

Plenty of other ways to do it, too, that may be more efficient. And I
couldn't honestly tell you if *= and /= work and I don't want to go see.

Hope that helps. Good luck.

---John Holmes...


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




Re: [PHP] socket timeout

2002-12-05 Thread Chris Shiflett
--- Gareth Thomas <[EMAIL PROTECTED]> wrote:
> I am attempting to timeout a socket_read() that is part
> of a handshaking process using socket_set_timeout().
> Problem is it doesn't seem to work at all. If I switch of
> the handshaking write on the server side the read just
> sits there and doesn't time out at all. I have tried
> socket_set_timeout($socket,1) which I believe is 1 second
> and it never times out...

My bet is that you are only setting the timeout but not
ever checking to see whether the socket has timed out. If
you want to only read from the socket until it times out,
you need to add that to your logic. Try something like
this:

socket_set_timeout($fp, $timeout_seconds);
$response="";

# Get socket status
$socket_status = socket_get_status($fp);

# Read response up to 128 bytes at a time until EOF or
socket times out
while(!feof($fp) && !$socket_status["timed_out"])
{
 $response .= fgets($fp, "128");
 $socket_status = socket_get_status($fp);
}

Chris

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




Re: [PHP] Looping Addition

2002-12-05 Thread Stephen
But then, if the user entered 5 - 6, it should be -1 but it'd return
positive one... Is there another way?


- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "Chris Wesley" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 2:51 PM
Subject: Re: [PHP] Looping Addition


> You simply need the absolute value of the difference.  So taking Stephen's
> example below..
>
> $total = 0;
> foreach( $_POST['nums'] as $number )
> {
>   $total -= $number;// if users inputs 5 as first value result
equals -5
>   $total = abs($total); // result now equals 5
> }
>
>
> - Original Message -
> From: "Stephen" <[EMAIL PROTECTED]>
> To: "Chris Wesley" <[EMAIL PROTECTED]>
> Cc: "PHP List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 05, 2002 12:33 PM
> Subject: Re: [PHP] Looping Addition
>
>
> > Continuing this even more...how would I use this same method only to
> > subtract?
> >
> > What I'm doing right now would result in the following sitution.
> >
> > The user types in 5 as their first number. The second number is 4.
Instead
> > of returnin 1, it returns -9. It's subtracting the first number from 0,
> then
> > taking 4 and subtracting that from -5. How can I fix this keeping in
mind
> > the user may type in more then two numbers?
> >
> >
> > - Original Message -
> > From: "Chris Wesley" <[EMAIL PROTECTED]>
> > To: "PHP List" <[EMAIL PROTECTED]>
> > Cc: "Stephen" <[EMAIL PROTECTED]>
> > Sent: Wednesday, December 04, 2002 8:42 PM
> > Subject: Re: [PHP] Looping Addition
> >
> >
> > > On Wed, 4 Dec 2002, Stephen wrote:
> > > > This is only a snippet, there is more to it but for simplicities
> sake...
> > > > Then I calculate it. My question is, how would I loop the adding? I
> hope
> > you
> > > > understand this now...
> > >
> > > Ah!, I think I understand better now.  You want to add num1, num2,
num3,
> > > ... numN, which are inputs from the second form in your sequence.
> Gotcha.
> > >
> > > If you name /all/ the form elements as "nums[]" instead of
individually
> as
> > > "num${current}", the numbers put into the form will all be accessible
in
> > > one array to the PHP script that does the adding.  Then you can just
> loop
> > > over the array of numbers.
> > >
> > > In your second form, change this:
> > > " value="0"
> > >  size="25">"
> > >
> > > To this:
> > > "
> > >
> > > Then in the script that adds the numbers:
> > > $total = 0;
> > > foreach( $_POST['nums'] as $number ){
> > > $total += $number;
> > > }
> > >
> > > Hopefully I understood your problem this time!  Let me know if I
missed
> > > again.
> > > g.luck,
> > > ~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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Looping Addition

2002-12-05 Thread Kevin Stone
You simply need the absolute value of the difference.  So taking Stephen's
example below..

$total = 0;
foreach( $_POST['nums'] as $number )
{
  $total -= $number;// if users inputs 5 as first value result equals -5
  $total = abs($total); // result now equals 5
}


- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "Chris Wesley" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 12:33 PM
Subject: Re: [PHP] Looping Addition


> Continuing this even more...how would I use this same method only to
> subtract?
>
> What I'm doing right now would result in the following sitution.
>
> The user types in 5 as their first number. The second number is 4. Instead
> of returnin 1, it returns -9. It's subtracting the first number from 0,
then
> taking 4 and subtracting that from -5. How can I fix this keeping in mind
> the user may type in more then two numbers?
>
>
> - Original Message -
> From: "Chris Wesley" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Cc: "Stephen" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 04, 2002 8:42 PM
> Subject: Re: [PHP] Looping Addition
>
>
> > On Wed, 4 Dec 2002, Stephen wrote:
> > > This is only a snippet, there is more to it but for simplicities
sake...
> > > Then I calculate it. My question is, how would I loop the adding? I
hope
> you
> > > understand this now...
> >
> > Ah!, I think I understand better now.  You want to add num1, num2, num3,
> > ... numN, which are inputs from the second form in your sequence.
Gotcha.
> >
> > If you name /all/ the form elements as "nums[]" instead of individually
as
> > "num${current}", the numbers put into the form will all be accessible in
> > one array to the PHP script that does the adding.  Then you can just
loop
> > over the array of numbers.
> >
> > In your second form, change this:
> > " >  size="25">"
> >
> > To this:
> > "
> >
> > Then in the script that adds the numbers:
> > $total = 0;
> > foreach( $_POST['nums'] as $number ){
> > $total += $number;
> > }
> >
> > Hopefully I understood your problem this time!  Let me know if I missed
> > again.
> > g.luck,
> > ~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: Safe mode and safe_mode_exec_dir

2002-12-05 Thread James Hatridge

Hi Rodrigo et al...
On Thursday 05 December 2002 16:09, Rodrigo Borges Pereira wrote:
> Hello all,
>
> directly in /etc/php.ini doesn't work either. I noticed PHP was compiled
> with --with-exec-dir=/usr/bin, but i suppose that what we define in
> php.ini (at least) overrides that.

I had hell with safe_mode too. What I found out is that anything that is 
"hardwired" in by being compiled can NOT be overrode by php.ini. I would 
suggest for you to recompile PHP with everything turned off then use php.ini 
to set what you want. 

I did it this and now I'm able to run exec without problems. 

Hope this helps,

JIM 

-- 
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


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




RE: [PHP] paging through results of mysql query

2002-12-05 Thread Larry Brown
Much Gratefulness on my part!  Finally, my server and I can catch our
breath.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:47 PM
To: 'Larry Brown'; 'PHP List'
Subject: RE: [PHP] paging through results of mysql query

> I know I'm trying to re-invent the wheel, but it is because I don't
know
> how
> they do it.  I set up a script to pull a ruleset from mysql and then
loop
> through each row in the set.  I then check each row as it loops until
I
> get
> to the row number I want and start echoing rows.  I create the row
numbers
> by a $m=0; outside the loop; $m++; inside the loop.  Then I stop
echoing
> rows when it reaches 50 iterations.  The total iterations achieved is
> passed
> on to the next script that does the same thing but starting where the
> total
> left off.  This causes a lot of overhead as all of the resultset are
> pulled
> for each script.  Does anyone have a magic bullet for this?  This
> functionality is what I take search engines to be demonstrating.  If
> anyone
> can help, I could wipe the sweat of my processors brow!  (and mine for
> that
> matter)

SELECT * FROM tbl WHERE ... LIMIT $start, $per_page;

Adjust $start and $per_page accordingly to get your "paging"...

---John Holmes...



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

2002-12-05 Thread Stephen
Continuing this even more...how would I use this same method only to
subtract?

What I'm doing right now would result in the following sitution.

The user types in 5 as their first number. The second number is 4. Instead
of returnin 1, it returns -9. It's subtracting the first number from 0, then
taking 4 and subtracting that from -5. How can I fix this keeping in mind
the user may type in more then two numbers?


- Original Message -
From: "Chris Wesley" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Cc: "Stephen" <[EMAIL PROTECTED]>
Sent: Wednesday, December 04, 2002 8:42 PM
Subject: Re: [PHP] Looping Addition


> On Wed, 4 Dec 2002, Stephen wrote:
> > This is only a snippet, there is more to it but for simplicities sake...
> > Then I calculate it. My question is, how would I loop the adding? I hope
you
> > understand this now...
>
> Ah!, I think I understand better now.  You want to add num1, num2, num3,
> ... numN, which are inputs from the second form in your sequence.  Gotcha.
>
> If you name /all/ the form elements as "nums[]" instead of individually as
> "num${current}", the numbers put into the form will all be accessible in
> one array to the PHP script that does the adding.  Then you can just loop
> over the array of numbers.
>
> In your second form, change this:
> "  size="25">"
>
> To this:
> "
>
> Then in the script that adds the numbers:
> $total = 0;
> foreach( $_POST['nums'] as $number ){
> $total += $number;
> }
>
> Hopefully I understood your problem this time!  Let me know if I missed
> again.
> g.luck,
> ~Chris
>
>


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




Re: [PHP] Repeating Decimals

2002-12-05 Thread 1LT John W. Holmes
> This is another PHP mathematical question. How can I display a bar over a
> number (overline) if it's a repeating decimal? When the user types in 1 by
> 3, they get 0.. I want it to display as 0.3 with the 3
> overlined. How can I do this keeping in mind that not all numbers will be
> repeating decimals?

Well, the first problem is finding a charset or something that has a number
with a line over it and how you'd create that character in HTML, unless you
want to use an image or something.

Next, you can treat the result as a string and look at the last X digits. If
they are the same, remove them all and substitute with the number and a bar.
It just comes down to string manipulation...

---John Holmes...


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




Re: [PHP] fopen over a network

2002-12-05 Thread Joakim Andersson
Dara Dowd wrote:

Thanks for the advice lads but I realise I should have been clearer. I know about header(etc..) so displaying the download dialog isn't the problem, it's how to get to the file on the file server and then open it. The file server isn't a web server.  This is probably ridiculously easy so I hope I'm not wasting your time. I don't want to@use the 'right-click' option, I want something similar to@opening attachments in hotmail for example. Here's what I have anyway.


Cheers, Dara


What kind of network are you using?
If you're accessing a SMB-share (i.e. Windows or Samba) I think you need 
to skip "file:" from your script. Maybe you need to use backslashes 
instead ($fpath="file:fileserver\\directory\\").

Regards
Joakim


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



Re: [PHP] Session and redirecting

2002-12-05 Thread 1LT John W. Holmes
> I'm having some problems with sessions on this project I am doing for this
> one class.  I know what I am doing with sessions on a certain level, as I
> use them with ASP and JSP apps.  I notice that when I do session_start()
the
> session SID or PHPSESSID doesnt appear until you refresh that page or go
to
> the next page, I need the session to start on index, so do I have to plop
a
> refresh statement in there?  And why is it you have to do a
session_start()
> on every page, could you put that in a header and have it be the same?

Sure, place it in an include file. Or turn on session.auto_start in php.ini
and you'll never have to call it. Why do you need to refresh. The SID
constant may not be available, but you can use session_id() to get it's
value.

---John Holmes...



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




[PHP] Repeating Decimals

2002-12-05 Thread Stephen
Hello again,

This is another PHP mathematical question. How can I display a bar over a
number (overline) if it's a repeating decimal? When the user types in 1 by
3, they get 0.. I want it to display as 0.3 with the 3
overlined. How can I do this keeping in mind that not all numbers will be
repeating decimals?

Thanks,
Stephen Craton
http://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us


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


[PHP] Session and redirecting

2002-12-05 Thread Didier McGillis
I'm having some problems with sessions on this project I am doing for this 
one class.  I know what I am doing with sessions on a certain level, as I 
use them with ASP and JSP apps.  I notice that when I do session_start() the 
session SID or PHPSESSID doesnt appear until you refresh that page or go to 
the next page, I need the session to start on index, so do I have to plop a 
refresh statement in there?  And why is it you have to do a session_start() 
on every page, could you put that in a header and have it be the same?

_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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



[PHP] PHP Configuration - Can't Change Post_Max_Size

2002-12-05 Thread Roger Lewis
This is further to my post yesterday on Max File Size.

I was able to set upload_max_filesize to 790 and I can therefore upload
files up to that size.  I would now like to increase that limit, but I am
limited by post_max_size which defaults to 8M.  I can't seem to change the
value of post_max_size.

The post_max_size directive is not in my php.ini; however, I tried inserting
it into php.ini and setting it to 1600 and to 16M.   I inserted it just
before the directive, gpc_order  = "GPC".  The change is ignored by
phpinfo(), that is, phpinfo() still shows post_max_size = 8M.

Furthermore, I tried resetting it using ini_set("post_max_size", "16M"), and
ini_set("post_max_size", "1600"), but neither of these had any effect.

Any suggestion for how I might reset post_max_size.  I'm using PHP 4.0.6.

Thanks in advance.

Roger




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




[PHP] Error in host server data stream

2002-12-05 Thread Daniel
my php code is working on one machine and not on another. I am now getting
the error
Warning: SQL error: [unixODBC][IBM][iSeries Access ODBC Driver]Error in host
server data stream., SQL state S1000 in SQLExecDirect

working machine: unixodbc 2.2.2-2 php-odbc4.1.2-7.2.4
non working:unixodbc 2.2.2-3 php-odbc4.2.2-8.0.5

any ideas would help!



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




Re: [PHP] A small problem with input feilds.

2002-12-05 Thread Tim Ward
only checked checkboxes are submitted therefore you have to number
the form fields if you want to keep the relationship between the arrays
- this should be easy enough if the form is generated by your code.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Mike <[EMAIL PROTECTED]>
To: php mailinglist <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 5:59 PM
Subject: [PHP] A small problem with input feilds.


> Hello everyone,
> I have the following html code that is generated via a script:
>
> 
>  
>
> ArtistTitleFile
> SizeCheck
>  
>   
> Dj Ummet
>   
>   
>Pump This Party (extended Mix)
>   
>
>About 4.5 megabytes
>   
>value=%28Dj+Ummet%29+-+Pump+This+Party+%28Extended+Mix%29.mp3>
>
>   
>  
> 
>  
>   
> Metalica
>   
>   
>Enter Sandman
>   
>
>About 4.43 megabytes
>   
>value=%28Metalica%29+-+Enter+Sandman.mp3>
>
>   
>  
> 
>  
>   
> Metalica
>   
>   
>The Memory Remains
>   
>
>About 4.24 megabytes
>   
>value=%28Metalica%29+-+The+Memory+Remains.mp3>
>
>   
>  
> 
>  
>   
> Metallica
>   
>   
>Battery
>   
>
>About 4.77 megabytes
>   
>value=%28Metallica%29+-+Battery.mp3>
>
>   
>  
> 
> 
> 
> 
>
> the problem is this:
> Array
> (
> [filenumber] => Array
> (
> [0] => 3437
> [1] => 986
> [2] => 2331
> [3] => 2136
> )
>
> [file] => Array
> (
> [0] => %28Metalica%29+-+Enter+Sandman.mp3
> [1] => %28Metallica%29+-+Battery.mp3
> )
>
> when I submit the form, I get the whole array of filenumber but only the
> selected files. Is there a way that I could limit it so that I get only
the
> selected filenumbers and files, or should I re-think the way the script
> works?
>
> Thank you,
> Mike
>
>
> --
> 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] A small problem with input feilds.

2002-12-05 Thread Mike
Hello everyone,
I have the following html code that is generated via a script:


 

ArtistTitleFile
SizeCheck
 
  
Dj Ummet
  
  
   Pump This Party (extended Mix)
  
   
   About 4.5 megabytes
  
  
   
  
 

 
  
Metalica
  
  
   Enter Sandman
  
   
   About 4.43 megabytes
  
  
   
  
 

 
  
Metalica
  
  
   The Memory Remains
  
   
   About 4.24 megabytes
  
  
   
  
 

 
  
Metallica
  
  
   Battery
  
   
   About 4.77 megabytes
  
  
   
  
 





the problem is this:
Array
(
[filenumber] => Array
(
[0] => 3437
[1] => 986
[2] => 2331
[3] => 2136
)

[file] => Array
(
[0] => %28Metalica%29+-+Enter+Sandman.mp3
[1] => %28Metallica%29+-+Battery.mp3
)

when I submit the form, I get the whole array of filenumber but only the
selected files. Is there a way that I could limit it so that I get only the
selected filenumbers and files, or should I re-think the way the script
works?

Thank you,
Mike


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




[PHP] RE: [PEAR-DEV] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Lukas Smith
> -Original Message-
> From: Björn Schotte [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 05, 2002 6:42 PM
> To: Manuel Lemos
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; pear-
> [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED];
> [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PEAR-DEV] ANNOUNCE: Metastorage object persistence API
> generator
> 
> * Manuel Lemos wrote:
> > Here is the release announcement that may also be found on the site:
> 
> Where's the PEAR context within the marketing text?

Well this stuff does work with PEAR::MDB!

And we are talking about a model where rapid development and easy of
migration to other platforms stands at the core. So its not that big of
a deal that its running through a wrapper.

However I fail to see why all the other addressants of your reply should
care about a PEAR context (you did include all the other non PEAR
related mailinglists in your reply as well).

Don’t get overly jumpy here .. there is no reason to. This can be a big
deal for a lot of people (especially the enterprise folks which you also
frequently cite as a target for PHP). So it works with php, it works in
combination with a PEAR package ... I see a context.

Regards,
Lukas


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




RE: [PHP] paging through results of mysql query

2002-12-05 Thread John W. Holmes
> I know I'm trying to re-invent the wheel, but it is because I don't
know
> how
> they do it.  I set up a script to pull a ruleset from mysql and then
loop
> through each row in the set.  I then check each row as it loops until
I
> get
> to the row number I want and start echoing rows.  I create the row
numbers
> by a $m=0; outside the loop; $m++; inside the loop.  Then I stop
echoing
> rows when it reaches 50 iterations.  The total iterations achieved is
> passed
> on to the next script that does the same thing but starting where the
> total
> left off.  This causes a lot of overhead as all of the resultset are
> pulled
> for each script.  Does anyone have a magic bullet for this?  This
> functionality is what I take search engines to be demonstrating.  If
> anyone
> can help, I could wipe the sweat of my processors brow!  (and mine for
> that
> matter)

SELECT * FROM tbl WHERE ... LIMIT $start, $per_page;

Adjust $start and $per_page accordingly to get your "paging"...

---John Holmes...



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




[PHP] paging through results of mysql query

2002-12-05 Thread Larry Brown
I know I'm trying to re-invent the wheel, but it is because I don't know how
they do it.  I set up a script to pull a ruleset from mysql and then loop
through each row in the set.  I then check each row as it loops until I get
to the row number I want and start echoing rows.  I create the row numbers
by a $m=0; outside the loop; $m++; inside the loop.  Then I stop echoing
rows when it reaches 50 iterations.  The total iterations achieved is passed
on to the next script that does the same thing but starting where the total
left off.  This causes a lot of overhead as all of the resultset are pulled
for each script.  Does anyone have a magic bullet for this?  This
functionality is what I take search engines to be demonstrating.  If anyone
can help, I could wipe the sweat of my processors brow!  (and mine for that
matter)

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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




[PHP] Re: [PEAR-DEV] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Björn Schotte
* Manuel Lemos wrote:
> Here is the release announcement that may also be found on the site:

Where's the PEAR context within the marketing text?

-- 
35 Kundenportale mit 24.000 Nutzern erstellen.
Bei geringen Kosten und einer großen Anzahl an
Modulen (DMS, CMS, CRM, Community-Funktionen).
  Wie das geht? => mailto:[EMAIL PROTECTED]

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




[PHP] Re: socket timeout

2002-12-05 Thread Gareth Thomas
Hi,

apparently this does not work with socket_read() but only with higher level
socket functions (fread etc). However I have found a function called
socket_set_nonblock(socketname) which apparently does something very
similar, it prevents the socket_read from waiting to receive data. I simply
built my own timeout loop into the code and voila!!

Gareth

"Gareth Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I am attempting to timeout a socket_read() that is part of a handshaking
> process using socket_set_timeout(). Problem is it doesn't seem to work at
> all. If I switch of the handshaking write on the server side the read just
> sits there and doesn't time out at all. I have tried
> socket_set_timeout($socket,1) which I believe is 1 second and it never
times
> out...
>
> Any thoughts on this would be most appreciated.
>
> Gareth
>
>



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




[PHP] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Manuel Lemos
Hello,

Finally I made time to release a full blown application based on MetaL
compiler persistence module.

Here is the release announcement that may also be found on the site:

http://www.meta-language.net/news-2002-12-05-metastorage.html

   _

Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT

Metastorage is an application that is capable of generating
persistence layer APIs. It takes a component definition defined in the
Component Persistence Markup Language (CPML), a XML based format, and
generates classes and storage schemas in a given target programming
language.

Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational
databases.

The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
databases.

The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.

The generated APIs are also capable of installing the data schema in
the persistence container, which in the case of a relational database
is the set of tables that will hold the persistent objects. This
completely eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that
may be stored in relational databases, such objects may as well be
stored in other types of persistence containers.

For instance, if an application needs to move a directory of objects
with user information from a relational database to a LDAP server to
increase the application scalability, the same CPML component
definition would be used. Metastorage would then generate classes
objects that implement the same API for interfacing with a LDAP server
that is compatible with the API generated to interface with relational
databases. This make the migration process easier and with reduced
risks.

Another possible benefit of the persistence container independence of
the APIs generated by Metastorage, is the case where an application
may need to run in environments where a SQL based database server is
not available. In that case the same API could be generated to store
persistent objects in flat file databases or plain XML files.

For now, the current version of Metastorage only supports the
generation of PHP code based on the database independent Metabase API.
This means that it may also interface with PEAR::MDB database
abstraction layer using its built-in Metabase API wrapper. In
consequence, many types of relational databases are already supported.

Since this is the first release of Metastorage, there is plenty of
room for improvement in the possibilities of the generated persistence
APIs and the level of optimization of the generated code. In the
future it will be supported other languages besides PHP, other
database APIs besides Metabase and other persistence containers
besides relational databases.

Metastorage is based on MetaL compiler persistence module. Like MetaL,
Metastorage is Open Source and is distributed with BSD like software
license. Downloadable archives and documentation with an example of
component definition are available from the MetaL site.


--

Regards,
Manuel Lemos


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




[PHP] ANNOUNCE: Metastorage object persistence API generator

2002-12-05 Thread Manuel Lemos
Hello,

Finally I made time to release a full blown application based on MetaL 
compiler persistence module.

Here is the release announcement that may also be found on the site:

http://www.meta-language.net/news-2002-12-05-metastorage.html

  _

Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT

Metastorage is an application that is capable of generating
persistence layer APIs. It takes a component definition defined in the
Component Persistence Markup Language (CPML), a XML based format, and
generates classes and storage schemas in a given target programming
language.

Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational
databases.

The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
databases.

The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.

The generated APIs are also capable of installing the data schema in
the persistence container, which in the case of a relational database
is the set of tables that will hold the persistent objects. This
completely eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that
may be stored in relational databases, such objects may as well be
stored in other types of persistence containers.

For instance, if an application needs to move a directory of objects
with user information from a relational database to a LDAP server to
increase the application scalability, the same CPML component
definition would be used. Metastorage would then generate classes
objects that implement the same API for interfacing with a LDAP server
that is compatible with the API generated to interface with relational
databases. This make the migration process easier and with reduced
risks.

Another possible benefit of the persistence container independence of
the APIs generated by Metastorage, is the case where an application
may need to run in environments where a SQL based database server is
not available. In that case the same API could be generated to store
persistent objects in flat file databases or plain XML files.

For now, the current version of Metastorage only supports the
generation of PHP code based on the database independent Metabase API.
This means that it may also interface with PEAR::MDB database
abstraction layer using its built-in Metabase API wrapper. In
consequence, many types of relational databases are already supported.

Since this is the first release of Metastorage, there is plenty of
room for improvement in the possibilities of the generated persistence
APIs and the level of optimization of the generated code. In the
future it will be supported other languages besides PHP, other
database APIs besides Metabase and other persistence containers
besides relational databases.

Metastorage is based on MetaL compiler persistence module. Like MetaL,
Metastorage is Open Source and is distributed with BSD like software
license. Downloadable archives and documentation with an example of
component definition are available from the MetaL site.


--

Regards,
Manuel Lemos


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



[PHP] IMG SRC .ico (icons)

2002-12-05 Thread Benja
Hi everybody,

The icons (.ico) are not displayed correctly by all the browsers (I.E. 5,
etc...).
After some research, it appears the only solution is to convert the .ico in
GIF or JPEG...

Do you know if a PHP script could do that conversion ?
Take a icon and create a GIF or JPEG file...

Thanks for your help,
Benja.



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




Re: [PHP] Sesion Vars get reseted

2002-12-05 Thread 1LT John W. Holmes
What OS are you on?

---Quote---
Note: If you are using the default file-based session handler, your
filesystem must keep track of access times (atime). Windows FAT does not so
you will have to come up with another way to handle garbage collecting your
session if you are stuck with a FAT filesystem or any other fs where atime
tracking is not available.


---John Holmes...

- Original Message -
From: "Miguel López Dinaweb Dpto. Programación" <[EMAIL PROTECTED]>
To: "'1LT John W. Holmes'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 11:41 AM
Subject: RE: [PHP] Sesion Vars get reseted


I'm using php's built in functions, and i've made a very basic script
thats keeps reloading minute by minute and wen it was more than 24
minutes (1440 seconds) reloading in any moment the variables gets
reseted.
Also the last acced time from the file were the session data is stored
is updated every time that the page is reloaded, so the problen is that
i think that is making the garbage collection based on the creation time
no the last accesed time.

:-)

Miguel López Sánchez
Programador
Voz +34 902 014 945 E-mail: [EMAIL PROTECTED]

Dinaweb Networks s.l.
Rúa das Orfas 27
15703 Santiago de Compostela A Coruña Gz Sp ECC
Voz +34 902 014 945 GMT+1
E-mail: [EMAIL PROTECTED]

http://www.dinaweb.com http://www.dinahosting.com
http://www.u-lo.com http://www.empregogalego.com


-Mensaje original-
De: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Enviado el: jueves, 05 de diciembre de 2002 17:02
Para: Miguel López Dinaweb Dpto. Programación; [EMAIL PROTECTED]
Asunto: Re: [PHP] Sesion Vars get reseted


- Original Message -
I'm having a trouble with session vars, that i suspect that is related
to garbage collection system. I start a session and make and continuos
use of it, but sudently the session vars are reseted, the time when this
ocurs is variable, always after passing the time of garbage recollection
since the session was started, but less than a minute from the last use
of the session, is this the correct way for php session handling or can
be any error in the scripts or the php config?
-

If you're not using your own session handling functions, garbage
collection won't touch the file if it's been accessed in the last 1440
seconds (I think that's the default).

What if you write a really basic session page and keep loading it? Do
the variables dissappear from that, also? I'm sure it's something in the
code you've written, as normal session operations wouldn't do this.

---John Holmes...


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




RE: [PHP] Sesion Vars get reseted

2002-12-05 Thread Miguel López Dinaweb Dpto. Programación
I'm using php's built in functions, and i've made a very basic script
thats keeps reloading minute by minute and wen it was more than 24
minutes (1440 seconds) reloading in any moment the variables gets
reseted.
Also the last acced time from the file were the session data is stored
is updated every time that the page is reloaded, so the problen is that
i think that is making the garbage collection based on the creation time
no the last accesed time.

:-)

Miguel López Sánchez 
Programador
Voz +34 902 014 945    E-mail: [EMAIL PROTECTED] 

Dinaweb Networks s.l.
Rúa das Orfas 27
15703 Santiago de Compostela A Coruña Gz Sp ECC
Voz +34 902 014 945    GMT+1
E-mail: [EMAIL PROTECTED]

http://www.dinaweb.com   http://www.dinahosting.com
http://www.u-lo.com http://www.empregogalego.com


-Mensaje original-
De: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Enviado el: jueves, 05 de diciembre de 2002 17:02
Para: Miguel López Dinaweb Dpto. Programación; [EMAIL PROTECTED]
Asunto: Re: [PHP] Sesion Vars get reseted


- Original Message -
I'm having a trouble with session vars, that i suspect that is related
to garbage collection system. I start a session and make and continuos
use of it, but sudently the session vars are reseted, the time when this
ocurs is variable, always after passing the time of garbage recollection
since the session was started, but less than a minute from the last use
of the session, is this the correct way for php session handling or can
be any error in the scripts or the php config?
-

If you're not using your own session handling functions, garbage
collection won't touch the file if it's been accessed in the last 1440
seconds (I think that's the default).

What if you write a really basic session page and keep loading it? Do
the variables dissappear from that, also? I'm sure it's something in the
code you've written, as normal session operations wouldn't do this.

---John Holmes...


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




[PHP] socket timeout

2002-12-05 Thread Gareth Thomas
Hi,

I am attempting to timeout a socket_read() that is part of a handshaking
process using socket_set_timeout(). Problem is it doesn't seem to work at
all. If I switch of the handshaking write on the server side the read just
sits there and doesn't time out at all. I have tried
socket_set_timeout($socket,1) which I believe is 1 second and it never times
out...

Any thoughts on this would be most appreciated.

Gareth



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




Re: [PHP] Advice with encrypting+storing sensitive data

2002-12-05 Thread bahwi
Sorry, OpenSSL is base in FreeBSD, so I didn't have to set it up myself. 
You can check www.openssl.org and www.apache.org. You still have to buy 
a cert though. For that, try:

www.verisign.com
and www.instantssl.com --- seems alot cheaper, no experience with them 
however

But chances are your best bet will be to just get a webhost with SSL 
support already and buy the cert. That way, if there are errors with 
openssl you don't have to fix them, someone else does.

As far as anything else, see my sig, I gotta charge for Unix work so I 
can make the bills. That should help though.

--Joseph Guhlin 
http://www.josephguhlin.com/ 
Web Programmer / Unix Consultant / PHP Programmer




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



[PHP] Re: MySQL ?

2002-12-05 Thread Bastian Vogt
Hi,

use mysql_list_tables();

HTH,
Bastian

Hacook schrieb:

> I am really sorry but i can't find any good mySQL good mailing list...
>
> How can i make a little php function to check if a table exists ?
>
> Thanks a lot,
> Hacook


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




[PHP] MySQL ?

2002-12-05 Thread hacook
I am really sorry but i can't find any good mySQL good mailing list...

How can i make a little php function to check if a table exists ?

Thanks a lot,
Hacook



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




[PHP] Re: code for my question about sessions ;) sorry

2002-12-05 Thread 1LT John W. Holmes
[snip]
> function login($username)
>  {
>   global $valid_user;
>   $valid_user = $username;
>   session_register("valid_user");
>  }

It _should_ work. My only guess is that maybe because you're registering
something inside of a function, it's messing up, even though the variable is
global. I don't do it this way, and I prefer register globals off, so I
don't know if that's an issue or not.

---John Holmes...


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




Re: [PHP] Sesion Vars get reseted

2002-12-05 Thread 1LT John W. Holmes
- Original Message -
I'm having a trouble with session vars, that i suspect that is related
to garbage collection system.
I start a session and make and continuos use of it, but sudently the
session vars are reseted, the time when this ocurs is variable, always
after passing the time of garbage recollection since the session was
started, but less than a minute from the last use of the session, is
this the correct way for php session handling or can be any error in the
scripts or the php config?
-

If you're not using your own session handling functions, garbage collection
won't touch the file if it's been accessed in the last 1440 seconds (I think
that's the default).

What if you write a really basic session page and keep loading it? Do the
variables dissappear from that, also? I'm sure it's something in the code
you've written, as normal session operations wouldn't do this.

---John Holmes...


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




RE: [PHP] Problem with functions

2002-12-05 Thread Carlos Alberto Pinto Hurtado


Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



-Mensaje original-
De: Victor Halla [mailto:[EMAIL PROTECTED]]
Enviado el: Wednesday, December 04, 2002 6:16 PM
Para: [EMAIL PROTECTED]
Asunto: [PHP] Problem with functions


Hi,

I have de following code for example




If  I call the funcion test(), echo print nothing what's is going on ?

[]´s

[EMAIL PROTECTED]



__ Victor
Halla ICQ#: 114575440 Current ICQ status: + More ways to contact me
__



-- 
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] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
I am wondering if it has something to do with the way that MySQL is storing
the data.  But I can't seem to find anything that is helping me when I
search on MySQL related strings.

+-+-+
| Joshua Minnie   |Tel:  269.276.9690   |
| [EMAIL PROTECTED]|Fax:  269.342.8750   |
| www.wildwebtech.com +-+
|   |
| Independent Web Consultant / Developer|
+---+
| SYSTEM INFO   |
+---+
| PHP v. 4.2.3 running on Win 2000 / IIS 5  |
| MySQL v. 3.23.49 running on RedHat 7.3/Apache |
+---+

>"John Wards" <[EMAIL PROTECTED]> wrote:
>On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
>> A load of stuff..
>
>I just read the fist few paragraphs and got bored;-)
>
>but
>
>Have you tried doing a str_replace for \n which is new line? just replate
it
>with a blank string
>
>John



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




Re: [PHP] Newline charactes causing problems

2002-12-05 Thread John Wards
On Thursday 05 Dec 2002 3:54 pm, Joshua E Minnie wrote:
> Already tried that.  Doesn't seem to change anything.
>
how about \r 

John

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




Re: [PHP] Newline charactes causing problems

2002-12-05 Thread 1LT John W. Holmes
Or

$notes = preg_replace("/(\r)?\n/"," ",$_POST['notes']);

in case it's the \r that's actually messing you up and not the \n?

---John Holmes...

- Original Message -
From: "John Wards" <[EMAIL PROTECTED]>
To: "Joshua E Minnie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 10:48 AM
Subject: Re: [PHP] Newline charactes causing problems


On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
> A load of stuff..

I just read the fist few paragraphs and got bored;-)

but

Have you tried doing a str_replace for \n which is new line? just replate it
with a blank string

John

--
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] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
Already tried that.  Doesn't seem to change anything.

- Original Message -
From: "John Wards" <[EMAIL PROTECTED]>
To: "Joshua E Minnie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 10:48 AM
Subject: Re: [PHP] Newline charactes causing problems


On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
> A load of stuff..

I just read the fist few paragraphs and got bored;-)

but

Have you tried doing a str_replace for \n which is new line? just replate it
with a blank string

John




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




Re: [PHP] Newline charactes causing problems

2002-12-05 Thread John Wards
On Thursday 05 Dec 2002 3:48 pm, Joshua E Minnie wrote:
> A load of stuff..

I just read the fist few paragraphs and got bored;-)

but

Have you tried doing a str_replace for \n which is new line? just replate it 
with a blank string

John

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




Re: [PHP] Browser going to page twice?

2002-12-05 Thread Step Schwarz
on 12/2/02 6:12 PM, Leif K-Brooks at [EMAIL PROTECTED] wrote:

> I'm having a weird problem.  When I go to a page on my site, it often
> goes twice.  I'm not sure if this is a client-side or server-side
> problem, but it doesn't happen on other sites.  Is this a common
> problem, or am I making some dumb mistake?

Is this a public site that we can take a look at? I know there are some
JavaScripts which refresh/reload pages in order to work around bugs in
Netscape 4.  Is there by any chance anything in your site's  tags
which does this?

-Step


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




[PHP] Newline charactes causing problems

2002-12-05 Thread Joshua E Minnie
Hey all,
I know this has been asked before, and I have tried many of the
solutions that were posted in the mailing archives, and also did some
googling.  But I can't seem to eliminate some new line characters from a
string.  Here is the scenario:

1. A user inputs some text into an form and submits the form.
2. The information gets put into my MySQL db.
3. I retrieve the information from the db and display it.

Now after the user submits the form, I have tried dumping it to the db in a
few different ways.  First of all, I dumped it directly to the db with no
changes, hoping that I could remove the newline characters and other
unwanted markup and tags when retrieving the string.  I also tried dumping
it to the db with after I used some string manipulation function, such as
stripslashes, nl2br, htmlentities, stripcslashes, trim, rtrim, and even
str_replace.  And just to be safe I made sure I double checked to make sure
the newlines were removed on before displaying by using some of the same
functions, but to no avail.  The newlines still seem to be there.

In the db, I have tried various different field types, from text to varchar
to blob, but this hasn't changed anything either.

The reason it is so important that the newline characters be removed is
because they are being used to create a javascript string.  And if the
newline characters are there then, I get an unterminated string error.

Here is the current code for adding the user input to the db:

http://localhost/errors/script.php?f=addNewTask&r=query_failed";);

header("Location: http://localhost/events/task.php?action=add&set=1";);
  } else {
header("Location:
http://localhost/errors/script.php?f=addNewTask&r=db_conn";);
  }
}

?>

$posted is the array $_POST after it is passed to the function.
$_POST['notes'] is where I am having the problem.

Here is the code for displaying the information from the db:

[library file snippit]
'1'";
$result = mysql_query($query);

while($row=mysql_fetch_assoc($result)) {
  $aTasks[$i] =
array($row['due'],$row['title'],stripslashes($row['notes']));
  $i++;
}
if(isset($aTasks)) {
  array_multisort($aTasks,SORT_DESC,SORT_STRING);
  print("");
  print_r($aTasks);
  print("");
  return($aTasks);
}
  } else {
header("Location:
http://localhost/errors/script.php?f=getTasks&r=db_conn";);
  }
}
?>

[displaying page snippit]
 0) {
  echo("\n");
  echo("aTasks = new Array(\n");
  $sTask = "";
  for($i=0;$i<$len;$i++) {
$sTask .= "\"";
if($tasks[$i][0] < getNow() && $tasks[$i][0] != "x") $sTask .= "Past Due!
"; $sTask .= $tasks[$i][2]."\","; } $sTask = substr($sTask,0,(strlen($sTask) - 1)); echo($sTask.");\n"); echo("\n"); } ?> I know that is going into the db with the newlines still in the string. And I am constantly going back to mysqladmin and the newlines are there, no matter what I do. I was hoping someone could shed some light on what could possibly be causing this. +-+-+ | Joshua Minnie |Tel: 269.276.9690 | | [EMAIL PROTECTED]|Fax: 269.342.8750 | | www.wildwebtech.com +-+ | | | Independent Web Consultant / Developer| +---+ | SYSTEM INFO | +---+ | PHP v. 4.2.3 running on Win 2000 / IIS 5 | | MySQL v. 3.23.49 running on RedHat 7.3/Apache | +---+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Looping Addition

2002-12-05 Thread Jason Wong
On Thursday 05 December 2002 23:05, Stephen wrote:
> So would I just put this?
>
> foreach(%_POST['number'] as $num)
> {
> $output *= $num;
> }
> echo $output;
>
> That's for multiplication.

Yes. Wouldn't it have been quicker for you to try it than to ask?

BTW make sure that none of $num is zero.

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

/*
The longest part of the journey is said to be the passing of the gate.
-- Marcus Terentius Varro
*/


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




[PHP] Q: Use getImageSize() on image data from email?

2002-12-05 Thread Mans Jonasson
Hi all,
I am trying to use getImageSize() on imagedata I am receiving in an 
e-mail and collecting with imap_fetchstructure() et al. What I have in 
my $image variable is just the actual image data - no headers or 
anything, and of course getImageSize() doesn't work that way.

Now, the question is - does anybody have some code which will work with 
binary image data? Preferably with both JPG AND GIF data...

My only other option right now as I see it would be to create a file on 
the filesystem, write the image data to it and then use getImageSize() 
on it, but that seems like a bad solution for several reasons, some of 
them being speed and file permissions.

Thankful for any help!

//Mans


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



[PHP] Safe mode and safe_mode_exec_dir

2002-12-05 Thread Rodrigo Borges Pereira
Hello all,

I'm having a bit of a problem making a particular configuration with PHP
and Apache. Here's the deal:

I want to have php running with safe mode, so i define safe mode = On on
/etc/php.ini.
I have this script that i need to execute two programas, with exec().
So, in apache, i define a  directive, where i put
"php_admin_value safe_mode_exec_dir /some/path/bin", so that the scripts
contained in the directory are able to execute binaries in
/some/path/bin. I also define open_basedir to ".".

This doesn't work. In fact, defining safe_mode_exec_dir = /some/path/bin
directly in /etc/php.ini doesn't work either. I noticed PHP was compiled
with --with-exec-dir=/usr/bin, but i suppose that what we define in
php.ini (at least) overrides that.

I can only execute the bins with safe mode off... and i see nothing on
the logs, because for what i can see php logs nothing if it cannot
execute a program

I'm using PHP 4.2.3 and Apache 1.3.23 (RedHat)

Any help will be appreciated,

Regards



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




Re: [PHP] Looping Addition

2002-12-05 Thread Stephen
So would I just put this?

foreach(%_POST['number'] as $num)
{
$output *= $num;
}
echo $output;

That's for multiplication.


- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 8:24 AM
Subject: Re: [PHP] Looping Addition


> > One more question... If I then wanted to do this for the other
operations
> > (such as multiplication, division, etc), how would I do that?
>
> Assuming you've figured out how to do an array...
>
> You'll have to loop through the values like in the code that others
posted.
>
> foreach($_POST['number'] as $num)
> { //calculate total here with $num }
>
> * = multiplication
> / = divide
>
> ---John Holmes...
>
>
>
>
> --
> 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] C#

2002-12-05 Thread Wilmar Perez
Hello guys

I'm sorry if this message disturbs anyone, I know it is completely off topic.

I've been thinking about open a C# mailing list for I hadn't been able to find a good 
one so far.  All I want to know is if there is enough people out there interested in 
joining such list.  

I posted this message to this list for a couple of reason: it is the only programming 
list I am in and since you're php developers I thought many of you may be interested.

Again please don't get mad at me for this I don't mean to upset or disturb anyone.

Thanks a lot.

***
 Wilmar Pérez
 Network Administrator
   Library System
  Tel: ++57(4)2105962
University of Antioquia
   Medellín - Colombia
  2002
***
 
 

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




[PHP] Shopping Cart Rewrite

2002-12-05 Thread beno
Hi;
PHP isn't my strong language so I need your help. I'm writing a patch to a 
shopping cart called fishcart < http://fishcart.org > The following code 
works well in another page. I pass the variable $related to the page that 
I'm patching:


 $fcrp=new FC_SQL;
 $fcrp->query("select relprod from cubaprodrel where relsku='$related' 
order by relseq");
$fcrp->next_record();
 while( $fcrp->next_record() ){
  $rsku=$fcrp->f('relprod');
  $fcrpl->query("select * from cubaprodlang where prodlsku='$rsku' ".
  "and prodlzid=$zid and prodlid=$lid");
  $fcrpl->next_record();
  $pname = strip_tags($fcrpl->f("prodname"));
  $pheight = strip_tags($fcrpl->f("prodpich"));
  $ppic = strip_tags($fcrpl->f("prodpic"));
  $ptpic = strip_tags($fcrpl->f("prodtpic"));
 ?>

There is already an established connection to the d'base. The first line of 
code works fine. The query doesn't appear to choke. But the third line 
pointing to the next_record() chokes. Any suggestions, or isn't this enough 
to go on?
TIA,
beno



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



[PHP] Sesion Vars get reseted

2002-12-05 Thread Miguel López Dinaweb Dpto. Programación
Hi,
I'm having a trouble with session vars, that i suspect that is related
to garbage collection system.
I start a session and make and continuos use of it, but sudently the
session vars are reseted, the time when this ocurs is variable, always
after passing the time of garbage recollection since the session was
started, but less than a minute from the last use of the session, is
this the correct way for php session handling or can be any error in the
scripts or the php config?


:-)

Miguel López Sánchez 
Programador
Voz +34 902 014 945    E-mail: [EMAIL PROTECTED] 

Dinaweb Networks s.l.
Rúa das Orfas 27
15703 Santiago de Compostela A Coruña Gz Sp ECC
Voz +34 902 014 945    GMT+1
E-mail: [EMAIL PROTECTED]

http://www.dinaweb.com   http://www.dinahosting.com
http://www.u-lo.com http://www.empregogalego.com



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




RE: [PHP] Script not working from one computer

2002-12-05 Thread M.A.Bond
Have you checked:

Browser versions? (is the browser the same type/version as on the other
machines)
Is it a laptop? If so, are you using the internal keyboard with Numlock on?
Is the machine in question set-up on the network correctly, i.e. has it got
domain, gateway addresses etc setup - this would only affect it if the
Intranet server is set-up to only allow a certain range of IP addresses or
doamin/hostnames etc.

Thanks

Mark


-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: 05 December 2002 14:10
To: php-general
Cc: heflinaw
Subject: [PHP] Script not working from one computer


I know, PHP is executed server side, so it shouldn't matter about the
computer, but...

I've got a basic log in script that takes username and password and does the
typical SELECT to find a match. If it's good, it sets some session variables
and redirects to a main page, otherwise redirects back to the login page
with an error message.

The script works from all computers but one. The login page will come up,
but no matter what, it says the username and password are bad. They are
correct though, caps lock isn't on, etc. I've cleared the cookies and cache
and it still does the same thing.

The script is on an intranet. One computer that had this issue was fixed by
using https://computername.company.army.mil instead of just
https://computername. But for this computer, both addresses give the same
result. 

So, I'm sure it's not the PHP script, so I'm looking for ideas of what I
should check, settings wise, on the client computer? Any help is greatly
appreciated.

---John Holmes...

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




Re: [PHP] mysql, php, checkbox

2002-12-05 Thread Adrian Partenie

Indeed, now it works, I put the form tag by mistake...
Thanks,
Adrian

- Original Message -
From: "rija" <[EMAIL PROTECTED]>
To: "Adrian Partenie" <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 11:30 PM
Subject: Re: [PHP] mysql, php, checkbox


> There are  tags around  What are
they
> supposed to do?
> I think your problem lies there, because ids[] belong to this new form not
> to the first one and then ids[] cannot be set.
>
> Secondly,  method='post' inside  does nothing.
>
> Hope that helps.
>
> - Original Message -
> From: "Adrian Partenie" <[EMAIL PROTECTED]>
> To: "php" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 04, 2002 4:50 AM
> Subject: Re: [PHP] mysql, php, checkbox
>
>
> > It works, but just for the first row selected from the table. I think
that
> > the problem is that the checkboxes are declared inside a while loop. If
i
> > declare manually all checkboxes it works. Any ideas ? Or maybe I'm doing
> > something wrong?
> >
> >
>

> > 
> > echo  "";
> > echo "";
> >
> >
> > /* Connecting, selecting database */
> > $link = mysql_connect("localhost", "root", "adrian")
> > or die("Could not connect");
> > print "Connected successfully";
> > mysql_select_db("menagerie") or die("Could not select database");
> >
> > /* Performing SQL query */
> > $query = "SELECT * FROM reclamatie";
> > $result = mysql_query($query) or die("Query failed");
> >
> > /* Printing results in HTML */
> >
> >  echo "";
> > echo
> >
>
"IDSubjectOpenClose";
> >
> >  while($row = MySQL_fetch_array($result)) {
> >  echo  " > name=\"ids[]\" value=\"{$row['id']}\">";
> > echo " > target=\"lowerframe\">{$row['id']}";
> > echo "{$row['subject']}";
> > echo "{$row['open']}";
> >echo "{$row['close']}";
> > }
> > echo "";
> >
> >   /* Free resultset */
> > mysql_free_result($result);
> >
> > /* Closing connection */
> > mysql_close($link);
> >
> > echo "";
> > ?>
> > ###
> > //selectare.php  (just displays the id's of selected checkboxes)
> >
> >
> > //$useri=$_POST['useri'];
> > $ids=$_POST['ids'];
> >
> > reset($ids);
> > while (list ($key, $value) = each ($ids)) {
> > echo "$value\n";
> > }
> > ?>
> > #
> >
> > As I said, when I select the first checkbox, I get the id, but when I
> select
> > any other checkbox, I get the errors
> > PHP Notice:  Undefined index:  ids in selectare.php
> > PHP Warning:  Variable passed to each() is not an array or object in
> > selectare.php
> >
> >
> >
> >
> >
> > - Original Message -
> > From: "John W. Holmes" <[EMAIL PROTECTED]>
> > To: "'Adrian Partenie'" <[EMAIL PROTECTED]>; "'php'"
> > <[EMAIL PROTECTED]>
> > Sent: Thursday, November 28, 2002 5:54 PM
> > Subject: RE: [PHP] mysql, php, checkbox
> >
> >
> > > > I'm displaying the content of a mysql table with autoincrement
index.
> > > I
> > > > want to be able to select the each row from the table using the
check
> > > > boxes. In order to do that, i want to assign to each checkbox the
> > > > name=index of selected row.
> > > > I assign to the checkboxes the value of selected id, but I can't
> > > > retreiveit later for further processing. My code looks like this
> > > >
> > > >  $query = "SELECT * FROM reclamatie";
> > > > $result = mysql_query($query) or die("Query failed");
> > > >
> > > > /* Printing results in HTML */
> > > >
> > > >  echo "";
> > > > echo
> > > >
> > >
"IDSubjectOpenClose > > >"
> > > > ;
> > > >
> > > >  while($row = MySQL_fetch_array($result)) {
> > > >  echo  " > > > name=\"{$row['id']}\">"; // ??
> > >
> > > It looks like your naming it as a number, which won't work for PHP.
You
> > > want to name all of your checkboxes the same, with a [] on the name to
> > > make the results an array in PHP.
> > >
> > > ... name="id[]" value="{$row['id']}"
> > >
> > > Then, you'll have $_POST['id'][x] as an array in PHP. Only the
> > > checkboxes that were selected will be in the array, from zero to
however
> > > many were checked. The value of $_POST['id'][x] will be whatever was
in
> > > the value="..." part of the HTML checkbox...
> > >
> > > ---John Holmes...
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>


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




Re: [PHP] Script not working from one computer

2002-12-05 Thread @ Edwin
Hello,

"1LT John W. Holmes" <[EMAIL PROTECTED]> wrote:
[snip]
> So, I'm sure it's not the PHP script, so I'm looking for ideas of what I
> should check, settings wise, on the client computer? Any help is greatly
> appreciated.
[/snip]

Well, "my magic PHP 8-ball says..." Just kidding :)

Anyway, here's a long shot:

What browser are you using? Encryption is 128bit? If you're using one with
40bit or 56bit(?), I'm sure it won't work against a server with 128bit
SSL...

- E

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




[PHP] Script not working from one computer

2002-12-05 Thread 1LT John W. Holmes
I know, PHP is executed server side, so it shouldn't matter about the computer, but...

I've got a basic log in script that takes username and password and does the typical 
SELECT to find a match. If it's good, it sets some session variables and redirects to 
a main page, otherwise redirects back to the login page with an error message.

The script works from all computers but one. The login page will come up, but no 
matter what, it says the username and password are bad. They are correct though, caps 
lock isn't on, etc. I've cleared the cookies and cache and it still does the same 
thing.

The script is on an intranet. One computer that had this issue was fixed by using 
https://computername.company.army.mil instead of just https://computername. But for 
this computer, both addresses give the same result. 

So, I'm sure it's not the PHP script, so I'm looking for ideas of what I should check, 
settings wise, on the client computer? Any help is greatly appreciated.

---John Holmes...


Re: [PHP] Advice with encrypting+storing sensitive data

2002-12-05 Thread ªüYam
Would u teach me how to setup the OpenSSL and the engine for the apache web
server in order to achieve the 128 bits SSL protection?
Actually, I have tried so many times but still failed to do so...
First of all, there were errors occurred when I compiled the Openssl engine,
It seemed looking for a wrong file paths itself, however, I don't know how
to correct it...
Would u like to help me please? thx a lot
"Bahwi" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
> That's a big question.
>
> The most secure way, using either mcrypt or PGP, is to have an
> application on the client's side that does the encryption and the
> decryptiong. This is probably the best solution. Heavily encrypt things
> on both sides, and this assumes the client side is secure.
>
> Barring this, you're going to have holes no matter what. Especially with
> man in the middle attacks (MITM).
>
> Use SSL, 128-bit SSL. This will help the most.
>
> The next best thing is to store it in session variables, but build your
> own system perhaps, and yes, encrypt it lightly with some system and a
> system passphrase. Clean up the sessions as soon as possible. And store
> a bunch of other data in there. Perhaps store the passphrase as the
> variable 'Height' or 'Bytes' or something, and store 'Password'
> 'Passphrase' with dummy data. Not too much, you want to throw the person
> off as much as possible.
>
> Then, you need to obfuscate or preferably, encode your script so know
> one can figure out your scheme. Hope this helps some.
>
> --Joseph Guhlin
> http://www.josephguhlin.com/
> Web Programmer / Unix Consultant / PHP Programmer
>
>
>



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




Re: [PHP] Looping Addition

2002-12-05 Thread 1LT John W. Holmes
> One more question... If I then wanted to do this for the other operations
> (such as multiplication, division, etc), how would I do that?

Assuming you've figured out how to do an array...

You'll have to loop through the values like in the code that others posted.

foreach($_POST['number'] as $num)
{ //calculate total here with $num }

* = multiplication
/ = divide

---John Holmes...




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




Re: [PHP] Howto: run local script to update remote script

2002-12-05 Thread David T-G
eriol --

Yes, a cron job would do the trick for a process that must run at fixed
and frequest intervals.  The Windows scheduler might accomplish the same
thing.

Since we've already veered sharply off-topic, I'll go ahead and recommend
that you check out dyndns.org or the like; set up your address (they'll
give you one like eriol.dyndns.org for free), download some software to
your box, and then it will always be available at that fully-qualified
name, without any PHP magic; your friends would just point a browser or
ftp client to eriol.dyndns.org and start sucking down MP3s.

If you do go with a php script (on either end), be careful how you then
implement it; anyone could hijack your pointer by connecting to the same
script with your "password".  Better to do something like encrypt your
current [external, of course] IP address (and maybe timestamp and maybe
who knows what else, with the more you can throw on the better) with a
secret password and send the garbage over the wire to your Linux server;
the script there also knows the password and decrypts the stuff and
checks to see that the sent IP matches the sending IP (and anything else
that you want to check) but you haven't actually exposed your password on
the wire.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg88457/pgp0.pgp
Description: PGP signature


[PHP] Re: Variables and http

2002-12-05 Thread Tristan Carron
thanks, works perfectly

- Original Message -
From: "Mattia" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 12:41 PM
Subject: Re: Variables and http


>
> "Hacook" <[EMAIL PROTECTED]> ha scritto nel messaggio
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> > I have a page (to create a database) with X text fields called chpX
(chp0,
> > chp1, chp2..Etc) that posts these variables to a php file.
> > I would like to know how can i get these values ? (I have also the $i
> > variable that tells me what is the max X)
>
>
> first you have to create the var name in a string, like
>
> $var = 'chp'.$i ; // $i is the number
>
> then retrive the posted value
>
> $value = $_POST[$var] ;
>
> bye
>
>


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




Re: [PHP] code for my question about sessions ;) sorry

2002-12-05 Thread Stephen
I don't know if this will fix anything or not but instead of using
check_valid_user(), try making the if statement say this:

is(!isset($_SESSION['valid_user))
{
echo "NOT LOGGED IN";
}
else
{
echo "LOGGED IN";
}


- Original Message -
From: "Martin Hudec" <[EMAIL PROTECTED]>
To: "1LT John W . Holmes (U.S. Army)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 8:18 AM
Subject: [PHP] code for my question about sessions ;) sorry


> Hello ,
>
> okay here's the code...sorry forgot to post it
> everything works in login.phpsession is registered...but in index,
> it seems that session is empty...
>
> login.php:
>  session_start();
> include ("forum_fns.php");
> login($username);
> echo "";
> //reloads index.php (login.php is popup from index.php
> echo "window.opener.location.reload();";
> echo "setTimeout('window.close()',1000)";
> echo "";
> ?>
>
> 
> index.php:
>  session_start();
> include ("forum_fns.php");
> if (check_valid_user())
>  {
>   $login_status = true;
>  }
>  else
>  {
>   $login_status = false;
>  }
> if ($login_status == false)
>  {
>   echo "LOGGED IN";
>  }
>  else
>  {
>   echo "NOT LOGGED IN";
>  }
>
> ?>
>
> 
> forum_fns.php:
>  //will just set $username
> //we are talking only about session all other works
> $username = "Corwin";
>
> function login($username)
>  {
>   global $valid_user;
>   $valid_user = $username;
>   session_register("valid_user");
>  }
>
> function check_valid_user()
>  {
>   if (session_is_registered("valid_user"))
>{
> echo "\$valid_user registered";
> return true;
>}
>else
>{
> echo "\$valid_user not registered!!";
> return false;
>}
>  }
> ?>
>
>
>
> --
> Best regards,
>  Martin  mail   [EMAIL PROTECTED]
>  mobile +421.907.303.393
>  icq34358414
>  wwwhttp://www.corwin.sk
>
> PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033
>
> "In those days spirits were brave, the stakes were high,
>  men were real men, women were real women and small furry
>  creatures from Alpha Centauri were real small furry creatures
>  from Alpha Centauri."
>
> by Douglas Adams
>
>
> --
> 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] code for my question about sessions ;) sorry

2002-12-05 Thread Martin Hudec
Hello ,

okay here's the code...sorry forgot to post it
everything works in login.phpsession is registered...but in index,
it seems that session is empty...

login.php:
";
//reloads index.php (login.php is popup from index.php
echo "window.opener.location.reload();";
echo "setTimeout('window.close()',1000)";
echo "";
?>


index.php:



forum_fns.php:
";
return true;
   }
   else
   {
echo "\$valid_user not registered!!";
return false;
   }
 }
?>



-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

"In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri."

by Douglas Adams


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




Re: [PHP] Looping Addition

2002-12-05 Thread Stephen
One more question... If I then wanted to do this for the other operations
(such as multiplication, division, etc), how would I do that?


- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Stephen'" <[EMAIL PROTECTED]>; "'Chris Wesley'"
<[EMAIL PROTECTED]>
Cc: "'PHP List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 04, 2002 9:01 PM
Subject: RE: [PHP] Looping Addition


> > Let me explain this as best I can. The user enters how many numbers he
> > wants
> > to add. This form goes to another page. This page loops a form field
> and
> > it's name is "num" and after num is the number it is currently on.
> Here's
> > the code:
> >
> >   
> > 
> >   How many numbers to add:
> >> maxlength="2">
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> >  >  }
> >  else
> >  {
> >   if(!is_numeric($_POST['vars']) || $_POST['vars'] <= "1")
> >   {
> >echo "Go back and enter
> a
> > number or something greater then 1. DO NOT enter a letter or symbol.";
> >   }
> >   else
> >   {
> > ?>
> > 
> > 
> >  >  $current = 1;
> >  do
> >  {
> > ?>
> > 
> >   
> >id="vars"
> > value="0" size="25">
> > 
> >  >  $current++;
> >  } while($current <= $_POST['vars'])
> > ?>
>
> Change the above to:
>
>  for($x=0;$x<$_POST['vars'];$x++)
> {
>   ?>
> 
> Number :
> 
> 
>
> > 
> >   
> >   
> > 
> > 
> > 
> >
> > This is only a snippet, there is more to it but for simplicities
> sake...
> > Then I calculate it. My question is, how would I loop the adding? I
> hope
> > you
> > understand this now...
>
> And to do the addition...
>
> $sum = array_sum($_POST['num']);
>
> ---John Holmes...
>
>
>


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




Re: [PHP] sessions

2002-12-05 Thread Stephen
Show us your code and don't copy straight from books. ;-)


- Original Message - 
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Martin Hudec" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 7:57 AM
Subject: Re: [PHP] sessions


> > i have one script (index.php) which displays information (menu items)
> > based on result from function check_valid_user(). This function checks
> > if there is session_is_registered("valid_user").
> >
> > second script is for login.it saves into session
> > session_register("valid_user").then it reloads parent window
> > (index.php), which will then again check validity of user...but it
> > does not work.
> >
> > does anyone know why?
> 
> Yes... my magic PHP 8-ball says you are missing a semi-colon, period, or
> quote, or your logic is wrong and something isn't working...
> 
> ---John Holmes...
> 
> PS: :) Show us your code so we can see what's going on.
> 
> 
> -- 
> 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] ini function like ini_set and ini_alter

2002-12-05 Thread Franco Pozzer
Thanks Jason.

I use PHP as CGI in Win32 system because It is most stable like Apache
module.

I have make a same code PHP like this follow that I try ini_set and
ini_aletr function instead of the -htaccess solution.

The code that  try it is this:

$path";

echo ini_get("include_path");
echo"";

echo ini_set("include_path", ini_get("include_path") . ".;" .$path);
echo"";

echo ini_get("include_path");
echo"";

echo ini_get("auto_prepend_file");
echo"";

if(ini_alter("auto_prepend_file", $path . "systemVariables.php"))
echo "ini_alter success";
else
echo "ini_alter failed";

echo ini_get("auto_prepend_file");
echo"";

echo"xPathLibraryExt=$xPathLibraryExt"; 

The file that I try to *load* into my script it is in the
C:\OPENFEDRA\apache\htdocs\fedra\sv\cfg\systemVariables and it is this:



The error it is: 

C:\openfedra\apache\htdocs\fedra\sv\cfg\
;c:\php4\pear
;c:\php4\pear
;c:\php4\pear.;C:\openfedra\apache\htdocs\fedra\sv\cfg\


ini_alter failed
C:\openfedra\apache\htdocs\fedra\sv\cfg\systemVariables.php

xPathLibraryExt=

Warning: Failed opening 'functionXpath.php' for inclusion
(include_path='.;c:\php4\pear.;C:\openfedra\apache\htdocs\fedra\sv\cfg\')
in C:\OPENFEDRA\Apache\htdocs\fedra\sv\src\html\benvenut.php on line 39

Warning: Failed opening 'datiConfig.php' for inclusion
(include_path='.;c:\php4\pear.;C:\openfedra\apache\htdocs\fedra\sv\cfg\')
in C:\OPENFEDRA\Apache\htdocs\fedra\sv\src\html\benvenut.php on line 58

I this that auto_prepend_file it is set by ini_alter function because the
echo before and after function write the odl (Null value) and new value
(C:\openfedra\apache\htdocs\fedra\sv\cfg\systemVariables.php).

But  do not undestand because The ini_alter exit with failed and because
the next path variables are not find in the script.

Ciao franco.

Jason Wong wrote:

> On Thursday 05 December 2002 17:29, Franco Pozzer wrote:
> >
> > plaese write  step by step how to do to confugure apache.
> >
> > remeber this. I work in Win32 system and PHp worh as CGI.

> I don't use PHP as CGI with Apache so I don't think I can help you here.

> But ...

> > I have created .htaccess like this:
> >
> > php_value
> > auto_prepend_file="C:OPENFEDRAApachehtdocsfedrasvcfgsystemvariables.p
> >hp"

>  I have a feeling that if you're using PHP/CGI then you cannot set PHP 
> options using a .htaccess file ...

> > But I have and error like this:
> >
> >  error.log: [Wed Dec 04 15:14:53 2002] [alert] [client 127.0.0.1]
> > c:/openfedra/apache/htdocs/.htaccess: Invalid command 'php_value', perhaps
> > mis-spelled or
> > defined by a module not included in the server configuration

>  which is why you get this error.

> In any case, the correct way to specify php options in a .htaccess file is:

> php_value auto_prepend_file "C:OPENFEDRAApachex.php"

> NB there should not be an '='.





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




Re: [PHP] sessions

2002-12-05 Thread 1LT John W. Holmes
> i have one script (index.php) which displays information (menu items)
> based on result from function check_valid_user(). This function checks
> if there is session_is_registered("valid_user").
>
> second script is for login.it saves into session
> session_register("valid_user").then it reloads parent window
> (index.php), which will then again check validity of user...but it
> does not work.
>
> does anyone know why?

Yes... my magic PHP 8-ball says you are missing a semi-colon, period, or
quote, or your logic is wrong and something isn't working...

---John Holmes...

PS: :) Show us your code so we can see what's going on.


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




Re: [PHP] passing form variables with the same name

2002-12-05 Thread 1LT John W. Holmes
> I'd love to use an array, but I don't think you can pass an array value
from
> a form and have it work on the update script - e.g. input
> name="Resource[0]"...

Ah, but you can... You can use exactly what you just wrote and have
$_POST['Resource'][0] in your processing script. Loop through that array and
you're good to go. Or, you can name them as name="Resource[]" and let PHP
handle creating the keys (they'll start at zero, anyhow).

Enjoy...

---John Holmes...


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




Re: [PHP] Copy question

2002-12-05 Thread Marek Kilimajer
No, you can use ftp functions.

Evandro Sestrem wrote:


Hi,

Can I use the copy function to copy a file to a remote computer?
Ex:
// copy a file from my computer to a remote computer
copy('c:\teste.txt', '200.xxx.xx.xx/temp/teste.txt')

How can I do it?

Thanks in advance,

Evandro Sestrem



 



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




[PHP] passing form variables with the same name

2002-12-05 Thread Doug Parker
I'm passing form variables from a script that is meant to display 
information to be updated in a mysql database, and it sends these to a 
script that updates the changed values.  The problem is, I have a number 
of the same field being passed.  For example, I have two fields in an 
html form - Resource and Task, that need to be updated in a specific 
table, let's call it Projects.  However, I need to update every Resource 
and Task in table Projects.   So if there were 5 rows in Projects, the 
script would display the values for Task and Resource for all 5 rows, so 
that would total 10 input boxes.  Obviously, I loop the display of these 
variables in input boxes as to get all 5 rows.  So in order to send the 
variables to the script that will update them, they need to be unique - 
right?  I can't have the input name="Resource"  for each one, so in the 
loop on the form I resolved this by appending a number to each one - 
e.g. input name="Resource1", input name="Task1", input name="Resource2", 
... etc.  So now I have the unique variables I need, the problem is that 
I have no idea how to loop through them in the update script and update 
each one accordingly.   Can someone give me an idea how to do this?  I'd 
love to use an array, but I don't think you can pass an array value from 
a form and have it work on the update script - e.g. input 
name="Resource[0]"...

any help would be greatly appreciated.


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



[PHP] Copy question

2002-12-05 Thread Evandro Sestrem
Hi,

Can I use the copy function to copy a file to a remote computer?
Ex:
// copy a file from my computer to a remote computer
copy('c:\teste.txt', '200.xxx.xx.xx/temp/teste.txt')

How can I do it?

Thanks in advance,

Evandro Sestrem



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




[PHP] sessions

2002-12-05 Thread Martin Hudec
Hello,

I have following problem:

i have one script (index.php) which displays information (menu items)
based on result from function check_valid_user(). This function checks
if there is session_is_registered("valid_user").

second script is for login.it saves into session
session_register("valid_user").then it reloads parent window
(index.php), which will then again check validity of user...but it
does not work.

does anyone know why?

register globals are on.

-- 
Best regards,
 Martin  mail   [EMAIL PROTECTED]
 mobile +421.907.303.393
 icq34358414
 wwwhttp://www.corwin.sk

PGP key fingerprint  21365ca05ecfd8aeb1cf19c838fff033

"In those days spirits were brave, the stakes were high, 
 men were real men, women were real women and small furry 
 creatures from Alpha Centauri were real small furry creatures 
 from Alpha Centauri."

by Douglas Adams


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




[PHP] Re: Post Variables

2002-12-05 Thread Mattia

> for ($i=0; $i<=12; $i++)
> {
> echo "";
> echo "";
> }

the  tag must stay out of the for loop. the syntax for
 is


  
  
  
  
  


bye
Mattia



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




  1   2   >