Re: [PHP] Clean Up the sand box time

2003-08-23 Thread John Taylor-Johnston
Yes, but must be a better way to setup my if.then's ?
John


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



php-general Digest 23 Aug 2003 06:02:48 -0000 Issue 2253

2003-08-23 Thread php-general-digest-help

php-general Digest 23 Aug 2003 06:02:48 - Issue 2253

Topics (messages 160425 through 160482):

Re: Question for you guys and gals
160425 by: CPT John W. Holmes

isset bug?
160426 by: Christian Calloway
160430 by: Curt Zirzow
160435 by: Christian Calloway
160450 by: Robert Cummings

I wish I knew more about multi-dimensional arrays
160427 by: Verdon vaillancourt
160429 by: Ray Hunter

Re: File upload + permissions + .htaccess in php
160428 by: Ryan A

Re: timestamp
160431 by: John Taylor-Johnston
160433 by: Gabriel Guzman
160437 by: John Taylor-Johnston
160438 by: Gabriel Guzman
160444 by: CPT John W. Holmes
160445 by: John Taylor-Johnston

CMS question.
160432 by: Edmond Baroud

Re: rich text editing
160434 by: Andy Crain

File upload & restrictive permissions
160436 by: Doug Parker

'&' Sign in _GET Parameter
160439 by: Pushpinder Singh Garcha
160442 by: Gabriel Guzman
160443 by: CPT John W. Holmes
160448 by: Pushpinder Singh Garcha

anyone have any idea as to how to display a message after a page has started loading??
160440 by: Jeffrey D. Means
160441 by: Matt Babineau
160446 by: Dan Joseph
160453 by: Robert Cummings

Re: Getting browser resolution??
160447 by: erythros

Clean Up the sand box time
160449 by: John Taylor-Johnston
160452 by: Robert Cummings
160482 by: John Taylor-Johnston

PHP and directory permissions
160451 by: Lowell Allen

Trading senerio
160454 by: Joaco

Re: google style paginating
160455 by: Rob Yelvington
160475 by: Robert Cummings

float precision format not being kept
160456 by: Rob Yelvington
160469 by: CPT John W. Holmes

Re: WYSIWYG editor for PHP
160457 by: Rob Yelvington

need help figuring out how to delete rows?
160458 by: Deadsam

PHPOPENCHAT: he script tried to execute a method or access a property of an incomplete 
object.
160459 by: Robert Mena

Server variables on IIS
160460 by: Sid
160467 by: CPT John W. Holmes

eval function
160461 by: Matthias Wulkow
160481 by: Tom Rogers

Deleting same values from an array
160462 by: Stephen Craton
160466 by: CPT John W. Holmes
160470 by: Stephen Craton

STRING_FORMAT
160463 by: Dale Hersh
160464 by: Curt Zirzow

Shortcuts/aliases/sym-links?
160465 by: Dan Phiffer

linking via SSH to another server.
160468 by: Vail, Warren

Access denied problem, please help
160471 by: Ryan A
160473 by: Jim Lucas

Making a cookie never expire
160472 by: Stevie D Peele
160477 by: CPT John W. Holmes

safe_mode_include_dir
160474 by: Mark Clarkstone

What's user_dir?
160476 by: DvDmanDT

auto_prepend_file
160478 by: Dennis Gearon

Using PHP to get size of mySQL data?
160479 by: Jeff Lewis
160480 by: Robert Cummings

Administrivia:

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

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

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


--
--- Begin Message ---
From: "Curt Zirzow" <[EMAIL PROTECTED]>

> > Or cheat and use output buffering.
>
> IMO, thats an even more lazy way of doing it.

I agree entirely. I hate even giving that option, but it is there. That's
why I said he could "cheat" :)

---John Holmes...

--- End Message ---
--- Begin Message ---
Ok, here's the deal. I like to use $_GET and $_POST variables without values
to notify my scripts that some action must be taken. For example, given the
following URL:

http://blahdomain/blah.php?productid=1&edit

or given the following form element:



My blah.php script will check if edit set using the following line:

if (isset($_REQUEST["edit"]))
{
..
}

and then it will take the appropriate actions (lets just say its updating a
record in the database). Locally I am running PHPv4.3.2, and everything
works fine. I have been working on a large web-based application for the
last month, and yesterday I put it up live. Our host unfortunately runs
PHPv4.2.1 and I have no access to the conf files (those bastards) and
globals are set to on. Low and behold, the isset function returns false when
a $_POST or $_GET variable is passed but contains no value, which would be
exactly the same thing as checking the variable itself:

if ($_REQUEST["edit"]) { }

What I want and needed to do was check for the existance of the variable,
not whether it has a value. So is this a bug, a feature or just some random
happening? Thank guys

PHP ROCKS


--- End Message ---
--- Begin Message ---
* Thus wrote Christian Calloway ([EMAIL PROTECTED]):
> Ok, here's the deal. I like to use $_GET and $_POST variables without va

[PHP] Status Chaing Toggle / Code

2003-08-23 Thread Tony Pagliocco
Ok , I am slightly confused at the moment, maybe someone can shed me some
light about the situation.

I have a php page that pulls a query of all students in a table that have
fit a criteria, in this case, where
the field, named "web", is set to Y

So when you open the page, all people with Y = web , are spit out into a
table.

Name - Address - Printed..

-
Example:

Joe Smith - 5 Smith Road - Not Printed
Randy bob - 4 Joe Road - Not Printed

--- 

Now when the query outputs, I can click on the "Not Printed" link and it
should
update the persons row to change the vaule of the field named Printed from N
to Y.

Then when I referesh the page, it should look the same but instead of it
saying 
"Not Printed" it should say "Printed" next to the persons row.

So based on the above example, if we were to click on Joe Smith's "Not
Printed" link,
if we were to pull the page up later, it would now show "Printed"

We want to have a list of all students who have Y = Web but also at the same
time
monitor who we have pritned info on and who we dont, hence the reason for
the toggle.

I've included the code below to the function, my update looks correct but
when I'm coming 
back to the query page, its not changing the status of the "Not Printed" ,
so even 
if Printed is Y now in the field, it still says Not Pritned.

Any ideas? TIA everone


dbname = "ipo_students";

db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
$qid = db_query("SELECT printed FROM outgoing_student
 WHERE id=$student_id");
$row = mysql_fetch_array($qid);
$printed = $row['printed'];

echo "current value of printed is $printed";
if ($printed == 'n' || $printed == 'N' || empty($printed)) {
  $newvalue = "Y";
} else {
  $newvalue = "N";
}

db_query("UPDATE outgoing_student SET printed='$newvalue' WHERE
  id='$student_id'");

echo "Go to previous page and refresh";


?>



Tony Pagliocco
Systems Administrator
Arizona State University
International Programs Office
Phone: (480) 727-6279
Email: [EMAIL PROTECTED]




RE: [PHP] Making a cookie never expire

2003-08-23 Thread Joe Pemberton
You can, however, set the expire date to a date far in the future.  
http:// php.net/setcookie - take a look at the 3rd parameter.  Something
like time()+A_LOT_OF_SECONDS

-Original Message-
From: Stevie D Peele [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 5:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Making a cookie never expire

How can I make a cookie never expire?

Thanks,

Stevie


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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

2003-08-23 Thread Peter James
Check out php_admin_value, highlighted in the link below

http://216.239.33.104/search?q=cache:mpDXuwrDs_gJ:www.php.net/configuration.changes+php_admin_value+site:www.php.net&hl=en&ie=UTF-8

--
Peter James
Editor-in-Chief, php|architect Magazine
[EMAIL PROTECTED]

php|architect
The Magazine for PHP Professionals
http://www.phparch.com


- Original Message - 
From: "Dennis Gearon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 8:39 PM
Subject: [PHP] auto_prepend_file


> Is there any settings that will silently disable the ability  for a
> <.htaccess> file to use the
>
> php_value auto_prepend_value "some file name"
>
> directive? Some safe mode thing, or an ini setting or something?
>
> The people at the host I'm at just CAN'T seem to get it working on my
> site. It's an ensim site.
>
> I have errors turned on, and it doesn't even give an error. It's like
> the line doesn't exist.
>
> If I had a browning light with some sabotted tungsten carbide slugs, I'd
> fix the G*^(*^N server,
>
> after three days of messing with this. :-)
>
>
>
> -- 
> 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] google style paginating

2003-08-23 Thread Mika Tuupola
On Thu, 21 Aug 2003, Ted Conn wrote:

> Hi I am new to this newsgroup and I plan on replying to all the posts I can
> for now... but Id like to start out by asking a question. I am trying to
> paginate my sql results in 10 by 10, which I have been able to do no
> problem. but what I want to do is have the pages layed out in google style
> with (1)(2)(3)(4) etc etc and each one is clickeable that will take you to
> that page. I'll show you the code I am using now for next and back
> buttons...
> 

You might want to check Page and Pager_Sliding classes in PEAR:

http://pear.php.net/package-info.php?package=Pager
http://pear.php.net/package-info.php?package=Pager_Sliding

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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



Re: [PHP] google style paginating

2003-08-23 Thread Haseeb











hi,
i have a simple solutions for paging a large query result into pages.
format your SQL Query like this and it will work
 
$nTotal_No_Of_Results_Shown_On_A_Page=20;
 
if (empty($nCurrentPage))
    $nCurrentPage=1;
 
$tablename="tblusers"; // table from where the data is comming from
$fieldtosorton="user_name"; //    a field on wich you want to sort the result returned
$where="user_enabled=1";        // any where clause
 
$strQuery="SELECT TOP ".$nTotal_No_Of_Results_Shown_On_A_Page." * FROM $tablename WHERE $fieldtosorton NOT IN (SELECT TOP " .($nTotal_No_Of_Results_Shown_On_A_Page * ($nCurrentPage -1)) ." ".$fieldtosorton." FROM ".$tablename." WHERE $where ORDER BY ".$fieldtosorton.") ".$where." ORDER BY ".$fieldtosorton;
 
this query will give you just the result that you want to show on the current page. all you have to do is maintain $nCurrentPage. if you change the query slightly you can get the total no of records and when you get total no of records then you can also get total no of pages.
 
HTH,
Haseeb 
 
---Original Message---
 

From: Mika Tuupola
Date: Saturday, August 23, 2003 01:00:49 PM
To: Ted Conn
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] google style paginating
 
On Thu, 21 Aug 2003, Ted Conn wrote:
 
> Hi I am new to this newsgroup and I plan on replying to all the posts I can
> for now... but Id like to start out by asking a question. I am trying to
> paginate my sql results in 10 by 10, which I have been able to do no
> problem. but what I want to do is have the pages layed out in google style
> with (1)(2)(3)(4) etc etc and each one is clickeable that will take you to
> that page. I'll show you the code I am using now for next and back
> buttons...
>
 
  You might want to check Page and Pager_Sliding classes in PEAR:
 
  http://pear.php.net/package-info.php?package=Pager
  http://pear.php.net/package-info.php?package=Pager_Sliding
 
--
Mika Tuupola http://www.appelsiini.net/~tuupola/
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 







  IncrediMail - Email has finally evolved - Click Here

Re: [PHP] Clean Up the sand box time

2003-08-23 Thread Nicholas Robinson
On Friday 22 Aug 2003 10:26 pm, John Taylor-Johnston wrote:
> This is my favourite question. Can I clean up my 'if then' statements a
> tad? Must be a cleaner way?
> Still learning, still having fun :)
> Thanks,
> John
>
>  $news = mysql_query($sql) or die(print
> "document.write(\"".mysql_error()."\");");
>
>  $found = 0;
>  while ($mydata = mysql_fetch_object($news))
>  {
>   if($getaddr == $mydata->IPAddress)
>   {
>   $found = 1;
>   }
>  }
>
>   if ($found > 0)
>   {
>   echo "document.write(\"$getaddr already visited. \");";
>   }else{
>   echo "document.write(\"insert $getaddr into $table. \");";
>   }

Not sure at exactly what level you're looking to improve it!

Could you improve the query so you didn't have to search through all the 
records? i. e. add in '..where IPAddress = $getaddr" That way you could do 
away with the while loop altogether.

If you can't then why not break out of the while as soon as you've found the 
IPaddress you're looking for - i.e.

if ( $found = $getaddr == $mydata->IPAddress ) break;

And finally, if you were really having a downer on if statements you could use 
the ternary operator form as in:

document.write( ( $found ) ? "...already vistied" : "insert..." );

Whatever you use, I think Robert's layout not only shows elegance and panache 
but also makes it much easier to read.

HTH

Nick

PS: IP addresses are a notoriously bad way of checking to see if someone's 
visited your site.



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



Re: [PHP] text area question

2003-08-23 Thread Marek Kilimajer
This DOES correct the error.  is like  element, white 
space and newlines are NOT ignored. Try it for yourself.

Keith Higgs wrote:
Only if you're concerned about those few whitespace characters increasing your file size. Granted, there mey be PHP output related issues to a multi-line whitespace within an echo or print operation but, so far as the actual HTML is concerned, white space is white space and it should all be ignored by the browser's  rendering engine.

The suggested correction DOES do a lot for programming style by eliminating the superfluous space, and the possibility that you may introduce errors by inserting other code in that area.

D. Keith Higgs  216-368-0559
 Case Western Reserve University, Webmaster / Database Analyst - University Library
 Additional Information at http://www.cwru.edu/UL/ and http://keith.cwru.edu/
"Never overestimate the sanity of your sysadmin."
 No trees were killed in the creation of this message. 
 However, many electrons were terribly inconvenienced.


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 07:08 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] text area question

Your textarea should be:

and not





Angelo Zanetti wrote:


Hi this is slightly off topic but i hope i will be forgived.

I have a textarea and whenever my page loads and I click in 
it the cursor

nevers starts at the very beginning and I have to push the 
backspace buttton

until i get to the start. is there a property or something 
to fix this??

thanx in advance
angelo




--
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 help figuring out how to delete rows?

2003-08-23 Thread Marek Kilimajer
DELETE FROM table ORDER BY timestamp DESC LIMIT 40, 1000

untested, but should work

Deadsam wrote:

Hi Im making a chatroom using flash and php, the one problem Im having is
deleting rows.
What I'm looking for is when they click on the button to send the message
into php-->mySql  it will also
check to see how many rows are in that table and if they are greater then
40, then to delete the rows
over 40, starting with the oldest ones ASC. I thought about using the chatID
number but that will change
everytime. So I was thinking of having it check for how many rows there is
if its greater then 40 rows then
delete thgose over 40 ASC.
Hope I explained it good enough :)
Anyhow if anyone has a solution for this I would really appreciate it.
Thanks in advance
Deadsam





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


Re: [PHP] need help figuring out how to delete rows?

2003-08-23 Thread Marek Kilimajer
Actualy, it will not. LIMIT can have only one argument with DELETE.
This will ($count is the number of rows you need to get in a previous 
query):

DELETE FROM table ORDER BY timestamp ASC LIMIT $count-40

Marek Kilimajer wrote:

DELETE FROM table ORDER BY timestamp DESC LIMIT 40, 1000

untested, but should work

Deadsam wrote:

Hi Im making a chatroom using flash and php, the one problem Im having is
deleting rows.
What I'm looking for is when they click on the button to send the message
into php-->mySql  it will also
check to see how many rows are in that table and if they are greater then
40, then to delete the rows
over 40, starting with the oldest ones ASC. I thought about using the 
chatID
number but that will change
everytime. So I was thinking of having it check for how many rows 
there is
if its greater then 40 rows then
delete thgose over 40 ASC.
Hope I explained it good enough :)
Anyhow if anyone has a solution for this I would really appreciate it.
Thanks in advance
Deadsam








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


Re: [PHP] Status Chaing Toggle / Code

2003-08-23 Thread Robert Cummings
Code and query look about right -- my guess is you're another one of the
multitude of people who haven't bothered to read the docs about register
globals and how they are now off by default. If the following solves
your problem, then yes indeed, such are you.

include("../../application2.php");
$CFG->dbname = "ipo_students";

//
// $student_id probably came in from $_GET or $_POST.
//
$student_id
= isset( $_GET['student_id'] )
? $_GET['student_id']
: (isset( $_POST['student_id'] )
? $_POST['student_id']
: null;

if( is_null( $student_id ) )
{
echo 'You have some other problem!'."\n";
}

db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
$qid = db_query("SELECT printed FROM outgoing_student
 WHERE id=$student_id");

Cheers,
Rob.

On Fri, 2003-08-22 at 14:45, Tony Pagliocco wrote:
> Ok , I am slightly confused at the moment, maybe someone can shed me some
> light about the situation.
> 
> I have a php page that pulls a query of all students in a table that have
> fit a criteria, in this case, where
> the field, named "web", is set to Y
> 
> So when you open the page, all people with Y = web , are spit out into a
> table.
> 
> Name - Address - Printed..
> 
> -
> Example:
> 
> Joe Smith - 5 Smith Road - Not Printed
> Randy bob - 4 Joe Road - Not Printed
> 
> --- 
> 
> Now when the query outputs, I can click on the "Not Printed" link and it
> should
> update the persons row to change the vaule of the field named Printed from N
> to Y.
> 
> Then when I referesh the page, it should look the same but instead of it
> saying 
> "Not Printed" it should say "Printed" next to the persons row.
> 
> So based on the above example, if we were to click on Joe Smith's "Not
> Printed" link,
> if we were to pull the page up later, it would now show "Printed"
> 
> We want to have a list of all students who have Y = Web but also at the same
> time
> monitor who we have pritned info on and who we dont, hence the reason for
> the toggle.
> 
> I've included the code below to the function, my update looks correct but
> when I'm coming 
> back to the query page, its not changing the status of the "Not Printed" ,
> so even 
> if Printed is Y now in the field, it still says Not Pritned.
> 
> Any ideas? TIA everone
> 
> 
>  
> ## parameter: $student_id
> 
> include("../../application2.php");
> $CFG->dbname = "ipo_students";
> 
> db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
> $qid = db_query("SELECT printed FROM outgoing_student
>  WHERE id=$student_id");
> $row = mysql_fetch_array($qid);
> $printed = $row['printed'];
> 
> echo "current value of printed is $printed";
> if ($printed == 'n' || $printed == 'N' || empty($printed)) {
>   $newvalue = "Y";
> } else {
>   $newvalue = "N";
> }
> 
> db_query("UPDATE outgoing_student SET printed='$newvalue' WHERE
>   id='$student_id'");
> 
> echo "Go to previous page and refresh";
> 
> 
> ?>
> 
> 
> 
> Tony Pagliocco
> Systems Administrator
> Arizona State University
> International Programs Office
> Phone: (480) 727-6279
> Email: [EMAIL PROTECTED]
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Access denied problem, please help

2003-08-23 Thread Ryan A
Oops sorry,
Here are the phpinfo files of the other 2:

bestwebhosters.com/phpinfo.php
321go.biz/phpinfo.php

jumac.com/phpinfo.php


I have noticed that in the other two phpinfo files that it shows
file_uploads as "on" but in jumac it shows it as "1" which according to the
manual at the phpinfo site is the default, maybe i should change it to "on"?
but how via a .htaccess as i dont hvae accsess to the php.ini file...

Thanks,
-Ryan


> how about giving the specs on all three servers?
>
> So WE can see the differences.
>
> Jim Lucas


> > Hi,
> > I am trying to upload something into a directory on my server but always
i
> > am getting a permission denied ONLY from this server...i have tried it
on
> 2
> > other servers and they seem to be working fine but i have to get it
> working
> > on this server as this server is the fastest and our production server.
> >
> > I have looked at the folder permissions and CHMODED/changed them from
644
> to
> > 766 and finally 777 but am getting the same error, i then had a look at
> the
> > php info file (http://jumac.com/phpinfo.php) and i see file_uploading is
> set
> > to 1 and 1, safe mode is off, i am not too familier with file uploading
so
> > is this right? if not, how can i change it? hopefully via a .htaccess as
I
> > dont have access to the php.ini file directly.
> >
> > These are my paths:
> > $UserUploadDir="/usr163/home/r/y/ryanknig/public_html/BWH-Ads-Images";
> > $UserUploadURL = "http://jumac.com/BWH-Ads-Images";;
> >
> >
> > Let me again point out that this problem only seems to be on this
server,
> > the scripts including the upload is working perfectly on the other test
> > servers/sites.
> >
> > Kindly reply,
> > -Ryan A.
> >
> >
> >
> > We will slaughter you all! - The Iraqi (Dis)information ministers site
> > http://MrSahaf.com
> >
> >
> >
> > -- 
> > 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
>



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



[PHP] Uploading problem = weird warning (was: access denied problem.....)

2003-08-23 Thread Ryan A
Hi,

I had a problem where my upload form was not working on our production
server but was working on two other servers, after checking the phpinfo file
i saw that the others had file_uploads set to ON ON and in the production
server it was 1 1,
So I successfully changed my file_uploads value from 1 to ON via a .htaccess
file (php_value file_uploads ON), before it was giving me an access denied
error even thought the directory was chmoded 777, but after i have made the
"local" file_uploads to ON it is giving me this warning:

Warning: getimagesize: Unable to open '' for reading. in
/usr163/home/r/y/ryanknig/public_html/ads/ads_lib1.php on line 834

I have checked the path and it is perfect.what do you think the problem
is?

This server is on  FreeBSD 4.6-STABLE while the others are on linux.

You can see the phpinfo files here if you want (first 2 are where the
software is working)
http://321go.biz/phpinfo.php
http://bestwebhosters.com/phpinfo.php

http://jumac.com/phpinfo.php


The people i am hosting with are very nice and i'm pretty sure they will be
willing to change my php.ini for me if needed, but i dont know what to ask
them to change in the first place...

Thanks,
-Ryan




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



[PHP] 2 questions

2003-08-23 Thread Thomas Hochstetter
Hi guys.

I have two questions for you today:

1. Weired login problem
I am developinig a site for a conference where i have a login page for
members. This page is called index.php and includes different types of modules,
according to the type of user logged on. The problem is now following:
i have a login function hidden in a class, this function registers a bunch
of variables. After the user has submited the details, index.php (which calls
the session_start()) calls the login function. Then i check whether a session
variable is present ($_SESSION['name']). If yes, we include the members
area, otherwise we include the login table again. Now: on my test server
(XP/Apache/php4.3.2) all is well. However, on the real server (Linux/Apache/php4.0.x)
it just includes the login table anyway, even if the login was successful. I
then have to click on the menu link again to include the member script.
Why is that?

2. Save a large amount of text to a file
On the same page i have some type of cms going. The admin users can change
txt files which relate to text on some of the general pages. I have now found
that it is only transmits a certain amount of text via GET to the function
that writs to the files. Is there a restriction on passing text via url? If yes
(which will be the case), how could i do this otherwise?

Thanks so long...

Thomas
P.S: this list still rocks

-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post


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



Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:


TR> This should do it:

TR> eval('${"content".$databasepagename}[$i]();');

I'm afraid to say it, but it does not :-(

Yesterday I was also trying to find some manual pages about eval()
which would explain me the syntax. The example in the PHP-Manual is
not meaning much to me.

How can I print out what eval would evaluate, so I can see how to
compose the string?

Thx for answering again ;-)

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



Re: [PHP] 2 questions

2003-08-23 Thread Binay Agarwal

- Original Message -
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 5:33 PM
Subject: [PHP] 2 questions


> Hi guys.
>
> I have two questions for you today:
>
> 1. Weired login problem
> I am developinig a site for a conference where i have a login page for
> members. This page is called index.php and includes different types of
modules,
> according to the type of user logged on. The problem is now following:
> i have a login function hidden in a class, this function registers a bunch
> of variables. After the user has submited the details, index.php (which
calls
> the session_start()) calls the login function. Then i check whether a
session
> variable is present ($_SESSION['name']). If yes, we include the members
> area, otherwise we include the login table again. Now: on my test server
> (XP/Apache/php4.3.2) all is well. However, on the real server
(Linux/Apache/php4.0.x)
> it just includes the login table anyway, even if the login was successful.
I
> then have to click on the menu link again to include the member script.
> Why is that?

Check your register_globals setting in both ur test server and real server
and let me know.

>
> 2. Save a large amount of text to a file
> On the same page i have some type of cms going. The admin users can change
> txt files which relate to text on some of the general pages. I have now
found
> that it is only transmits a certain amount of text via GET to the function
> that writs to the files. Is there a restriction on passing text via url?
If yes
> (which will be the case), how could i do this otherwise?

Use POST instead of GET method... POST method allows u to even extend the
size of data being posted.

Hope this helps...

>
> Thanks so long...
>
> Thomas
> P.S: this list still rocks
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
>
> --
> 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] Random selection

2003-08-23 Thread fkeessen
Hi,

Can you help me with this one?? 

In my mysql db i have a colum called names;

In names their are:

Frank
Frank
Bob
Alice
Bob
Alice
Jim
Alice
Frank

I want to make a random selection (max 3 value's for example).. Only it may not 
produce two times the same name. For example;

This is the output:

Frank, Jim, alice

Wrong output

Frank, Frank, Jim

Please help!

Thanks,

Frank


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

[PHP] Help with a script

2003-08-23 Thread Stevie D Peele
I've been working on a script for quite some time now, particulary a site
news script. Heres how it works

1. Information is passed from a form to the database
2. Table is selected to a page to be viewed by the general public.

The problem is, when I use the form, there are no errors in the script,
but nothing is entered into the database.

Here are my scripts
The
Query
CREATE TABLE SiteNews 
(
Alias varchar(50) NOT NULL default '0',
News BLOB NOT NULL,
NewsDate Date NOT NULL 
) TYPE=MyISAM
-
-

form
action

-
-

Viewing the news
script---
'.$sql.'');

if ($news){
   if (mysql_num_rows($news)== 0){
 echo ("No newsitems found.");
   }
   else{
 while ($row = mysql_fetch_assoc($news)){
  echo("");
  echo($row['Alias']. "");
  echo($row['NewsDate']."");
  echo($row['News']);
  echo("");
  echo("");
}
  }
}
else{
   echo("Queryproblem");
}

 ?>
-
-

Can anyone see what is wrong?? 

Thanks

Re: [PHP] I wish I knew more about multi-dimensional arrays

2003-08-23 Thread Verdon vaillancourt
Hey bigdog, that's beautiful! I laughed, I cried, so elegant ;)

Thanks, that did the job nicely.

Salut,
verdon



On 8/23/03 2:02 AM, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> From: Ray Hunter <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Fri, 22 Aug 2003 11:03:10 -0600
> To: 'PHP-General' <[EMAIL PROTECTED]>
> Subject: Re: [PHP] I wish I knew more about multi-dimensional arrays
> 
> mysql result as a multi-dimensional array:
> 
> while( $row = mysql_fetch_array($result) ) {
> $rows[] = $row;
> }
> 
> now you have a multi-dimensional array that contains each row in rows...
> 
> examples:
> row 1 col 1 - $rows[0][0]
> row 3 col 2 - $rows[3][2]
> 
> hth
> 
> --
> bigdog
> 
> 
> On Fri, 2003-08-22 at 10:37, Verdon vaillancourt wrote:
>> Hi, please don't chuckle (too loudly) at my attempts to learn ;)
>> 
>> I'm trying to create what I think would be a multi-dimensional array from a
>> mysql result set, to use in some example code I got off this list last week.
>> 


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



Re: [PHP] Random selection

2003-08-23 Thread David Otton
On Sat, 23 Aug 2003 15:06:32 +0200 (CEST), you wrote:

>In my mysql db i have a colum called names;
>
>In names their are:
>
>Frank
>Frank
>Bob
>Alice
>Bob
>Alice
>Jim
>Alice
>Frank
>
>I want to make a random selection (max 3 value's for example).. Only it may not 
>produce two times the same name. For example;

First make sure the array values are distinct:

$array = array_unique ($array);

Then shuffle the array:

shuffle ($array);

Then slice the array down to size:

if (sizeof ($array) > 3)
{
$array = array_slice ($array, 0, 3);
}

There are faster ways, but this is probably the shortest code snippet.

BTW, if a value appears multiple times in a database column then your
database may be a good candidate for normalisation.


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



Re: [PHP] Random selection

2003-08-23 Thread Binay Agarwal
Hi

You can use "select distinct names from table_name order by rand() limit 3".
Hope this helps and let me know.

cheers
Binay


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 6:36 PM
Subject: [PHP] Random selection


> Hi,
>
> Can you help me with this one??
>
> In my mysql db i have a colum called names;
>
> In names their are:
>
> Frank
> Frank
> Bob
> Alice
> Bob
> Alice
> Jim
> Alice
> Frank
>
> I want to make a random selection (max 3 value's for example).. Only it
may not produce two times the same name. For example;
>
> This is the output:
>
> Frank, Jim, alice
>
> Wrong output
>
> Frank, Frank, Jim
>
> Please help!
>
> Thanks,
>
> Frank
>
>
>






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

2003-08-23 Thread fkeessen
Hi,

Thanks for the answer.. I'm open for faster ways!!!

>BTW, if a value appears multiple times in a database column then your
>database may be a good candidate for normalisation.

Problem i'm selecting some holidays out of an database but I want to avoid that there 
are holiday's presented from the same place..

THanks,

Frank

Sorry but i'm trying to avoid 
>On Sat, 23 Aug 2003 15:06:32 +0200 (CEST), you wrote:
>
>>In my mysql db i have a colum called names;
>>
>>In names their are:
>>
>>Frank
>>Frank
>>Bob
>>Alice
>>Bob
>>Alice
>>Jim
>>Alice
>>Frank
>>
>>I want to make a random selection (max 3 value's for example).. Only it may not 
>>produce two times the same name. For example;
>
>First make sure the array values are distinct:
>
>$array = array_unique ($array);
>
>Then shuffle the array:
>
>shuffle ($array);
>
>Then slice the array down to size:
>
>if (sizeof ($array) > 3)
>{
>$array = array_slice ($array, 0, 3);
>}
>
>There are faster ways, but this is probably the shortest code snippet.
>
>BTW, if a value appears multiple times in a database column then your
>database may be a good candidate for normalisation.
>
>
>-- 
>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] Shell connect

2003-08-23 Thread Dennis Dujan - Partycult.de
Hello,
I have a general Question about PHP.
Is it Possible to connect via shell from a Webserver
to another Server?
Do you have perhaps some exampels or help pages?
 
It would be very nice if you can help me :-)
 
Best regrads
Dennis D.


Re: [PHP] Access denied problem, please help

2003-08-23 Thread Jim Lucas
These are all converted into boulean once the config file is read.  So it
doesn't matter.

on = yes = 1 = true
off = no = 0 = false

And by what method are you uploading the files?

Can you show the Form and process scripts.  If they are large scripts,
please only include the sections that does the uploading.

Jim Lucas

- Original Message - 
From: "Ryan A" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 4:06 AM
Subject: Re: [PHP] Access denied problem, please help


> Oops sorry,
> Here are the phpinfo files of the other 2:
>
> bestwebhosters.com/phpinfo.php
> 321go.biz/phpinfo.php
>
> jumac.com/phpinfo.php
>
>
> I have noticed that in the other two phpinfo files that it shows
> file_uploads as "on" but in jumac it shows it as "1" which according to
the
> manual at the phpinfo site is the default, maybe i should change it to
"on"?
> but how via a .htaccess as i dont hvae accsess to the php.ini file...
>
> Thanks,
> -Ryan
>
>
> > how about giving the specs on all three servers?
> >
> > So WE can see the differences.
> >
> > Jim Lucas
>
>
> > > Hi,
> > > I am trying to upload something into a directory on my server but
always
> i
> > > am getting a permission denied ONLY from this server...i have tried it
> on
> > 2
> > > other servers and they seem to be working fine but i have to get it
> > working
> > > on this server as this server is the fastest and our production
server.
> > >
> > > I have looked at the folder permissions and CHMODED/changed them from
> 644
> > to
> > > 766 and finally 777 but am getting the same error, i then had a look
at
> > the
> > > php info file (http://jumac.com/phpinfo.php) and i see file_uploading
is
> > set
> > > to 1 and 1, safe mode is off, i am not too familier with file
uploading
> so
> > > is this right? if not, how can i change it? hopefully via a .htaccess
as
> I
> > > dont have access to the php.ini file directly.
> > >
> > > These are my paths:
> > > $UserUploadDir="/usr163/home/r/y/ryanknig/public_html/BWH-Ads-Images";
> > > $UserUploadURL = "http://jumac.com/BWH-Ads-Images";;
> > >
> > >
> > > Let me again point out that this problem only seems to be on this
> server,
> > > the scripts including the upload is working perfectly on the other
test
> > > servers/sites.
> > >
> > > Kindly reply,
> > > -Ryan A.
> > >
> > >
> > >
> > > We will slaughter you all! - The Iraqi (Dis)information ministers site
> > > http://MrSahaf.com
> > >
> > >
> > >
> > > -- 
> > > 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] Random selection

2003-08-23 Thread Jim Lucas
Try this:

SELECT name FROM table GROUP BY name ORDER BY RAND() LIMIT 3

This will group together all the names and then choose from a list that has
only unique names and then return 3 at random.

Jim Lucas

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 6:06 AM
Subject: [PHP] Random selection


> Hi,
>
> Can you help me with this one??
>
> In my mysql db i have a colum called names;
>
> In names their are:
>
> Frank
> Frank
> Bob
> Alice
> Bob
> Alice
> Jim
> Alice
> Frank
>
> I want to make a random selection (max 3 value's for example).. Only it
may not produce two times the same name. For example;
>
> This is the output:
>
> Frank, Jim, alice
>
> Wrong output
>
> Frank, Frank, Jim
>
> Please help!
>
> Thanks,
>
> Frank
>
>
>






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


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



Re: [PHP] Help with a script

2003-08-23 Thread Jim Lucas
what is the source for the page that you initially enter the data on the web
form look like?

Jim Lucas
- Original Message - 
From: "Stevie D Peele" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 6:25 AM
Subject: [PHP] Help with a script


> I've been working on a script for quite some time now, particulary a site
> news script. Heres how it works
>
> 1. Information is passed from a form to the database
> 2. Table is selected to a page to be viewed by the general public.
>
> The problem is, when I use the form, there are no errors in the script,
> but nothing is entered into the database.
>
> Here are my scripts
> The
> Query
> CREATE TABLE SiteNews
> (
> Alias varchar(50) NOT NULL default '0',
> News BLOB NOT NULL,
> NewsDate Date NOT NULL
> ) TYPE=MyISAM
> -
> -
>
> form
> action
>  include ('config.php');
> $link = @mysql_pconnect($location, $username, $password)
>   or die("Could not connect to the databaseserver. Please go back and
> try again or try again later.");
> @mysql_select_db($database, $link)
>   or die ("Could not select database. Please go back and try again or
> try again later.");
> $sql_insert = "INSERT INTO SiteNews ('Alias','News','NewsDate')
> VALUES ('". addslashes($_POST['newsperson']) . "','" .  $_POST['date']  .
> "','" .  addslashes($_POST['thenews']) . "')";
>
> $result = mysql_query($sql_insert, $link);
> echo (mysql_affected_rows($link) . " News entry inserted");
> ?>
> -
> -
>
> Viewing the news
> script---
>  include ('config.php');
> $link = @mysql_pconnect($location, $username, $password)
>  or die("Could not connect to the databaseserver. Please go back and
> try again or try again later.");
> @mysql_select_db($database,$link)
>  or die ("Could not select database. Please go back and try again or
> try again later.");
> $sql = "SELECT Alias, NewsDate, News FROM SiteNews ORDER BY NewsDate
> DESC";
> $news = mysql_query($sql,$link) or die(mysql_error().''.$sql.'');
>
> if ($news){
>if (mysql_num_rows($news)== 0){
>  echo ("No newsitems found.");
>}
>else{
>  while ($row = mysql_fetch_assoc($news)){
>   echo("");
>   echo($row['Alias']. "");
>   echo($row['NewsDate']."");
>   echo($row['News']);
>   echo("");
>   echo("");
> }
>   }
> }
> else{
>echo("Queryproblem");
> }
>
>  ?>
> -
> -
>
> Can anyone see what is wrong??
>
> Thanks


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



Re[2]: [PHP] eval function

2003-08-23 Thread Tom Rogers
Hi,

Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW> Hallo Tom,

MW> am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:

TR>> This should do it:

TR>> eval('${"content".$databasepagename}[$i]();');

MW> I'm afraid to say it, but it does not :-(

MW> Yesterday I was also trying to find some manual pages about eval()
MW> which would explain me the syntax. The example in the PHP-Manual is
MW> not meaning much to me.

MW> How can I print out what eval would evaluate, so I can see how to
MW> compose the string?

MW> Thx for answering again ;-)

MW> SvT

This works for me, what error message do you get? Make sure you use
single quotes in the eval otherwise the string will get substituted
before eval gets a look at it.

'testpage');
function testpage(){
echo 'Test succceeded ';
}
$i = 1;
$databasepagename = 'array';

eval('${"content".$databasepagename}[$i]();');
?>

-- 
regards,
Tom


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



Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:


TR> This works for me, what error message do you get? Make sure you use
TR> single quotes in the eval otherwise the string will get substituted
TR> before eval gets a look at it.

TR>  $contentarray = array(1=>'testpage');
TR> function testpage(){
TR> echo 'Test succceeded ';
TR> }
TR> $i = 1;
TR> $databasepagename = 'array';

TR> eval('${"content".$databasepagename}[$i]();');
?>>

That's the error I find in the apache-log. On the screen, I get
nothing but a white page. By the way I have error_reporting(E_ALL);
but I never get errors reported...

PHP Fatal error:  Call to undefined function:  () in 
/usr/local/www/showFunctions.php(77)

Your script is working. But mine not... is it because I'm on a output
buffer? I use ob_start() just before, because the real output is
produced by the function I want to call with the eval method...

Here the part of my script:

$query = "SELECT pagename FROM pages";
$result = mysql_query($query);
$a = 0;
while($row = mysql_fetch_array($result, MYSQL_BOTH)){
  $page[$a] = $row["pagename"];
  $fct[$a] = $page[$a];
  $fct[$a] = substr($fct[$a],1);
  $fct[$a] = str_replace(".php", "", $fct[$a]);
  $fct[$a] = ucfirst($fct[$a]);
  $a++;
}
mysql_free_result($result);

ob_start();

for($b = 0; $b < sizeof($fct); $b++){
  if($_SERVER["PHP_SELF"] == $page[$b])
eval('${"content".$fct}[$b]();');
}

...

The "pagename" in the database is stored like /about.php so I change
it to About in the while-loop.

The eval method is there to replace my actual code (which is static):
if($_SERVER["PHP_SELF"] == "/login.php")
  contentLogin();
if($_SERVER["PHP_SELF"] == "/logout.php")
  contentLogout();

...

Using the "if-cascade", it is working, for you to know that the
mistake is definitly in the eval()-method...

Thx for your time...

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



Re: [PHP] Easy XML & PHP tutorials ?????

2003-08-23 Thread Noivad
On Thursday, August 21, 2003, at 07:34 PM, Burhan Khalid wrote:

On Friday, August 22, 2003, 2:16:06 AM, Joe wrote:

JH> Hello all. does anyone have any very easy XML tutorials . I have a
JH> simple weather feed I want to implement. but no XML experience
JH> thanks


I have one at my site, complete with an example and downloadble code.
I also wrote a class that parses an XML weather feed. Are  you trying
to use the intercept vector xml feeds?
Anyhow, the tutorial is at my site (check the signature). Click on PHP
under the sections on the left.

If you don't find mine too useful, there are plenty of other tutorial
sites around. My favorite one is at zend http://www.zend.com/zend/tut/
Thank you for listing this site. I've been lurking here for a while 
trying to pick up useful info and  It looks like this site is what I've 
been looking for.

-Michael

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


Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:

TR> Hi,

TR> Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW>> Hallo Tom,

MW>> am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:

TR>>> This should do it:

TR>>> eval('${"content".$databasepagename}[$i]();');

MW>> I'm afraid to say it, but it does not :-(

MW>> Yesterday I was also trying to find some manual pages about eval()
MW>> which would explain me the syntax. The example in the PHP-Manual is
MW>> not meaning much to me.

MW>> How can I print out what eval would evaluate, so I can see how to
MW>> compose the string?

MW>> Thx for answering again ;-)

MW>> SvT

TR> This works for me, what error message do you get? Make sure you use
TR> single quotes in the eval otherwise the string will get substituted
TR> before eval gets a look at it.

TR>  $contentarray = array(1=>'testpage');
TR> function testpage(){
TR> echo 'Test succceeded ';
TR> }
TR> $i = 1;
TR> $databasepagename = 'array';

TR> eval('${"content".$databasepagename}[$i]();');
?>>

Sorry, I got it to show errors...

here: (it's almost the same than in apache-log)

Notice: Undefined variable: contentArray in /usr/local/www/showFunctions.php(77) : 
eval()'d code on line 1

Fatal error: Call to undefined function: () in /usr/local/www/showFunctions.php(77) : 
eval()'d code on line 1

SvT

-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



[PHP] how to do this

2003-08-23 Thread macromaniac
well,
i have to php pages and i want to send one argument from one to another.  I
tried a few things but I couldn't do it.

is there a special way to do it?



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



Re[2]: [PHP] eval function

2003-08-23 Thread Tom Rogers
Hi,

Sunday, August 24, 2003, 2:32:01 AM, you wrote:

MW> That's the error I find in the apache-log. On the screen, I get
MW> nothing but a white page. By the way I have error_reporting(E_ALL);
MW> but I never get errors reported...

MW> PHP Fatal error:  Call to undefined function:  () in 
/usr/local/www/showFunctions.php(77)

MW> Your script is working. But mine not... is it because I'm on a output
MW> buffer? I use ob_start() just before, because the real output is
MW> produced by the function I want to call with the eval method...

MW> Here the part of my script:

MW> $query = "SELECT pagename FROM pages";
MW> $result = mysql_query($query);
MW> $a = 0;
MW> while($row = mysql_fetch_array($result, MYSQL_BOTH)){
MW>   $page[$a] = $row["pagename"];
MW>   $fct[$a] = $page[$a];
MW>   $fct[$a] = substr($fct[$a],1);
MW>   $fct[$a] = str_replace(".php", "", $fct[$a]);
MW>   $fct[$a] = ucfirst($fct[$a]);
MW>   $a++;
MW> }
MW> mysql_free_result($result);

MW> ob_start();

MW> for($b = 0; $b < sizeof($fct); $b++){
MW>   if($_SERVER["PHP_SELF"] == $page[$b])
MW> eval('${"content".$fct}[$b]();');
MW> }

MW> ...

MW> The "pagename" in the database is stored like /about.php so I change
MW> it to About in the while-loop.

MW> The eval method is there to replace my actual code (which is static):
MW> if($_SERVER["PHP_SELF"] == "/login.php")
MW>   contentLogin();
MW> if($_SERVER["PHP_SELF"] == "/logout.php")
MW>   contentLogout();

MW> ...

MW> Using the "if-cascade", it is working, for you to know that the
MW> mistake is definitly in the eval()-method...

MW> Thx for your time...

MW> SvT


MW> -- 
MW> Who is the ennemy?

MW> mailto:[EMAIL PROTECTED]



Ok we have to do it in 2 steps like this:

eval('$fn="content".$fct[$b];$fn();');

-- 
regards,
Tom


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



[PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Hi List,

is there a way (mybe in php5?) to define/declare a global var as a 
superglobal, so that I can use this var like the known superglobals
($_GET, $_SESSION, etc.) ???

If not, is there a list for "feature requests"?

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


Re: [PHP] how to do this

2003-08-23 Thread Ray Hunter
Sessions, cookies or thru the get request

--
BigDog

On Sat, 2003-08-23 at 02:21, macromaniac wrote:
> well,
> i have to php pages and i want to send one argument from one to another.  I
> tried a few things but I couldn't do it.
> 
> is there a special way to do it?
> 
> 


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



Re: [PHP] user-defined superglobals?

2003-08-23 Thread Ray Hunter
you can define your own superglobals by defining the vars first then
accessing them thru the $GLOBALS var.

example:





That should get you started with globals.

--
BigDog


On Sat, 2003-08-23 at 11:45, Matthias Nothhaft wrote:
> Hi List,
> 
> is there a way (mybe in php5?) to define/declare a global var as a 
> superglobal, so that I can use this var like the known superglobals
> ($_GET, $_SESSION, etc.) ???
> 
> If not, is there a list for "feature requests"?
> 
> 
> Regards,
> Matthias
> 


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



Re: [PHP] Help with a script

2003-08-23 Thread Stevie D Peele
Heres the source of the page where I initially enter the data -

-
-



MyPHP Site News v1.0




Your Alias:




Date:
 Ex) 2003-08-19



Your News:Enter as much
text as you would like here










PHP Site News developed
by Stevie Peele

-
-
On Sat, 23 Aug 2003 08:18:19 -0700 "Jim Lucas" <[EMAIL PROTECTED]>
writes:
> what is the source for the page that you initially enter the data on 
> the web
> form look like?
> 
> Jim Lucas
> - Original Message - 
> From: "Stevie D Peele" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 23, 2003 6:25 AM
> Subject: [PHP] Help with a script
> 
> 
> > I've been working on a script for quite some time now, particulary 
> a site
> > news script. Heres how it works
> >
> > 1. Information is passed from a form to the database
> > 2. Table is selected to a page to be viewed by the general 
> public.
> >
> > The problem is, when I use the form, there are no errors in the 
> script,
> > but nothing is entered into the database.
> >
> > Here are my scripts
> > The
> > Query
> > CREATE TABLE SiteNews
> > (
> > Alias varchar(50) NOT NULL default '0',
> > News BLOB NOT NULL,
> > NewsDate Date NOT NULL
> > ) TYPE=MyISAM
> > 
>
-
> > -
> >
> > form
> > action
> >  > include ('config.php');
> > $link = @mysql_pconnect($location, $username, $password)
> >   or die("Could not connect to the databaseserver. Please go 
> back and
> > try again or try again later.");
> > @mysql_select_db($database, $link)
> >   or die ("Could not select database. Please go back and try 
> again or
> > try again later.");
> > $sql_insert = "INSERT INTO SiteNews ('Alias','News','NewsDate')
> > VALUES ('". addslashes($_POST['newsperson']) . "','" .  
> $_POST['date']  .
> > "','" .  addslashes($_POST['thenews']) . "')";
> >
> > $result = mysql_query($sql_insert, $link);
> > echo (mysql_affected_rows($link) . " News entry inserted");
> > ?>
> > 
>
-
> > -
> >
> > Viewing the news
> > script---
> >  > include ('config.php');
> > $link = @mysql_pconnect($location, $username, $password)
> >  or die("Could not connect to the databaseserver. Please go 
> back and
> > try again or try again later.");
> > @mysql_select_db($database,$link)
> >  or die ("Could not select database. Please go back and try 
> again or
> > try again later.");
> > $sql = "SELECT Alias, NewsDate, News FROM SiteNews ORDER BY 
> NewsDate
> > DESC";
> > $news = mysql_query($sql,$link) or 
> die(mysql_error().''.$sql.'');
> >
> > if ($news){
> >if (mysql_num_rows($news)== 0){
> >  echo ("No newsitems found.");
> >}
> >else{
> >  while ($row = mysql_fetch_assoc($news)){
> >   echo("");
> >   echo($row['Alias']. "");
> >   echo($row['NewsDate']."");
> >   echo($row['News']);
> >   echo("");
> >   echo("");
> > }
> >   }
> > }
> > else{
> >echo("Queryproblem");
> > }
> >
> >  ?>
> > 
>
-
> > -
> >
> > Can anyone see what is wrong??
> >
> > Thanks
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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



php-general Digest 23 Aug 2003 18:07:47 -0000 Issue 2254

2003-08-23 Thread php-general-digest-help

php-general Digest 23 Aug 2003 18:07:47 - Issue 2254

Topics (messages 160483 through 160517):

Status Chaing Toggle / Code
160483 by: Tony Pagliocco
160492 by: Robert Cummings

Re: Making a cookie never expire
160484 by: Joe Pemberton

Re: auto_prepend_file
160485 by: Peter James

Re: google style paginating
160486 by: Mika Tuupola
160487 by: Haseeb

Re: Clean Up the sand box time
160488 by: Nicholas Robinson

Re: text area question
160489 by: Marek Kilimajer

Re: need help figuring out how to delete rows?
160490 by: Marek Kilimajer
160491 by: Marek Kilimajer

Re: Access denied problem, please help
160493 by: Ryan A
160505 by: Jim Lucas

Uploading problem = weird warning (was: access denied problem.)
160494 by: Ryan A

2 questions
160495 by: Thomas Hochstetter
160497 by: Binay Agarwal

Re: eval function
160496 by: Matthias Wulkow
160508 by: Tom Rogers
160509 by: Matthias Wulkow
160511 by: Matthias Wulkow
160513 by: Tom Rogers

Random selection
160498 by: fkeessen.planet.nl
160501 by: David Otton
160502 by: Binay Agarwal
160503 by: fkeessen.planet.nl
160506 by: Jim Lucas

Help with a script
160499 by: Stevie D Peele
160507 by: Jim Lucas
160517 by: Stevie D Peele

Re: I wish I knew more about multi-dimensional arrays
160500 by: Verdon vaillancourt

Shell connect
160504 by: Dennis Dujan - Partycult.de

Re: Easy XML & PHP tutorials ?
160510 by: Noivad

how to do this
160512 by: macromaniac
160515 by: Ray Hunter

user-defined superglobals?
160514 by: Matthias Nothhaft
160516 by: Ray Hunter

Administrivia:

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

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

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


--
--- Begin Message ---
Ok , I am slightly confused at the moment, maybe someone can shed me some
light about the situation.

I have a php page that pulls a query of all students in a table that have
fit a criteria, in this case, where
the field, named "web", is set to Y

So when you open the page, all people with Y = web , are spit out into a
table.

Name - Address - Printed..

-
Example:

Joe Smith - 5 Smith Road - Not Printed
Randy bob - 4 Joe Road - Not Printed

--- 

Now when the query outputs, I can click on the "Not Printed" link and it
should
update the persons row to change the vaule of the field named Printed from N
to Y.

Then when I referesh the page, it should look the same but instead of it
saying 
"Not Printed" it should say "Printed" next to the persons row.

So based on the above example, if we were to click on Joe Smith's "Not
Printed" link,
if we were to pull the page up later, it would now show "Printed"

We want to have a list of all students who have Y = Web but also at the same
time
monitor who we have pritned info on and who we dont, hence the reason for
the toggle.

I've included the code below to the function, my update looks correct but
when I'm coming 
back to the query page, its not changing the status of the "Not Printed" ,
so even 
if Printed is Y now in the field, it still says Not Pritned.

Any ideas? TIA everone


dbname = "ipo_students";

db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
$qid = db_query("SELECT printed FROM outgoing_student
 WHERE id=$student_id");
$row = mysql_fetch_array($qid);
$printed = $row['printed'];

echo "current value of printed is $printed";
if ($printed == 'n' || $printed == 'N' || empty($printed)) {
  $newvalue = "Y";
} else {
  $newvalue = "N";
}

db_query("UPDATE outgoing_student SET printed='$newvalue' WHERE
  id='$student_id'");

echo "Go to previous page and refresh";


?>



Tony Pagliocco
Systems Administrator
Arizona State University
International Programs Office
Phone: (480) 727-6279
Email: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Code and query look about right -- my guess is you're another one of the
multitude of people who haven't bothered to read the docs about register
globals and how they are now off by default. If the following solves
your problem, then yes indeed, such are you.

include("../../application2.php");
$CFG->dbname = "ipo_students";

//
// $student_id probably came in from $_GET or $_POST.
//
$student_id
= isset( $_GET['student_id'] )
? $_GET['student_id']
: (isset( $_POST['student_id'] )
? $_POST['student_id']
: null;

if( is_null( $student_id ) )
{
echo 'You have some other problem!'."\n";
}

db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
$qid = db_query("SELECT printed FROM outgoing_student
 WHERE id=$student_id");

Cheers,
Ro

[PHP] Expiration time of a cookie

2003-08-23 Thread Stevie D Peele
What is the longest expiration time of a cookie?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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



Re: [PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Hi Ray Hunter, you wrote:
you can define your own superglobals by defining the vars first then
accessing them thru the $GLOBALS var.
example:



function test() {
  echo $GLOBALS['var1'];
  echo $GLOBALS['var2'];
  echo "Test\n"
}
test();

?>

That should get you started with globals.

Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
Regards,
Matthias

--
BigDog
On Sat, 2003-08-23 at 11:45, Matthias Nothhaft wrote:

Hi List,

is there a way (mybe in php5?) to define/declare a global var as a 
superglobal, so that I can use this var like the known superglobals
($_GET, $_SESSION, etc.) ???

If not, is there a list for "feature requests"?

Regards,
Matthias





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


[PHP] Need help om screen display error

2003-08-23 Thread Gloria L. McMillan
Hi, all!

I have a working database at:
http://dakotacom.net/~glomc/forms/CAT.html

It does send info to the database, but only shows   "["  at the upper left of screen
when it is supposed to print to screen.

Could somebody help me find what is wrong in my .php file?  Thanks,

Gloria



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



[PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hi ,

I try to upload a file with such an input type = 'file' field.
My form looks like:

echo "\n"; 

...

echo "\n"; 

...

echo "\n";

echo "\n";

After submition, I can't find the file on the server. Nowhere.
In php.ini, I have /tmp as upload-directory.

I'm using apache2 on linux.

Can somebody tell me why the file is not uploaded?

Thx for answering

SvT


-- 
Who is the ennemy?


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



Re: [PHP] user-defined superglobals?

2003-08-23 Thread Tom Rogers
Hi,

Sunday, August 24, 2003, 3:45:33 AM, you wrote:
MN> Hi List,

MN> is there a way (mybe in php5?) to define/declare a global var as a 
MN> superglobal, so that I can use this var like the known superglobals
MN> ($_GET, $_SESSION, etc.) ???

MN> If not, is there a list for "feature requests"?


MN> Regards,
MN> Matthias

You can always add to one of the superglobals, remembering not to have
a name clash with get or post variables.

$_GET['test'] = 'Hi";

now that will be available in all functions.

-- 
regards,
Tom


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



[PHP] sdfdsafasdf

2003-08-23 Thread macromaniac
sdfsdf



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



Re: [PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like

declare_superglobal($_MYFRAMEWORK);

And then use $_MYFRAMEWORK like $_GET.

Thanks nevertheless.

Regards,
Matthias
Ray Hunter wrote:
Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!


Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.

Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...


There are implementations of this all thru PEAR.

--
BigDog




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


RE: [PHP] Easy XML & PHP tutorials ?????

2003-08-23 Thread Boaz Yahav
Try this too : http://www.sitepoint.com/article/1165

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: Joe Harman [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy XML & PHP tutorials ?


Hello all. does anyone have any very easy XML tutorials . I have a
simple weather feed I want to implement. but no XML experience

thanks

Joe Harman




 


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



RE: [PHP] google style paginating

2003-08-23 Thread Boaz Yahav
Try this :

Paginator - a class that can help you to split MySQL database query result sets to 
pages.
http://www.weberdev.com/get_example.php3?count=3707

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: Ted Conn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 21, 2003 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] google style paginating


Hi I am new to this newsgroup and I plan on replying to all the posts I can for now... 
but Id like to start out by asking a question. I am trying to paginate my sql results 
in 10 by 10, which I have been able to do no problem. but what I want to do is have 
the pages layed out in google style with (1)(2)(3)(4) etc etc and each one is 
clickeable that will take you to that page. I'll show you the code I am using now for 
next and back buttons...



//located at top of page


//start of body, this verifies that so is numeric, divisible by 10, and a valid number 
 $num_rows) || ($_GET['so'] < 0) )
  $so='0';
 else
 {
  if ($_GET['so'] % 10)
   $so='0';
  else
   $so=$_GET['so'];
 }
}
else
 $so='0';
?>

//return results



// next and back buttons

=10)
  {
  $sortback= $so-10;
  echo "<< 
Atras" ;
  }
  ?>
 0 )
  echo "  Siguiente >> ";
   ?>


DID I PUT WAY TO MUCH CODE?? Sorry, and I apreciate your help.

How can I implement the google style paging into this code?

Thank you...




Ted Conn Lider de Proyectos [EMAIL PROTECTED] Scinet México S.A. de C.V.
+52 (222) 294-05-95 al 97 Sin costo: 01-8000-DOTCOM Puebla · DF · 
+Monterrey
www.scinet.com.mx



-- 
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] Expiration time of a cookie

2003-08-23 Thread Matthias Nothhaft
Stevie D Peele wrote:
What is the longest expiration time of a cookie?

Hm, good question ;-)
A day has 86400 seconds.
Multiply it by 'enough' days (eg 365) and always refresh
your cookie's expiration. This might solve your problem.
Regards,
Matthias

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!


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


Re: [PHP] user-defined superglobals?

2003-08-23 Thread Jim Lucas
I have been wanting the same thing, but I too have not found a solution, and
do not know if it will come around.

Being able to create your own super-global would be a very nice feature.

Jim Lucas
- Original Message - 
From: "Matthias Nothhaft" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 11:44 AM
Subject: Re: [PHP] user-defined superglobals?


> Sorry this all is not what I'm looking for.
> I see it is not possible at the moment.
>
> It would be nice to have a php-function like
>
> declare_superglobal($_MYFRAMEWORK);
>
> And then use $_MYFRAMEWORK like $_GET.
>
> Thanks nevertheless.
>
> Regards,
> Matthias
>
> Ray Hunter wrote:
> >>Well, this is clear, (I'm only new in the list - not in PHP ;-) )
> >>but I want it in a better/shorter way
> >>for the "master var" of a big project!
> >
> >
> > Yes you can set up a master file that includes all your master
> > vars...many php developers call this a configuration script and name it
> > config.php.
> >
> > This allows users to set up global variables that are used through out
> > the application.
> >
> >
> >>Is there a way to request such a feature and where?
> >>I think this would be nice for application frameworks!?
> >>Maybe also for PEAR...
> >
> >
> > There are implementations of this all thru PEAR.
> >
> > --
> > BigDog
> >
> >
> >
>
>
>
> -- 
> 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] file upload problem

2003-08-23 Thread Jim Lucas
when you are uploading files via a form, you must use the POST method.

Jim Lucas
- Original Message - 
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 11:16 AM
Subject: [PHP] file upload problem


> Hi ,
> 
> I try to upload a file with such an input type = 'file' field.
> My form looks like:
> 
> echo " = 'multipart/form-data'>\n"; 
> 
> ...
> 
> echo " accept='text/*'>\n"; 
> 
> ...
> 
> echo " 'ändern'>\n";
> 
> echo "\n";
> 
> After submition, I can't find the file on the server. Nowhere.
> In php.ini, I have /tmp as upload-directory.
> 
> I'm using apache2 on linux.
> 
> Can somebody tell me why the file is not uploaded?
> 
> Thx for answering
> 
> SvT
> 
> 
> -- 
> Who is the ennemy?
> 
> 
> -- 
> 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] timing a session

2003-08-23 Thread Damian Brown
Hi,

i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time

Regards,
Damian
www.phpexpert.org
UK FREEphone 0800 019 0924

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



RE: [PHP] 2 questions

2003-08-23 Thread Thomas Hochstetter
The register globals is on with the live server, and off at home (my version
is 4.3.2, the other is 4.1.2). does that matter?
Thanks for the other tip, shall try that ...

Thomas

- Original Message -
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 5:33 PM
Subject: [PHP] 2 questions


> Hi guys.
>
> I have two questions for you today:
>
> 1. Weired login problem
> I am developinig a site for a conference where i have a login page for
> members. This page is called index.php and includes different types of
modules,
> according to the type of user logged on. The problem is now following:
> i have a login function hidden in a class, this function registers a bunch
> of variables. After the user has submited the details, index.php (which
calls
> the session_start()) calls the login function. Then i check whether a
session
> variable is present ($_SESSION['name']). If yes, we include the members
> area, otherwise we include the login table again. Now: on my test server
> (XP/Apache/php4.3.2) all is well. However, on the real server
(Linux/Apache/php4.0.x)
> it just includes the login table anyway, even if the login was successful.
I
> then have to click on the menu link again to include the member script.
> Why is that?

Check your register_globals setting in both ur test server and real server
and let me know.

>
> 2. Save a large amount of text to a file
> On the same page i have some type of cms going. The admin users can change
> txt files which relate to text on some of the general pages. I have now
found
> that it is only transmits a certain amount of text via GET to the function
> that writs to the files. Is there a restriction on passing text via url?
If yes
> (which will be the case), how could i do this otherwise?

Use POST instead of GET method... POST method allows u to even extend the
size of data being posted.

Hope this helps...

>
> Thanks so long...
>
> Thomas
> P.S: this list still rocks
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post

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



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:

JL> when you are uploading files via a form, you must use the POST method.

well, I tried the example from 
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
and that doesn't work neither... no files are uploaded...


SvT

PS: In between I tried with POST and no success



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] PHP connection

2003-08-23 Thread Dennis Dujan - Partycult.de
I want to connect with my PHP - script to a shell that is located on another
Server.
Is there a command to connect via a PHP script to the shell? Perhaps over
IP…

It would be very nice if you can help me because
I don´t know how to do it

With best regards
Dennis Dujan


Re: [PHP] file upload problem

2003-08-23 Thread Jim Lucas
- Original Message - 
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jim Lucas" <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 12:27 PM
Subject: Re: [PHP] file upload problem


> Hallo Jim,
>
> am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:
>
> JL> when you are uploading files via a form, you must use the POST method.
>
> well, I tried the example from
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
> and that doesn't work neither... no files are uploaded...
>
>
> SvT
>
> PS: In between I tried with POST and no success
>
>
>
> -- 
> Who is the ennemy?
>
> mailto:[EMAIL PROTECTED]
>
>

how are you checking to see if the files are getting uploaded?

Jim Lucas

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



Re: [PHP] timing a session

2003-08-23 Thread Matthias Nothhaft
Damian Brown wrote:
Hi,

i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time
There is no way to get this exactly!

You cannot record the time a user
is really reading a single page.
It has to do something with the http protocol
being 'connectionless'!
I heared/read that there's a standard
of the 'advertisment-industry' saying
that a visit ends after 30 minutes after
the last (session-)request.
(A bad method if you really must have this
very exact is to do a short http-refresh,
eg every minute.)
I also think, this is no php problem
but a common problem of the http protocol
which wasn't designed to hold a connection
over a user's session - that's why session
management had to be invented ;-)
Regards,
Matthias

Regards,
Damian
www.phpexpert.org
UK FREEphone 0800 019 0924
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] timing a session

2003-08-23 Thread John W. Holmes
Damian Brown wrote:

i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time
There's really no way to do this, only ways to estimate the time.

Assign each user a unique id (session_id or a username) and record the 
time during each request. After there are no more requests for X minutes 
(your choice), then consider the session terminated.

If you are using session, one possibility may be to use your own handler 
and write a garbage collection routine that records the "age" of the 
session file as it's cleaned up. You can consider the age of the session 
file as the time that the user was on your site.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com



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


Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:


JL> how are you checking to see if the files are getting uploaded?

JL> Jim Lucas


I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.

SvT



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] Re: file upload problem

2003-08-23 Thread Catalin Trifu
Hi,

> echo " = 'multipart/form-data'>\n";
I think that the methos should be POST not GET
Second, you may want to save the file first with,
move_uploaded_file (see
http://de.php.net/manual/en/function.move-uploaded-file.php),
then you will be able to see it.
Of course you will first check it's in order to save it.
Third: it might be a good idea to check your php.ini and
see if you allow file uploads and also the httpd.conf

cheers,
Catalin

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



Re: [PHP] file upload problem

2003-08-23 Thread Jim Lucas
ok.  the key here then is that php is going to erase the uploaded file after
the script has finished processing.

What you have to do is move the file to a different location before the
script ends.

This is the normal behavor for PHP.

More then likely the file is getting transmitted to the server, but when the
script ends php automatically does some cleanup and erases any leftover
files.  Since you didn't move the file, it thinks that it is leftover and
just erases it.

Try moving the file or renaming it in some mannor and you will notice that
the file stays on the server even after the script ends.

Jim Lucas
- Original Message - 
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jim Lucas" <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 12:43 PM
Subject: Re: [PHP] file upload problem


> Hallo Jim,
>
> am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:
>
>
> JL> how are you checking to see if the files are getting uploaded?
>
> JL> Jim Lucas
>
>
> I'm looking in /tmp for new files... but there are none. I'm also
> looking in the Apache-RootDirectory. No files neither.
>
> SvT
>
>
>
> -- 
> Who is the ennemy?
>
> mailto:[EMAIL PROTECTED]
>
> -- 
> 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] file upload problem

2003-08-23 Thread Matthias Nothhaft
Did you get any error (displayed/logged) ?

Test it like that:

print_r($_FILES) // with php < 4.1 use $HTTP_POST_FILES

Now you can find your file at ...['tmp_name']

See also the php manual ;-)

Regards,
Matthias
Matthias Wulkow wrote:
Hallo Jim,

am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:

JL> how are you checking to see if the files are getting uploaded?

JL> Jim Lucas

I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.
SvT



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


[PHP] loading extension in script

2003-08-23 Thread andu
Ok, I learned I can load extensions in script using ld(), is there a way
to load extensions from a different directory (i.e.$HOME) in a
case where I don't have access to /php/extensions/?

-- 
Regards, Andu Novac

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



[PHP] Re: Need help on screen display error

2003-08-23 Thread Gloria L. McMillan
I see a couple have tried my poll.

Please ask and I will send that php file...

Gloria


"Gloria L. McMillan" wrote:

> Hi, all!
>
> I have a working database at:
> http://dakotacom.net/~glomc/forms/CAT.html
>
> It does send info to the database, but only shows   "["  at the upper left of screen
> when it is supposed to print to screen.
>
> Could somebody help me find what is wrong in my .php file?  Thanks,
>
> Gloria

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



Re: [PHP] Problem with the post variables.

2003-08-23 Thread chris
On Mon, 18 Aug 2003 18:35:09 +0200, Wouter Van Vliet <[EMAIL PROTECTED]> 
wrote:

The problem is probably in the 'enctype="multipart/form-data"'. You 
should
only use this enctype if you're gonna upload a file through the form. If
not, just leave it away or use text/plain

Wouter
Why would that be the problem?  Regardless of the enctype, it should still 
create POST/GET data for whatever else was in the form.  Yes, 
multipart/form-data *should* only be used if they are uploading a file.  
That doesn't mean PHP should ignore additional POST/GET data from the 
form, which it has had a history of doing, depending on which way the wind 
blows or the price of tea in China.

-Oorspronkelijk bericht-
Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
Verzonden: maandag 18 augustus 2003 16:04
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Problem with the post variables.
Guys I have a problem here.
I'm using PHP 4.3.2 and httpd 1.3.28.
Look my exemple.
I have a page whith a Form method post, and I submit this page to
teste2.php, but I dont can request de data from the text box...
###
This is the test page








#
Teste2.php
";
echo "Var em get: ".$_GET['texto']."";
//phpinfo();
?>

Some one can help me...???

Klaus Kaiser Apolinário
Curitiba online



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem with the post variables.

2003-08-23 Thread Jim Lucas
You  need to take a second look at the way you are refering to the
varialbles in the process page.

You are using the POST method in the method='POST' in the form, but on the
process page you are refering to it via $_GET['...']  change this to
$_POST['...'] and you should be fine.

Jim Lucas
- Original Message - 
From: "chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 1:34 PM
Subject: Re: [PHP] Problem with the post variables.


> On Mon, 18 Aug 2003 18:35:09 +0200, Wouter Van Vliet <[EMAIL PROTECTED]>
> wrote:
>
> > The problem is probably in the 'enctype="multipart/form-data"'. You
> > should
> > only use this enctype if you're gonna upload a file through the form. If
> > not, just leave it away or use text/plain
> >
> > Wouter
>
> Why would that be the problem?  Regardless of the enctype, it should still
> create POST/GET data for whatever else was in the form.  Yes,
> multipart/form-data *should* only be used if they are uploading a file.
> That doesn't mean PHP should ignore additional POST/GET data from the
> form, which it has had a history of doing, depending on which way the wind
> blows or the price of tea in China.
>
> > -Oorspronkelijk bericht-
> > Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
> > Verzonden: maandag 18 augustus 2003 16:04
> > Aan: [EMAIL PROTECTED]
> > Onderwerp: [PHP] Problem with the post variables.
> >
> >
> > Guys I have a problem here.
> > I'm using PHP 4.3.2 and httpd 1.3.28.
> > Look my exemple.
> > I have a page whith a Form method post, and I submit this page to
> > teste2.php, but I dont can request de data from the text box...
> >
> >
> > ###
> > This is the test page
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > #
> > Teste2.php
> >
> >  > $string = $_POST['texto'];
> > echo "Var em post: ".$string."";
> > echo "Var em get: ".$_GET['texto']."";
> >
> >
> > //phpinfo();
> > ?>
> > 
> >
> > Some one can help me...???
> >
> > Klaus Kaiser Apolinário
> > Curitiba online
> >
> >
>
>
>
> -- 
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> -- 
> 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] Tips on print to screen debugging

2003-08-23 Thread Gloria L. McMillan
I have always had problems in cutting and pasting new forms off old ones.
Often the problem is in the communication that makes the form allow repliers
to view results on screen.  This is good to do with opinion polls to start
discussions.

I have a *terrible* time locating the source of the error.

Do experienced .php users have a method for finding errors in the print
to screen?

I will send the culprit .php file to anybody who is willing to look it over.

Thanks,

Gloria McMillan

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



Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread John W. Holmes
Gloria L. McMillan wrote:

I have always had problems in cutting and pasting new forms off old ones.
Often the problem is in the communication that makes the form allow repliers
to view results on screen.  This is good to do with opinion polls to start
discussions.
I have a *terrible* time locating the source of the error.

Do experienced .php users have a method for finding errors in the print
to screen?
I will send the culprit .php file to anybody who is willing to look it over.
This is a pretty vague question. Provide some more detail as to the 
exact problem that you're having, post a bit of the relavant file, and 
the exact error message. :)

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread Gloria L. McMillan
Here is the URL of the poll form.
http://dakotacom.net/~glomc/forms/CAT.html

When you do this poll it immiediately attempts to print to screen.
There's also a "VIEW RESPONSES" button so ppl don't have to
answer the poll to view reponses.  You can see now that there
is just a little jumble of letters at upper left of the screen.

Something is wrong in the .php file.

One member of this group gave a working routine to me to
choose among three select calls for the display.  Maybe that has
been corrupted by losing a letter or something.  I cut and paste
new forms off the old.

I am willing to send the .php file backchannel.  I have deleted the personal
addresses from it.
Thanks,

Gloria

"John W. Holmes" wrote:

> Gloria L. McMillan wrote:
>
> > I have always had problems in cutting and pasting new forms off old ones.
> > Often the problem is in the communication that makes the form allow repliers
> > to view results on screen.  This is good to do with opinion polls to start
> > discussions.
> >
> > I have a *terrible* time locating the source of the error.
> >
> > Do experienced .php users have a method for finding errors in the print
> > to screen?
> >
> > I will send the culprit .php file to anybody who is willing to look it over.
>
> This is a pretty vague question. Provide some more detail as to the
> exact problem that you're having, post a bit of the relavant file, and
> the exact error message. :)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com

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



Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread Gloria L. McMillan
One other thing I noticed:

If you click source code, you get the input replies and the formatting.
None of it shows on screen where I want it, though.

Gloria


"Gloria L. McMillan" wrote:

> Here is the URL of the poll form.
> http://dakotacom.net/~glomc/forms/CAT.html
>
> When you do this poll it immiediately attempts to print to screen.
> There's also a "VIEW RESPONSES" button so ppl don't have to
> answer the poll to view reponses.  You can see now that there
> is just a little jumble of letters at upper left of the screen.
>
> Something is wrong in the .php file.
>
> One member of this group gave a working routine to me to
> choose among three select calls for the display.  Maybe that has
> been corrupted by losing a letter or something.  I cut and paste
> new forms off the old.
>
> I am willing to send the .php file backchannel.  I have deleted the personal
> addresses from it.
> Thanks,
>
> Gloria
>
> "John W. Holmes" wrote:
>
> > Gloria L. McMillan wrote:
> >
> > > I have always had problems in cutting and pasting new forms off old ones.
> > > Often the problem is in the communication that makes the form allow repliers
> > > to view results on screen.  This is good to do with opinion polls to start
> > > discussions.
> > >
> > > I have a *terrible* time locating the source of the error.
> > >
> > > Do experienced .php users have a method for finding errors in the print
> > > to screen?
> > >
> > > I will send the culprit .php file to anybody who is willing to look it over.
> >
> > This is a pretty vague question. Provide some more detail as to the
> > exact problem that you're having, post a bit of the relavant file, and
> > the exact error message. :)
> >
> > --
> > ---John Holmes...
> >
> > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> >
> > PHP|Architect: A magazine for PHP Professionals – www.phparch.com

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



Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread John W. Holmes
Gloria L. McMillan wrote:

Here is the URL of the poll form.
http://dakotacom.net/~glomc/forms/CAT.html
When you do this poll it immiediately attempts to print to screen.
There's also a "VIEW RESPONSES" button so ppl don't have to
answer the poll to view reponses.  You can see now that there
is just a little jumble of letters at upper left of the screen.
I don't see this. Everything appears fine in Mozilla when I supply 
answers or if I just click on "view responses"...

Something is wrong in the .php file.
Or poor HTML that is not formatting correctly?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] user-defined superglobals?

2003-08-23 Thread Curt Zirzow
* Thus wrote Matthias Nothhaft ([EMAIL PROTECTED]):
> Hi List,
> 
> is there a way (mybe in php5?) to define/declare a global var as a 
> superglobal, so that I can use this var like the known superglobals
> ($_GET, $_SESSION, etc.) ???
> 
> If not, is there a list for "feature requests"?

You can request features at bugs.php.net. there is a type of bug
called 'Feature/Change Request'.  

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] user-defined superglobals?

2003-08-23 Thread Jason Sheets
Someone wrote a php module that did this around 6 to 9 months ago.  It 
was easy to install but you needed access to php.ini.

Try using extract with the option to use references so you don't create 
a copy of the variable just a pointer to it.

Jason

Matthias Nothhaft wrote:

Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like

declare_superglobal($_MYFRAMEWORK);

And then use $_MYFRAMEWORK like $_GET.

Thanks nevertheless.

Regards,
Matthias
Ray Hunter wrote:

Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!


Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.

Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...


There are implementations of this all thru PEAR.

--
BigDog





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


Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread Jim Lucas
it is your  tag.  You are missing the closing '>' on the openning
title tag.

Fix that and see what happens

Jim Lucas
- Original Message - 
From: "Gloria L. McMillan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 2:00 PM
Subject: Re: [PHP] Tips on print to screen debugging


> Here is the URL of the poll form.
> http://dakotacom.net/~glomc/forms/CAT.html
>
> When you do this poll it immiediately attempts to print to screen.
> There's also a "VIEW RESPONSES" button so ppl don't have to
> answer the poll to view reponses.  You can see now that there
> is just a little jumble of letters at upper left of the screen.
>
> Something is wrong in the .php file.
>
> One member of this group gave a working routine to me to
> choose among three select calls for the display.  Maybe that has
> been corrupted by losing a letter or something.  I cut and paste
> new forms off the old.
>
> I am willing to send the .php file backchannel.  I have deleted the
personal
> addresses from it.
> Thanks,
>
> Gloria
>
> "John W. Holmes" wrote:
>
> > Gloria L. McMillan wrote:
> >
> > > I have always had problems in cutting and pasting new forms off old
ones.
> > > Often the problem is in the communication that makes the form allow
repliers
> > > to view results on screen.  This is good to do with opinion polls to
start
> > > discussions.
> > >
> > > I have a *terrible* time locating the source of the error.
> > >
> > > Do experienced .php users have a method for finding errors in the
print
> > > to screen?
> > >
> > > I will send the culprit .php file to anybody who is willing to look it
over.
> >
> > This is a pretty vague question. Provide some more detail as to the
> > exact problem that you're having, post a bit of the relavant file, and
> > the exact error message. :)
> >
> > --
> > ---John Holmes...
> >
> > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> >
> > PHP|Architect: A magazine for PHP Professionals - www.phparch.com
>
> -- 
> 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] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Hi Jason Sheets, you wrote:
Someone wrote a php module that did this around 6 to 9 months ago.  It 
was easy to install but you needed access to php.ini.
Do you know where to get/download this module?

Regards,
Matthias
Try using extract with the option to use references so you don't create 
a copy of the variable just a pointer to it.

Jason

Matthias Nothhaft wrote:

Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like

declare_superglobal($_MYFRAMEWORK);

And then use $_MYFRAMEWORK like $_GET.

Thanks nevertheless.

Regards,
Matthias
Ray Hunter wrote:

Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!




Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.

Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...




There are implementations of this all thru PEAR.

--
BigDog








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