Re: [PHP] Removing empty elements from an array

2002-04-28 Thread eric.coleman

function filter($array)
{
if ( !is_array($array) )
{
die(Must be an array!);
}
foreach($array as $key = $value)
{
if($array[$key] == )
{
unset($array[$key]);
}
}
return($array);
}
- Original Message -
From: Craig Westerman [EMAIL PROTECTED]
To: php-general-list [EMAIL PROTECTED]
Sent: Sunday, April 28, 2002 10:36 AM
Subject: [PHP] Removing empty elements from an array


 I have an array that contains several empty elements. What is simplest way
 to remove these elements?

 Array ( [0] = [1] =
 [2] =
 [3] = 16/Mar/02
 [4] =
 [5] = 17/Mar/02
 [6] = 18/Mar/02
 [7] = 19/Mar/02
 [8] = 20/Mar/02
 [9] = 21/Mar/02
 [10] = 22/Mar/02
 [11] = 23/Mar/02
 [12] =
 [13] = 24/Mar/02
 [14] = 25/Mar/02
 [15] =)

 Thanks

 Craig 
 [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] Sessions and Query String Variable Handling

2002-04-27 Thread eric.coleman

You can also use

$page = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

- Original Message - 
From: John Holmes [EMAIL PROTECTED]
To: 'Dennis Moore' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, April 27, 2002 8:49 PM
Subject: RE: [PHP] Sessions and Query String Variable Handling


 $page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] .
 $_SERVER[QUERY_STRING];
  
 That will recreate the URL that the user clicked on. Save that to a
 variable before you check for a session. Once you start a session or
 verify that one exists, use header() to send them back to that page. 
  
 ---John Holmes.
  
 -Original Message-
 From: Dennis Moore [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, April 27, 2002 2:37 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Sessions and Query String Variable Handling
  
 Env:  Apache 1.3.x/php4.0.6/mysql3.23.x
  
 Scenario:  I have built a system that uses PHP sessions for user access.
 Within the system I send user notifications via email.   Within the
 email are links to certain pages with variables.  For example.
  
 http://mysite.com/view_page.htm?id=6
  
 My system checks to see if the session is valid.  Since the user is
 coming from an email.  There is no session.  So the user is prompted for
 the user and password.  They enter and click submit.  The authentication
 passes the user to right page, but losses the variables in the query
 string.  Thus causing errors.
  
 Here is the authentication code...
  set session settings from login form
 if (!session_is_registered(valid_user)  $session_login==proc) {
  if ($userid  $password) {
 // if the user has just tried to log in
  
 $db_conn = mysql_connect(localhost);
 mysql_select_db($dbname, $db_conn);
 $query = select * from auth_users 
.where auth_username='$userid' 
. and auth_password='$password' ;
 $result = mysql_query($query, $db_conn);
 if (mysql_num_rows($result) 0 ) {
   // if they are in the database register the user id
   $valid_user = $userid;
   $valid_group=mysql_result($result,0,auth_group);
$valid_perms=mysql_result($result,0,auth_perms);
$valid_auth_id=mysql_result($result,0,auth_id);
   session_register(valid_user);
session_register(valid_group);
session_register(valid_perms);
session_register(valid_auth_id);
 } else {
$invalid_login= Invalid login:  Could not log you in...
!--ERROR: $dbname P $query--;
   }
  }
 }
  
 Any Ideas on how to pass the query string variables through the
 authentication process?  
 


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




Re: [PHP] php+myslq+IDE

2002-04-05 Thread eric.coleman

http://dev.zaireweb.com/phpcoder.exe

That should be the file
- Original Message - 
From: Charles Little [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 04, 2002 4:59 AM
Subject: RE: [PHP] php+myslq+IDE


  Try PHP Coder (not Maguma's Version, becuase PHP Coder kicks it's ass)
  
  I can email you the installed, as there site seems to be down now..
  
 Could you e-mail it to me, also?
 
 
 


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




Re: [PHP] odbc_pconnect doesnt reuse connection

2002-04-03 Thread eric.coleman

Why won't you just use odbc_connect ?
- Original Message -
From: Maris Kalnins [EMAIL PROTECTED]
To: 
Sent: Wednesday, April 03, 2002 3:07 AM
Subject: [PHP] odbc_pconnect doesnt reuse connection


 Hi!

 Configuration: WinXP, the latest Apache, PHP4

 The problem is that every time the script runs and the following command
is
 executed
 $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
 it happens very often that a new connection is created instead of reusing
 the old one!

 Is there any idea what's wrong... ?

 And another question - when user hits reload or submit button at the
moment
 when
 actually this odbc_pconnect is in progress - it generates another
connection
 leaving the old one
 (half opened or whatever) still alive..

 So if you will click on submit button more than 10 times with a little
short
 interval -
 we will get ODBC error - Database server connection limit exceeded

 I tried to set in PHP config file
 odbc.max_persistent = 1

 but it still overgoes more than 1 connection to the same database, user
and
 password..

 What's  wrong?







 --
 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] odbc_pconnect doesnt reuse connection

2002-04-03 Thread eric.coleman

I have an IDEA

If your familiar with OOP

Write a class that is like a WRAPPER to the ODBC functions.

Then, you can connect once, and keep the connection
ALL this using just odbc_connect

This is what I have done, and if you would like, I can write a quick one.

Eric
- Original Message -
From: Maris Kalnins [EMAIL PROTECTED]
To: 
Sent: Wednesday, April 03, 2002 10:11 AM
Subject: Re: [PHP] odbc_pconnect doesnt reuse connection


 because odbc_connect takes some time to establish connection
 while odbc_pconnect establishes it once after that it suppose to
 give faster access through already existing connection!

 that's what I got from php manual..
 the bad thing is .. that in reality it works a little bit different..
 so I am wondering .. why?



 Eric Coleman [EMAIL PROTECTED] wrote in message
 026b01c1db1c$860b2890$0201a8c0@devstation">news:026b01c1db1c$860b2890$0201a8c0@devstation...
  Why won't you just use odbc_connect ?
  - Original Message -
  From: Maris Kalnins [EMAIL PROTECTED]
  To: 
  Sent: Wednesday, April 03, 2002 3:07 AM
  Subject: [PHP] odbc_pconnect doesnt reuse connection
 
 
   Hi!
  
   Configuration: WinXP, the latest Apache, PHP4
  
   The problem is that every time the script runs and the following
command
  is
   executed
   $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
   it happens very often that a new connection is created instead of
 reusing
   the old one!
  
   Is there any idea what's wrong... ?
  
   And another question - when user hits reload or submit button at the
  moment
   when
   actually this odbc_pconnect is in progress - it generates another
  connection
   leaving the old one
   (half opened or whatever) still alive..
  
   So if you will click on submit button more than 10 times with a little
  short
   interval -
   we will get ODBC error - Database server connection limit exceeded
  
   I tried to set in PHP config file
   odbc.max_persistent = 1
  
   but it still overgoes more than 1 connection to the same database,
user
  and
   password..
  
   What's  wrong?
  
  
  
  
  
  
  
   --
   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] What's wrong with the Array? Im baffled!

2002-04-03 Thread eric.coleman

Why not try using

if(empty($sumItUp[$name]))
{
// rest of code


- Original Message -
From: Scott Fletcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:14 AM
Subject: [PHP] What's wrong with the Array? Im baffled!


 Hi!

 I'm a little baffled on why the array is not working the way I expect
it
 to.  It showed there is something about the array I do not know about.
 Well, it's never too late to learn something new.  So, here's the code and
 see if you can help me out.

 -- clip --

   $name = TU4R;

   if ($sumItUp[$name] == ) {
  $sumItUp[$name] = 0;
   } else {
 //debug
 echo **;
  $number = $sumItUp[$name];
  $number++;
  $sumItUp[$name] = $number;
   }
   echo $sumItUp[$name].br;

 -- clip --

 In this case, the if statement never went into else statement when
 there's a number like 0, 1, 2, etc.  So, what's the heck is happening
here?
 When the array, sumItUp[] was empty then the number 0 was assigned and
 it work like a charm.  So,  when this code is repeated again, the if
 statement check the array, sumItUp[] and found a number, 0 and it is
not
 equal to  as shown in the if statement.  So, therefore the else
statement
 should be executed.  But in this case, it never did.  I tested it myself
to
 make sure I wasn't missing something by putting in the php codes, echo
 '**'; and the data, ** was never spitted out on the webpage.  So, it
tell
 me that the else statment was never executed.  So, the problem had to do
 with the data in the array itself.  So, can anyone help me out?  Thanks a
 million!!

 Scott



 --
 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] Can not get session value???

2002-04-03 Thread eric.coleman

Yes, you have to call session_start() on every page you want to access/pass
session variables

Eric

- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:22 AM
Subject: RE: [PHP] Can not get session value???


 Do you have a call to session_start() in the second file? You need this to
 access the session variables on the second page.

 Kirk

  -Original Message-
  From: N.D. Andini [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, April 02, 2002 3:20 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Can not get session value???
 
 
  I use php4.0.5, OS : WIN2000, Webserver : Apache
 
  I want to use session to make global variable
  in file php.ini.
  I have set item below become enabled
  - register_globals
  - auto_start
  - use_trans_sid (to compiled with --enable-trans-sid)
 
  in my first file myfirst.php, I register session like below :
  session_register (ses_useid);
  session_register (ses_usename);
  $ses_useid=4;
  $ses_usename=toto;
 
  and on second file mysecond.php, I get value of those session to check
  session value like below:
  print $ses_useid;
  print $ses_usename;
 
  but I have no result from mysecond.php
 
  Is there anybody can help me???
 
  thx
 
  regards,
 
  Dini...

 --
 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] Environment Variables Functions Incompatible???

2002-04-03 Thread eric.coleman

They did not break backwords compatiblity, because

$HTTP_*_VARS works on all the new versions of PHP so far, it's just not
Super Global...

Eric

- Original Message -
From: arti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:40 AM
Subject: [PHP] Environment Variables  Functions Incompatible???


 I am running code on different versions of PHP, specifically 4.0.6 and
 4.1.2.  For some reason, you have to use $HTTP_SERVER_VARS[HTTP_HOST])
on
 4.0.6 and $_SERVER[HTTP_HOST] on 4.1.2.  I'm not sure who thought that
 breaking backward compatibility was a good idea, but let's ignore that for
 the moment.  In this situation, the obvious thing to do here would be to
 make a common function to return the hostname.  But, this does not work as
 illustrated below:

 - this is the main PHP script
 ?php
 //main.php
 include (crap.php);

 function thisalsonowork()
 {
  print Third one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 }

 thisnowork();
 print Second one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 thisalsonowork();
 ?

 --- this is the include/require script
 ?php
 //crap.php
 function thisnowork()
 {
  print First one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 }
 ?

 --- Here is the output

 First one: ()Second one: (1)Third one: ()




 Besides the fact that the different versions of PHP provide different
 environment variables for determining the host, the isset() on the env
 variable works differently inside a function.  What is going on here?

 Am I just missing something obvious?

 Thanks,

 -- Brian



 --
 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] php+myslq+IDE

2002-04-03 Thread eric.coleman

Try PHP Coder (not Maguma's Version, becuase PHP Coder kicks it's ass)

I can email you the installed, as there site seems to be down now..

Eric

- Original Message - 
From: javier [EMAIL PROTECTED]
To: 
Sent: Wednesday, April 03, 2002 4:40 PM
Subject: [PHP] php+myslq+IDE


 Is there any free app. for php coding? I tried komodo but I can't get it 
 to work in debug mode. Also tried Zend's Studio but it expires. :(
 Is there any free choice?
 
 
 -- 
 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] request for comments

2002-04-03 Thread eric.coleman

I don't like it, it looks like you copied php.net
- Original Message - 
From: Tyler Longren [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Lee Doolan [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 8:21 PM
Subject: Re: [PHP] request for comments


 First thing I noticed:
 Website looks VERY similar to www.php.net.
 
 Tyler Longren
 Captain Jack Communications
 [EMAIL PROTECTED]
 www.captainjack.com
 
 - Original Message - 
 From: Lee Doolan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 03, 2002 7:11 PM
 Subject: [PHP] request for comments
 
 
  
  
  the dynamic portion of the recently launched
  www.affero.com has been implemented with php /
  smarty / postgreSQL.  
  
  the source can be downloaded here:
  http://www.affero.org/source/latest.tar.gz
  
  i would not call this a 'distribution' by any
  stretch of the imagination.  for one thing, it will
  not work out of the box since no credit card
  processing code is included in the tarball.
  
  i would be curious about any remarks, positive or
  negative which anyone might have.
  
  -lee
  
  -- 
  Share your feedback at Affero:
  http://svcs.affero.net/rm.php?r=leed_25
  
  -- 
  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] PHP and MS Access

2002-04-02 Thread eric.coleman

If you want,

I can give you an ODBC Db abstraction layer.. there are only a few things
not complete on it, it's at abuot 90%


- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Rance Hall' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 6:31 PM
Subject: RE: [PHP] PHP and MS Access


  I guess I am gonna have to plead stupid here.
 
  I've never used access, I don't like it, and I think there are much
 better tools out
  there to do what access does.

 We agree...

  Having said that, I work in an environment that is almost completely
 VBA in either
  access or excel.

 May god have mercy on your soul...

  I need to find a way to query an access database, and I wanted to do
 it with a
  auto_refresh web page.
 
  But I cant, I cant connect to the database, I cant execute a query,
 and maybe I return
  the infamous empty yet infinite array.
 
  maybe I should just do it in excel?

 No


 I think a way could be by trying the ODBC functions of PHP.
 See www.php.net/odbc

 If you give us more details we might be more of a help.

  Sincerely,

   Maxim Maletsky
   Founder, Chief Developer

   PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED]
   www.phpbeginner.com





  If any of you have been able to get this to work, please tell me what
 you did to get it
  to work, and how you did it.
 
  Thanks,
 
 
 
  Rance Hall
  308.238.2455
  Internal Office Extensions: 2455 or 6655
  PC Programmer, The Buckle, Inc.
  [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.n=1 H
 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] Mail function acting a bit differently

2002-04-02 Thread eric.coleman

Why not just do

foreach($form as $key = $value)
{
 $form[$key] = stripslashes($form[$key]);
}

Eric
- Original Message -
From: lmlweb [EMAIL PROTECTED]
To: 
Sent: Tuesday, April 02, 2002 11:04 PM
Subject: Re: [PHP] Mail function acting a bit differently


 I've answered myself, thanks all!

 It's definitely  $form[message] = stripslashes($form[message]);
 mail(...);


 Lmlweb [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hosted web, so option to turn on or off is up to the hosting company,
not
  me.
 
  stripslashes what?
 
  $form = stripslashes($form);
  mail(...);
  or
  $form[message] = stripslashes($form[message]);
  mail(...);
 
  Martin Towell [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   stripslashes() should work - or set the magic quote thingy to off
  
   -Original Message-
   From: lmlweb [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, April 03, 2002 1:12 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Mail function acting a bit differently
  
  
   I got an email someone submitted through my web form. I've been using
 this
   form for a while, and it had always worked. It still works, but
 something
   new has popped up.
  
   If someone writes, I'm available to meet with you anytime. We'll talk
  about
   our project.
  
   It appears as: I\'m available to meet with you anytime. We\'ll talk
 about
   our project.
  
   The mail() function as shown:
   mail($recipientname
  $final_recipient,$form[subject],$form[first_name]
   $form[last_name] ($form[email]) send the following message to
  $recipientname
   ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name]
   $form[last_name] \n Email: $form[email] \n Subject: $form[subject]
\n,
   From: $form[first_name] $form[last_name] $form[email]\nReply-To:
   $form[first_name] $form[last_name] $form[email]\nContent-type:
   text/plain\nX-Mailer: PHP/ . phpversion());
  
   Only a week or so ago, I've switched server machines from the one that
 had
   version 4.0.4pl1 (my old server) over to a new server that has version
   4.1.2.
  
   The other differences I  can see from these two is that the 4.1.2
 version
   has magic_quotes_gpc on, where the other one didn't.
  
   How would I set this up so that the comments posted in my forms
doesn't
  get
   addslashed? I tried adding the stripslashes, but what happened was I
get
  an
   email with no data in it.
  
  
  
   --
   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] Forum with PHP, without using mySQL..

2002-04-01 Thread eric.coleman

phpBB v2.x can run on alot of db's

MS Access
MS SQL Server...
MySQL
DB2
Postgre

And a few others i think...

- Original Message -
From: James Arthur [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 01, 2002 8:58 AM
Subject: Re: [PHP] Forum with PHP, without using mySQL..


 On Monday 01 Apr 2002 12:44, MiXmAsTeR wrote:
  Hi, I run a Sports site.
 
  And need a forum, in php, that dosen't use mySQL.
 
  Anyone know any good, without any advertice, exept some from the one who
  made it ?

 PHPBB v2.x and OpenBB can run on top of PostgreSQL 7.x

 --jaa

 --
 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] ask for suggestion about printing

2002-03-31 Thread eric.coleman

This can be done easily...

And since when does PDFLIB cost money? I thought it was free...

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, March 31, 2002 2:02 PM
Subject: [PHP] ask for suggestion about printing


 Dear Sir,

 We are choosing some tools for building applications. Php is a very good
tools to
 build web applications, but we don't know if it can generate printable
 reports. Printable reports mean the report you can print what you see on
screen
 (like winword).

 We are asking if at here, there are good solutions to generate reports.
Simply
 generate html files and print them are not good solutions to us, becuase
you have
 to remove header / footer of html files, and html files seems not to be
used for
 printing.

 We know we can use pdflib to generate pdf files, but it is very
expensive (at
 least US $1,000) .

 If there are no other ways, we will be forced to use the old client-server
approach
 again because printing report is very important to us.


 Many thanks!!!

 Boris




 --
-
 PLEASE READ: The information contained in this e-mail is confidential and
 intended for the named recipient(s) only. If you are not an intended
 recipient of this e-mail you must not copy, distribute or take any further
 action in reliance upon it and you should delete it and notify the sender
 immediately. E-mail is not a secure method of communication. GuruBase
 Technology Limited cannot accept responsibility for the accuracy or
 completeness of this message or any attachment(s). This transmission could
 contain viruses, be corrupted, destroyed, incomplete, intercepted, lost or
 arrive late. If verification of this e-mail is sought then please request
 a hard copy. Unless otherwise stated any views or opinions presented are
 solely those of the author and do not represent those of GuruBase
Technology
 Limited. This e-mail is intended for information purposes only.

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

2002-03-31 Thread eric.coleman

But to answer your question

The purpose of return, is to return a value..

function test($var)
{
 return addslashes($var);
}

$foo = Yes, I'am Very Awsome;
$foo = test($foo);
echo($foo);
// echo's, Yes I\'am Very Awsome

Understand?

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Gary [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 31, 2002 11:43 PM
Subject: Re: [PHP] return


 Nope, that code makes no sense.  $_POST is an array containing the POST
 variables.  You make a copy of that array an put it in $foo thereby
 overwriting the passed in $foo.  Then you return $$foo which actually ends
 up returning a variable named $Array.  It does not look like you have a
 $Array variable in scope, and it is surely not what the misguided coder
 behind this code was trying to achieve.  In short, this is completely
 bogus.

 -Rasmus

 On Sun, 31 Mar 2002, Gary wrote:

  Can someone explain to me the reason for using return.
 
  function _getValue($foo)
  {
  $foo = $_POST;
  return ${$foo};
  }
 
  TIA
  Gary
 
 
  --
  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] $HTTP_USER_AGENT

2002-03-30 Thread eric.coleman

Why not echo $HTTP_USER_AGENT and find out?

- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 30, 2002 11:43 AM
Subject: [PHP] $HTTP_USER_AGENT


 Hello,
 
 Im making a small php script, but I need to know how to do something.
 
 My problem is: I have a script thats like this:
 
 ?php
 if ($HTTP_USER_AGENT == WHAT GOES HERE FOR IE AND NS?) {
echo You have Internet Explorer;
 } else {
echo You have Netscape;
 }
 ?
 
 Do you know what I mean? Thanks,
 
 -Sean
 Kennedy
 
 
 -- 
 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] RE: RE: $HTTP_USER_AGENT

2002-03-30 Thread eric.coleman

try

if( eregi(NS, $HTTP_USER_AGENT) )
{
 echo('You are using Netscape!');
}
elseif( eregi('IE', $HTTP_USER_AGENT) )
{
 echo('Your using IE');
}
else
{
 echo('No Clue what the hell your using');
}
- Original Message -
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 30, 2002 11:52 AM
Subject: [PHP] RE: RE: $HTTP_USER_AGENT


 It prints out Mozilla/4.74 [en]C-CCK-MCD NS4xx/Winxx/EZN (Win95; U). Which
part
 of that do i use?

 Thanks,
 -Sean
 Kennedy


 --
 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] Another ?

2002-03-30 Thread eric.coleman

Probably Opera

- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 30, 2002 12:28 PM
Subject: [PHP] Another ?


 Hello,
 
 Whats the HTTP_USER_AGENT for opera?
 Thanks,
 
 -Sean
 Kennedy
 
 
 -- 
 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] odbc_fetch_array() Not Available?

2002-03-27 Thread eric.coleman

I am running php 4.1.1, and when i try to use odbc_fetch_array, it says Call to 
undefined function

Why is this?

Thanks,
Eric



Re: [PHP] odbc_fetch_array() Not Available?

2002-03-27 Thread eric.coleman

Well, why would all the other ODBC function works?

Thanks,
Eric

- Original Message - 
From: Miguel Cruz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 27, 2002 5:58 PM
Subject: Re: [PHP] odbc_fetch_array() Not Available?


 On Wed, 27 Mar 2002 [EMAIL PROTECTED] wrote:
  I am running php 4.1.1, and when i try to use odbc_fetch_array, it says
  Call to undefined function
  
  Why is this?
 
 Maybe your installation of PHP was not built with ODBC support? It's a 
 compile-time option.
 
 miguel
 
 
 


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




Re: [PHP] odbc_fetch_array() Not Available?

2002-03-27 Thread eric.coleman

Good one.. hehe

Maybe Rasmus was going to notice this, and fix it ;P

Hehe,
Eric

- Original Message -
From: Miguel Cruz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 27, 2002 6:41 PM
Subject: Re: [PHP] odbc_fetch_array() Not Available?


 On Wed, 27 Mar 2002 [EMAIL PROTECTED] wrote:
  I am running php 4.1.1, and when i try to use odbc_fetch_array, it
says
  Call to undefined function
 
  Why is this?
 
  Maybe your installation of PHP was not built with ODBC support? It's a
  compile-time option.
 
  Well, why would all the other ODBC function works?

 Good point. A quick click to the manual page at

http://www.php.net/odbc_fetch_array

 reveals that you're not the first person to notice this, and someone has
 provided a workaround. The manual is a good first place to go when dealing
 with problems. You don't have to wait for people to respond, and you don't
 take time away from solving more complex problems that aren't immediately
 addressed in the manual.

 Like how I turned my mistake around into a lecture at you? That's what I
 learned in management school.

 miguel


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





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




Re: [PHP]

2002-03-26 Thread eric.coleman

That would mean that you have some type of output to the browser, i.e. blank
line, or some text, before you are calling your session/cookie
- Original Message -
From: Vlad Kulchitski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 26, 2002 8:17 PM
Subject: [PHP]


Hi can anyone help me, I am getting this error when I try
to start session:

Warning: Cannot send session cookie - headers already sent by (output
started at /var/www/kulchitski/btl/btl.php:2) in
/var/www/kulchitski/btl/_talkroom_edit.php on line 39

I didn't start session before, in fact I never use session here
except this step. Can anyone suggest anything?

Thanks,
Vlad

--
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] Re: Non-Cache in forms?

2002-03-25 Thread eric.coleman

I am putting certin code within comment tags, so it isn't seen...


- Original Message -
From: David Robley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 11:00 PM
Subject: Re: [PHP] Re: Non-Cache in forms?


 On 25 Mar 2002 at 0:29, [EMAIL PROTECTED] wrote:

  yes, but i send them back to the previous page
  and it shows the form...
 
  What would be a way around this?
  - Original Message -
  From: David Robley [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Sunday, March 24, 2002 11:39 PM
  Subject: [PHP] Re: Non-Cache in forms?
 
 
   In article 001801c1d38d$6b016eb0$0201a8c0@zaireweb,
   [EMAIL PROTECTED] says...
Alright,
   
When I submit a form, and shoot out an error, such as Please fill
in
  email address and then send them back to the form, the form seems to be
  blank... Why?  What is happening that the form isn't keeping the
  previously posted data? My error function looks like so
  function crapout($msg, $hidden_msg = FASE) {   echo($msg);  
  if($hidden_msg != FALSE) {   echo('!-- ' . $hidden_msg . ' --'); 

  }   exit;   } Thanks,   Eric Coleman You are aware
  that exit halts execution of the script?   --  David Robley 
Temporary
  Kiwi!   Quod subigo farinam   --  PHP General Mailing List
  (http://www.php.net/)  To unsubscribe, visit:
  http://www.php.net/unsub.php   

 Please respond to the list as well, as you are more likely to get a timely
and useful
 response that way.

 I notice that your error message is in HTML comment tags? Without seeing
more of your
 code, it's a bit hard to tell. But you might try doing a view source and
see if there is
 anything in the source that might assist. Otherwise, post more relevant
parts of your code
 to the list.


 --
 David Robley
 Temporary Kiwi!
 Quod subigo farinam

 I want this statue to look like the Venus de Milo, said Tom disarmingly.



 --
 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] Non-Cache in forms?

2002-03-24 Thread eric.coleman

Alright,

When I submit a form, and shoot out an error, such as Please fill in email address 
and then send them back to the form, the form seems to be blank...

Why?  What is happening that the form isn't keeping the previously posted data?

My error function looks like so

function crapout($msg, $hidden_msg = FASE) {
echo($msg);
if($hidden_msg != FALSE) {
echo('!-- ' . $hidden_msg . ' --');
}
exit;
}

Thanks,
Eric Coleman



[PHP] Getting TOTAL DB Size of a MySQL Database

2002-03-16 Thread eric.coleman

Anyone have a small snippet I could use to get the total size of any certin
MySQL database..

Just want to disply it in my browser using a little php script, have any
ideas?

Thanks,
Eric


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




[PHP] How to get the FULL address of a certin page???

2002-03-12 Thread eric.coleman

I have a url like this:

http://192.168.1.2/site/add_article.php?sid=5234a0f5acea9aa245dbe9846f6ace1c

And I need to be able to RETURN the FULL url, how would i do this?  I don't
think there is any one function/variable to do this..

I tried __FILE__ but that just returns the path..

Thanks,
Eric Coleman
[EMAIL PROTECTED]


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




Re: [PHP] Re: Checking to see what value error_reporting is set at?

2002-03-09 Thread eric.coleman

I ment, if you re-set it, as im setting it to error_reporting(E_ALL);
depending on a value i get from a db query...

-Eric

- Original Message -
From: David Robley [EMAIL PROTECTED]
To: 
Sent: Saturday, March 09, 2002 6:52 PM
Subject: [PHP] Re: Checking to see what value error_reporting is set at?


 In article 00b801c1c714$b4854230$0501a8c0@zaireweb,
 [EMAIL PROTECTED] says...
  Is it possible to return what error_reporting is set at currently?  If
not, think they would be able to throw it into the newest build of php?
 
  Thanks,
  Eric
 

 Have a look at the ini_get function

 --
 David Robley
 Temporary Kiwi!

 Quod subigo farinam

 --
 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] Checking to see what value error_reporting is set at?

2002-03-08 Thread eric.coleman

Is it possible to return what error_reporting is set at currently?  If not, think they 
would be able to throw it into the newest build of php?

Thanks,
Eric