Re: [PHP] Adding a URL

2003-03-30 Thread Hugh Danaher
Scott,
try changing:
  print \t\ttd$col_value/td\n;
to:
  print \t\ttda href=mailto:.$col_value.;$col_value/a/td\n;
Hope this helps.
Hugh

- Original Message -
From: Scott Thompson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 8:53 PM
Subject: [PHP] Adding a URL


 Hi,

 I am using the following code to query a database and build an HTML table.

 html
   head
titleSQL Connect/title
   /head

   body
?php
  /* Connecting, selecting database */
  $link = mysql_connect(localhost, root, )
  or die(Could not connect);
  //print Connected successfully;
  mysql_select_db(irvington) or die(Could not select database);

  /* Performing SQL query */
  $query = SELECT * FROM staff;
  $result = mysql_query($query) or die(Query failed);

  /* Printing results in HTML */
  print table\n;
  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  print \ttr\n;
  foreach ($line as $col_value) {
 print \t\ttd$col_value/td\n;
  }
  print \t/tr\n;
  }
  print /table\n;

  /* Free resultset */
  mysql_free_result($result);

  /* Closing connection */
  mysql_close($link);
?

   /body
 /html


 So far so good...

 The SQL query returns this:
 mysql select * from staff;
 ++--+--+
 | name   | email| subject  |
 ++--+--+
 | Scott Thompson | [EMAIL PROTECTED] | Volunteer|
 | sanitized| sanitized  | Computer Science |
 | Some Teacher   | [EMAIL PROTECTED]   | some subject |
 ++--+--+
 3 rows in set (0.00 sec)

 mysql

 The above is also essentialy what you see in your browser (sans headers).

 So far so good...

 What I want (and can't figure out) is how to have each email address
 have a URL (i.e. mailto:[EMAIL PROTECTED]).

 I'm fairly new to PHP, I hope this question made some sense.

 Suggestions?

 ~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



[PHP] Question

2003-03-30 Thread Marius
 ?php
 $list = array ('Ba-na-na', 'Ber-ry');
 echo a href=\index.php?fruit={$list['0']}\;
 echo $list['0'];
 echo /a;
 ?
 how i can get Ba-na-na in url and Banana or Ba na na in echo ?

-- 
 Marius
 [EMAIL PROTECTED]



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



Re: [PHP] Question

2003-03-30 Thread Kevin Waterson
This one time, at band camp,
Marius [EMAIL PROTECTED] wrote:

  ?php
  $list = array ('Ba-na-na', 'Ber-ry');
  echo a href=\index.php?fruit={$list['0']}\;
  echo $list['0'];
  echo /a;
  ?
  how i can get Ba-na-na in url and Banana or Ba na na in echo ?

$list = array('Ba-na-na', 'Ber-ry');

echo 'a href=\index.php?fruit='.$list[0].''.str_replace('-','',$list[0]).'/a';

Kevin
-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



RE: [PHP] Question

2003-03-30 Thread Julien Wadin
just do that :

to have Banana :
$a = ereg_replace(-,,$list[0]);

to have Ba na na
$b = ereg_replace(-, ,$list[0]);

Bye

__
WADIN JULIEN
URL : www.campinfm.be.tf



-Message d'origine-
De : Marius [mailto:[EMAIL PROTECTED]
Envoyé : dimanche 30 mars 2003 11:44
À : [EMAIL PROTECTED]
Objet : [PHP] Question


 ?php
 $list = array ('Ba-na-na', 'Ber-ry');
 echo a href=\index.php?fruit={$list['0']}\;
 echo $list['0'];
 echo /a;
 ?
 how i can get Ba-na-na in url and Banana or Ba na na in echo ?

--
 Marius
 [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



[PHP] question

2003-03-30 Thread Marius
 ?php
 $i = 0;
 $list = array('Banana', 'Strawberry', 'Apple', 'Cherry');
 echo $list[$i];
 $i = $i+1;
 ?

 how to do that 2 of key echoes in first table colum and other 2 in
 second colum?

-- 
 Marius
 [EMAIL PROTECTED]



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



RE: [PHP] upload question

2003-03-30 Thread Dan Rossi
err its open with actually

-Original Message-
From: Hugh Danaher [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 2:04 PM
To: Anthony Ritter
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] upload question


Sounds like a Windows configuration issue and not a php issue.  There's an
'open using' (or some such) option buried in the windows file menu that will
let you change this.
Hugh
- Original Message -
From: Anthony Ritter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 7:12 PM
Subject: [PHP] upload question


 Greetings all,
 Using PHP 4.1.1 / Apache Server / MS Win 98 / IE 5.5

 The following script is from Julie Meloni's book PHP Fast and Easy on page
 170-174.

 The first part is an html form in which the user browses and chooses a
file
 to be upoloaded to the server.

 The script works fine in that when I chose a file and hit submit it, the
 file ends up in:

 C:\apache\htdocs

 However, in the book, in the last illustration, she explains:

 Just to be sure, use the File/Open Page menu item in your _browser_ to
 navigate through your filesystem and find the file that you just
uploaded.

 The illustration shows the .jpg file _within_ the browser screen on the
 upper left hand side.

 When I follow those steps and hit file / open, my paint program takes over
 and opens the uploaded .jpg file and the browser interface of MS IE 5.5 is
 gone.

 Any advice would be appreciated.
 Thank you.

 Tony Ritter
 ...

 // html form
 /head
 body
 form action=upload.php method=post enctype=multipart/form-data
 p
 File to upload:
 input type=file name=thefile size=30
 /p
 p
 input type=submit name=submit value=Upload File
 /p
 /form
 /body
 /html


 // .php script called  upload.php
 ?
 if ($thefile != )
  {
   copy($thefile,C:\\apache\\htdocs\\$thefile_name)or die(Could not
copy
 the file.);
  }
 else
  {
   echo No file to upload.;
  }
 ?
 html
 head
 /head
 body
 p
 You sent:
 ? echo $thefile_name; ?, a ? echo $thefile_size; ? byte file with
a
 mime type of ? echo $thefile_type ; ?.
 /p
 /body
 /html




 --
 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] Theme selector?

2003-03-30 Thread Lars Tvedt
i would have used templates: heres one http://smarty.php.net
Liam Gibbs [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Hello, can anyone help me with a php theme selector? I want it like when
  the seletect a theme ?theme=green that it will go into a directory and
  load green.php or somthing like that please help. Thankyou

 I'd store your themes in stylesheets instead.




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



RE: [PHP] question

2003-03-30 Thread Don Read

On 30-Mar-2003 Marius wrote:
  ?php
  $i = 0;
  $list = array('Banana', 'Strawberry', 'Apple', 'Cherry');
  echo $list[$i];
  $i = $i+1;
  ?
 
  how to do that 2 of key echoes in first table colum and other 2 in
  second colum?
 

Method 1:

$i=0;
echo 'trtd
foreach($list as $v) { 

echo $v, 'br';
if (! (++$i % 2))
echo '/td';
if ($i  count($list))
 echo 'td';
}
}
echo '/tr';


Method 2:

echo 'tr';
unset($blk);
foreach($list as $v) {
if (count($blk) = 2) {
echo 'td', implode('br', $blk), '/td';
unset($blk);
}
$blk[] = $v;
}

if (count($blk) )
 echo 'td', implode('br', $blk), '/td';
echo '/tr';


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] question

2003-03-30 Thread skate
excuse me for being dumb, but can you explain this line for me?

if (! (++$i % 2))

i've done scripts like this before, but never used anything like this? but
then i never was a great coder :)

thanks

- Original Message -
From: Don Read [EMAIL PROTECTED]
To: Marius [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 1:54 PM
Subject: RE: [PHP] question



 On 30-Mar-2003 Marius wrote:
   ?php
   $i = 0;
   $list = array('Banana', 'Strawberry', 'Apple', 'Cherry');
   echo $list[$i];
   $i = $i+1;
   ?
 
   how to do that 2 of key echoes in first table colum and other 2 in
   second colum?
 

 Method 1:

 $i=0;
 echo 'trtd
 foreach($list as $v) {

 echo $v, 'br';
 if (! (++$i % 2))
 echo '/td';
 if ($i  count($list))
  echo 'td';
 }
 }
 echo '/tr';


 Method 2:

 echo 'tr';
 unset($blk);
 foreach($list as $v) {
 if (count($blk) = 2) {
 echo 'td', implode('br', $blk), '/td';
 unset($blk);
 }
 $blk[] = $v;
 }
 
 if (count($blk) )
  echo 'td', implode('br', $blk), '/td';
 echo '/tr';


 Regards,
 --
 Don Read   [EMAIL PROTECTED]
 -- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do 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



Re: [PHP] question

2003-03-30 Thread Don Read

On 30-Mar-2003 skate wrote:
 excuse me for being dumb, but can you explain this line for me?
 
 if (! (++$i % 2))
 

If $i is evenly divisible by 2 then ($i % 2) evaluates to 0 or (false).
The (! ($i % 2)) inverts the meaning to (true) so the statements within
the if block are executed.

The ++$i bit --well it's a handy spot to increment $i, and the pre-increment
notation gets around the case when $i == 0.

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] PHP and Visual Studio.Net

2003-03-30 Thread Ulrik

Hello,

maybe somebody can help me. I am involved in a web project for the first
time now and I'd like to keep my current development environment, Visual
Studio.Net. Is there any way to incorporate PHP Syntax highlighting into
Visual Studio.Net or Visual Studio 6.0??? In 6.0, I can choose to handle PHP
files like C++ files, which helps at least a bit, but I haven't found a
similar function in VS.Net

Any help is greatly appreciated!

thanx

ulrik


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



Re: [PHP] preg_replace_callback and brackets

2003-03-30 Thread Marek Kilimajer
Maybe you should use

/\b/

   word boundary

instead of all the or's

Joshua Moore-Oliva wrote:

I'm kind of confused right now...  when I call preg_replace_callback with a 
regular expression with brackets, sometimes I get an array back with multiple 
elements like

array(3) {
 [0]=
 string(19) http://www.aol.com

 [1]=
 string(0) 
 [2]=
 string(19) http://www.aol.com

}
and I have no idea why...  Why does the middle one have nothing in it?  the 
regular expression was

$dumb_body = preg_replace_callback ( '/'
  //Case spaceURLspace
  . '([\s]http:\/\/[^\s]+[\s])'
  . '|'
  //Case URLspace
  . '(^http:\/\/[^\s]+[\s])'
  . '|'
  //Case spaceURL
  . '([\s]http:\/\/[^\s]+$)'
  . '|'
  //Case URL
  . '(^http:\/\/[^\s]+$)'
  . '/i'
  , array( $this, storeUrlCallback ), 
$dumb_body );

I am very confused at the point of the array in this function period...  can 
anyone help?

Josh.

 



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


Re: [PHP] question

2003-03-30 Thread skate
ahkay, makes perfect sense now :)

thanks
- Original Message -
From: Don Read [EMAIL PROTECTED]
To: skate [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 2:19 PM
Subject: Re: [PHP] question



 On 30-Mar-2003 skate wrote:
  excuse me for being dumb, but can you explain this line for me?
 
  if (! (++$i % 2))
 

 If $i is evenly divisible by 2 then ($i % 2) evaluates to 0 or (false).
 The (! ($i % 2)) inverts the meaning to (true) so the statements within
 the if block are executed.

 The ++$i bit --well it's a handy spot to increment $i, and the
pre-increment
 notation gets around the case when $i == 0.

 Regards,
 --
 Don Read   [EMAIL PROTECTED]
 -- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do 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



Re: [PHP] PHP and Visual Studio.Net

2003-03-30 Thread Steven Kallstrom
Ulrik,

For PHP editing in Visual Studio .NET...

http://www.quake-au.net/php/php_and_vsdotnet.htm

SJK



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



[PHP] Ereg question

2003-03-30 Thread Beauford
I am using ereg to validate the format of a date entry (mm/dd/yy), but if
the year ends in a 0, it is being stripped and as such produces an error. So
1990 would be 199.  The dob is being inputted by a form

Here is my code:

if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$, $formsave[dob], $parts)) {
 $error[dob] = *; $message[dob] = Invalid date format!;
 $dob =  \$parts[3]-$parts[2]-$parts[1]\;
}

Thanks



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



[PHP] issue with connecting to DB

2003-03-30 Thread Jennifer Fountain
Here is the code:

?php $link = mysql_connect("xxx", "x", 
"x") or die("Could not 
connect: " . mysql_error()); print ("Connected 
successfully"); mysql_close($link);?


WhenI try to connect, I get the following error:

Warning: mysql_connect() [function.mysql-connect]: 
Access denied for user: '[EMAIL PROTECTED]' (Using 
password: YES) in /xxx//x//testdb.php on line 
2Could not connect: Access denied for user: [EMAIL PROTECTED]' (Using password: YES)

I know the userid and password work because I can connect to the db via 
phpmyadmin, etc.
version
mysql 3.23.52
php 3


I have google searched and archived searched but I cannot find anything on 
this error. We recently changed the password. 

Does anyone have any idea what is happening?

Thanks

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

Re: [PHP] accessing result-set with associative array

2003-03-30 Thread Leif K-Brooks
It doesn't include the table name.  Use name, albumid, etc.

anders thoresson wrote:

Hi,

I've the query SELECT albums.name, albums.albumid, 
accessrights.albumid, accessrights.userid FROM albums, accessrights 
WHERE accessrights.userid = '$id' AND albums.albumid = 
accessrights.albumid.

It works allright. Using the result in a html SELECT-tag this way 
works:

while($row = mysql_fetch_array($result)) {
echo(OPTION VALUE=\$row[1]\ $row[0]);
}
But if I tries the following line, the script fails:

echo(OPTION VALUE=\$row['albums.albumid']\ 
$row['albums.name']);

with the notice:
Undefined index:  'albums.albumid' in 
bc:\web\thoresson.net\include\user_functions.php/b on line b24/b

I've been trying to learn PHP for three months now, but tonight was 
the first time I sat down with my project for two week, so I'm sorry 
if I'm bothering you with something obvious that I've just forgotten. :)

But I need to know: What am I doing wrong?

Best regards.

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


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


RE: [PHP] Ereg question

2003-03-30 Thread John W. Holmes
 I am using ereg to validate the format of a date entry (mm/dd/yy), but
if
 the year ends in a 0, it is being stripped and as such produces an
error.
 So
 1990 would be 199.  The dob is being inputted by a form
 
 Here is my code:
 
 if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$, $formsave[dob],
$parts))
 {
  $error[dob] = *; $message[dob] = Invalid date format!;
  $dob =  \$parts[3]-$parts[2]-$parts[1]\;
 }

So is $formsave['dob'] being changed before you get to this code,
causing the check to fail? What else are you doing with
$formsave['dob']? Nothing here is going to cause it to drop a zero from
the end. 

Your code doesn't make much sense, though. If the ereg() fails, $parts
is not going to have any value, so why are you referencing $part[1],
$part[2], etc... ?

---John W. Holmes...

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



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



Re: [PHP] Ereg question

2003-03-30 Thread Beauford
$parts has been removed as I found I didn't need it there, but the problem
still exists. This part of code however may be causing the problem, although
I thought trim only stripped white space.?.  $formsave['dob']  is a
session variable.  I have also found now that leading 0's are also being
stripped.

foreach($HTTP_POST_VARS as $varname = $value)
  $formsave[$varname] = trim($value, 50);

If it's not there then the whole script fails.

B.

- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Beauford' [EMAIL PROTECTED]; 'PHP General'
[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 2:28 PM
Subject: RE: [PHP] Ereg question


  I am using ereg to validate the format of a date entry (mm/dd/yy), but
 if
  the year ends in a 0, it is being stripped and as such produces an
 error.
  So
  1990 would be 199.  The dob is being inputted by a form
 
  Here is my code:
 
  if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$, $formsave[dob],
 $parts))
  {
   $error[dob] = *; $message[dob] = Invalid date format!;
   $dob =  \$parts[3]-$parts[2]-$parts[1]\;
  }

 So is $formsave['dob'] being changed before you get to this code,
 causing the check to fail? What else are you doing with
 $formsave['dob']? Nothing here is going to cause it to drop a zero from
 the end.

 Your code doesn't make much sense, though. If the ereg() fails, $parts
 is not going to have any value, so why are you referencing $part[1],
 $part[2], etc... ?

 ---John W. Holmes...

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



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





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



Re: [PHP] Ereg question

2003-03-30 Thread Beauford
This is what I get when I echo $formsave[dob]  - 9/09/199.  It was
inputted as 09/09/1990.

B.

- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Beauford' [EMAIL PROTECTED]; 'PHP General'
[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 2:28 PM
Subject: RE: [PHP] Ereg question


  I am using ereg to validate the format of a date entry (mm/dd/yy), but
 if
  the year ends in a 0, it is being stripped and as such produces an
 error.
  So
  1990 would be 199.  The dob is being inputted by a form
 
  Here is my code:
 
  if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$, $formsave[dob],
 $parts))
  {
   $error[dob] = *; $message[dob] = Invalid date format!;
   $dob =  \$parts[3]-$parts[2]-$parts[1]\;
  }

 So is $formsave['dob'] being changed before you get to this code,
 causing the check to fail? What else are you doing with
 $formsave['dob']? Nothing here is going to cause it to drop a zero from
 the end.

 Your code doesn't make much sense, though. If the ereg() fails, $parts
 is not going to have any value, so why are you referencing $part[1],
 $part[2], etc... ?

 ---John W. Holmes...

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



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





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



Re: [PHP] Ereg question

2003-03-30 Thread Beauford
Just some more information. It appears that the session variable
$formsave[dob] is causing the problem. If I echo the input $_POST['dob']
it shows correctly, but when it's put into $formsave[dob]  the leading and
ending 0's are being stripped.

B.

- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Beauford' [EMAIL PROTECTED]; 'PHP General'
[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 2:28 PM
Subject: RE: [PHP] Ereg question


  I am using ereg to validate the format of a date entry (mm/dd/yy), but
 if
  the year ends in a 0, it is being stripped and as such produces an
 error.
  So
  1990 would be 199.  The dob is being inputted by a form
 
  Here is my code:
 
  if (!ereg(^([0-9]{2})/([0-9]{2})/([0-9]{4})$, $formsave[dob],
 $parts))
  {
   $error[dob] = *; $message[dob] = Invalid date format!;
   $dob =  \$parts[3]-$parts[2]-$parts[1]\;
  }

 So is $formsave['dob'] being changed before you get to this code,
 causing the check to fail? What else are you doing with
 $formsave['dob']? Nothing here is going to cause it to drop a zero from
 the end.

 Your code doesn't make much sense, though. If the ereg() fails, $parts
 is not going to have any value, so why are you referencing $part[1],
 $part[2], etc... ?

 ---John W. Holmes...

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



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





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



Re: [PHP] Problems with post data

2003-03-30 Thread Frank
Does this bug also applies to passing variables in an URL.

I'v noticed  that when the directive register_globals is set to off as it is
recommended in the php.ini file no variables are passed on to other pages.
Switching it to on would be the simplest solution, but scripts like
phpMyAdmin do not seem to have these problems.

Any idea or suggestion.

Frank

John W. Holmes [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 I bet the web server that works is not running Apache 2, is it? Either
 way, it's an Apache2 and PHP bug. It's in the bug tracker somewhere...
 Use Apache 1.3.27 or whatever the latest is...

 ---John W. Holmes...

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

  -Original Message-
  From: Mark Douglas [mailto:[EMAIL PROTECTED]
  Sent: Saturday, March 29, 2003 7:57 AM
  To: '[EMAIL PROTECTED]'
  Subject: [PHP] Problems with post data
 
  I'm having problems with my post variables. Here's the page I use to
  submit
  data:
 
  FORM ACTION=test2.php METHOD=POST /
  INPUT TYPE=text SIZE=50 MAXLENGTH=50 NAME=new_area
  /nbsp;nbsp;INPUT TYPE=SUBMIT VALUE=Add New Skill Area /BR
 /BR /
  /FORM
 
  Here's the test2.php page:
 
  ?php
  print_r($_POST);
  ?
 
  This is all very simple, and works on one of my webservers. However,
 on
  another webserver with a practically identical configuration, if I
 post
  testing the result that I get is this:
 
  Array ( [new_area] = testingnew_area=testing )
 
  I've spent hours scouring my two configurations, changing options here
 and
  there, and have had zero success in making the problem webserver work.
 
  The server is a dual processor RedHat 8 system running apache 2.0.43,
 and
  php 4.3.1. You can see the phpinfo at
  http://inexorable.sagelikefool.net/phpinfo.htm (yes htm, not php). Any
 and
  all help is appreciated!
 
  --
  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] Test tables existance

2003-03-30 Thread Antti
How do I test if a mysql table exists or not? Is there a function for 
this? I didn't find a good one.

-antti

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


[PHP] PHP, ASP, IIS and MySQL

2003-03-30 Thread Jesper Blomström
Hi!

I hope this is the right place to ask this kind of question, otherwise I 
apologize.

I would like some advice, this is the situation:

We´re using IIS today and unfortunate we will have to cope with this 
situation for a long time ahead.
There are plans for using Apache on Linux but not right now (not even 
Apache on Win).

A great deal of work has been done in coding ASP (towards an Access-DB) :(
Now we´re going to replace Access with either MySQL or possibly PostgreSQL.
Since we in the future would like to run Apache on Linux instead of IIS 
on Win, it would be great to code all new functions in PHP instead of 
ASP (and nicer code too).
I have done some experiments with PHP on IIS (towards MySQL) and it all 
seems to work just fine.

My questions for you:
1) Is there a penelty/drawback when coding PHP instead of ASP on IIS 
(towards MySQL)?
2) Do you see any problems in having both ASP-code and PHP-code on the 
same server (it seems to work fine for me)?
3) (on the edge of topic) Do you have any comments or thoughts 
concerning the choice of DB. MySQL appears to like Win more than 
Postgres, or?

Many thanks in advance!

Jesper

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


Re: [PHP] Test tables existance

2003-03-30 Thread Miles Thompson
Come on, check the mysql section of the PHP manual ... this took about 20 sec
http://www.php.net/manual/en/function.mysql-list-tables.php
At 11:34 PM 3/30/2003 +0300, Antti wrote:
How do I test if a mysql table exists or not? Is there a function for 
this? I didn't find a good one.

-antti

--
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] Problems with post data

2003-03-30 Thread Haseeb Iqbal
hi,
i have seen some script using a unique method.they grab all the global
variables in a array and then unset the global variables.ofcourse they are
not handling file uploads.i think its a good idea if you are not uploading
files.

any suggestions are welcome

Haseeb

I'v noticed  that when the directive register_globals is set to off as it
is
recommended in the php.ini file no variables are passed on to other pages.
Switching it to on would be the simplest solution, but scripts like
phpMyAdmin do not seem to have these problems.


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



Re: [PHP] Test tables existance

2003-03-30 Thread Haseeb Iqbal
use mysql_query(show tables); get them in array and then scan the array

thats what i would do if there isn;t any function


Friendship is always a sweet responsibility, never an opportunity.
HaSeEb IqBaL.
0300-4258030
- Original Message - 
From: Antti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 1:34 AM
Subject: [PHP] Test tables existance


 How do I test if a mysql table exists or not? Is there a function for 
 this? I didn't find a good one.
 
 -antti
 
 
 -- 
 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] Test tables existance

2003-03-30 Thread Don Read

On 30-Mar-2003 Antti wrote:
 How do I test if a mysql table exists or not? Is there a function for 
 this? I didn't find a good one.
 
 -antti

function tableexists($tbl) {
$res = @mysql_query(SELECT 1 FROM $tbl LIMIT 1);
return ($res ? true : false);
}

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] Problems with post data

2003-03-30 Thread Chris Shiflett
Frank,

John's answer applies to Apache 2.44 as well. I'm not sure how you interpreted
his advice against using Apache 2 to mean that an upgrade would solve your
problem. He recommended using the latest Apache 1.3.x.

The likely reason you are having trouble with register_globals is that you need
to reference GET variables as $_GET['blah'] instead of $blah. The archives are
filled with helpful information on this, as this question is asked a few times
a day.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Sessions and iframes (or frames)?

2003-03-30 Thread Justin French
My advice is to first get REALLY comfortable with sessions in a non-framed
environment... get a grip on logging in, logging out, showing different code
for logged in members, restricting a user from doing something more than
once, etc etc.

THEN try to get it happening in a framed environment.

As discussed by John, you will have to force a refresh for any frame to be
aware of a recently logged in user, and you will have to do a lot of
checking when receiving a form or request in each of these frames, to ensure
there is a user logged in, etc.


As per ANY session stuff between pages, you need to propogate the session id
either through the URL to each frame (or hope that trans-sid takes care of
it), or rely on the user having cookies enabled.

To point out the really obvious, ? session_start(); ? needs to be called
on the top of the script for EACH FRAME.


Justin


on 31/03/03 5:41 AM, Tiago Simões ([EMAIL PROTECTED]) wrote:

 Hello.
 
 
 I built this site using using different iframes: one for a login, other for
 a forum, another for a voting poll, etc...
 
 I was wondering what is the best way to ensure that you could only post a
 topic in the forum, or vote if you had already logged in.
 
 I'm somewhat familiar with the $_session global variable, but only if the
 code happens in the same page. How can you check, from another frame, that
 user is logged?
 
 Thanks in advance...
 Tiago Simões
 
 


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



[PHP] Parsing XML CDATA errors?

2003-03-30 Thread Toby Coleridge
I am trying to parse an XML file that looks like the following
snippet:

latest_news
item id=1
date12/03/03/date
titleNew benefits to members/title
description
![CDATA[hello :)BRHello ]]
/description
/item
/latæst_news

however it will not parse (doesnt display anything) when I put the
CDATA line on the same line as the description and put the close tag
on the same line as well then all works fine, this is ok in this
exmple but it is of little use when the CDATA contains many lines or
is complicated etc is there a way to solve this? I have attaced the
PHP code I am using below but can not see anything wrong with it ??

Many Thanks
Toby.
?php
if( ! ($fp = fopen( ./news.xml , r )) )
  die(Couldn't open xml file!);
$counter = 0;
$person_data = array();
$xml_current_tag_state = '';

function startElementHandler( $parser, $element_name, $element_attribs ) {
  global $counter;
  global $person_data;
  global $xml_current_tag_state;
  if( $element_name == ITEM ) {
$person_data[$counter][id] = $element_attribs[ID];
  } else {
$xml_current_tag_state = $element_name;
  }
}

function endElementHandler( $parser, $element_name ) {
  global $counter;
  global $person_data;
  global $xml_current_tag_state;
  $xml_current_tag_state = '';
  
  if( $element_name == ITEM ) {
$counter++;
  }
}

function characterDataHandler( $parser , $data ) {
  global $counter;
  global $person_data;
  global $xml_current_tag_state;
  if( $xml_current_tag_state == '' )
return;
  if( $xml_current_tag_state == DATE ) {
$person_data[$counter][date] = $data;
  }
  if( $xml_current_tag_state == TITLE ) {
$person_data[$counter][title] = $data;
  }
  if( $xml_current_tag_state == DESCRIPTION ) {
$person_data[$counter][description] = $data;
  }
}
if( !($xml_parser = xml_parser_create()) )
  die(Couldn't create XML parser!);

xml_set_element_handler($xml_parser, startElementHandler, endElementHandler);
xml_set_character_data_handler($xml_parser, characterDataHandler);
while( $data = fread($fp, 4096) )
{
  if( !xml_parse($xml_parser, $data, feof($fp)) )
  {
break; // get out of while loop if we're done with the file
  }
}
xml_parser_free($xml_parser);
?

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN
HTML
HEAD
  TITLEParsing the Sample XML File/TITLE
/HEAD

BODY BGCOLOR=#ff

?php
for( $i=0 ; $i  $counter ; ++$i ) {
  echo Date:nbsp;nbsp; . $person_data[$i][date] . BR\n;
  echo Title:nbsp;nbsp; . $person_data[$i][title] . BR\n;
  echo Description:nbsp;nbsp; . $person_data[$i][description] . BR\n;
  echo BR\n;
}

?

/BODY
/HTML

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

[PHP] Re: issue with connecting to DB

2003-03-30 Thread Joel Colombo
did u change the password with 'phpmyadmin' ?
u did ? ok then restart mysql 
the passwords load when mysql starts up... at least when u change it via 'phpmyadmin'
havent played much with command line password mods... may not need the restart.
i just pounded my head with the prob last week... running redhat with mysql PHP combo.
all worked after i restarted the mysql service from command line.

Joel Colombo


  Jennifer Fountain [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
  Here is the code:

  ?php
  $link = mysql_connect(xxx, x, x)
  or die(Could not connect:  . mysql_error());
  print (Connected successfully);
  mysql_close($link);
  ?


  WhenI try to connect, I get the following error:

  Warning: mysql_connect() [function.mysql-connect]: Access denied for user: '[EMAIL 
PROTECTED]' (Using password: YES) in /xxx//x//testdb.php on line 2
  Could not connect: Access denied for user: [EMAIL PROTECTED]' (Using password: YES)

  I know the userid and password work because I can connect to the db via phpmyadmin, 
etc.
  version
  mysql 3.23.52
  php 3


  I have google searched and archived searched but I cannot find anything on this 
error.  We recently changed the password. 

  Does anyone have any idea what is happening?

  Thanks



[PHP] Parsing CSS files

2003-03-30 Thread Liam Gibbs
Is there any way of making PHP parse files with a CSS extension?


RE: [PHP] Parsing CSS files

2003-03-30 Thread John W. Holmes
 Is there any way of making PHP parse files with a CSS extension?

Yeah... the same way you made your web server parse files with a .php
extension. Just repeat the same procedure for a .css extension.

---John W. Holmes...

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



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



RE: [PHP] PHP, ASP, IIS and MySQL

2003-03-30 Thread John W. Holmes
 My questions for you:
 1) Is there a penelty/drawback when coding PHP instead of ASP on IIS
 (towards MySQL)?

No, not really. I'm sure ASP has some little tricks built in that you'd
have to recreate in PHP, but the two are basically the same, regardless
of the OS.

 2) Do you see any problems in having both ASP-code and PHP-code on the
 same server (it seems to work fine for me)?

No.

 3) (on the edge of topic) Do you have any comments or thoughts
 concerning the choice of DB. MySQL appears to like Win more than
 Postgres, or?

MySQL seems to be more cross platform and more popular, but PG has a
larger feature set. Depends totally upon the complexity of your project
which one you use.

---John Holmes...



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



RE: [PHP] Problems with post data

2003-03-30 Thread John W. Holmes
 Does this bug also applies to passing variables in an URL.
 
 I'v noticed  that when the directive register_globals is set to off as
it
 is
 recommended in the php.ini file no variables are passed on to other
pages.
 Switching it to on would be the simplest solution, but scripts like
 phpMyAdmin do not seem to have these problems.

The variables are passed, you just have to reference them as
$_GET['variable'] or $_POST['variable'], which is also mentioned many
times in the manual.

---John W. Holmes...

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



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



RE: [PHP] Ereg question

2003-03-30 Thread John W. Holmes
 I thought trim only stripped white space.?.  $formsave['dob']  is
a
 session variable.  I have also found now that leading 0's are also
being
 stripped.
 
 foreach($HTTP_POST_VARS as $varname = $value)
   $formsave[$varname] = trim($value, 50);
 
 If it's not there then the whole script fails.

Why do you have the 50 there in the trim() function? That's what's
causing your problems. You're removing all fives and zeros from the
beginning and end of your string, along with any white space. 

---John W. Holmes...

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



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



Re: [PHP] Parsing CSS files

2003-03-30 Thread Sebastian
if you have cpanel you can add the extension from there.

cheers,
- Sebastian

- Original Message - 
From: Liam Gibbs [EMAIL PROTECTED]


Is there any way of making PHP parse files with a CSS extension?



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



[PHP] GNU Open Source

2003-03-30 Thread John Taylor-Johnston
Where does PHP.net stand? Is it GNU or OpenSource or both?

What's the difference between www.GNU.org and
www.OpenSource.org?
I have been reading:
http://www.oreilly.com/catalog/opensources/book/intro.html but
don't get what DiBona, Ockman  Stone mean. OpenSource permits
folks like RedHat to distribute a paid CD, GNU doesn't?
OpenSource permits greating a module or plugin to work with a
Microsoft product and GNU doesn't?

J


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



Re: [PHP] GNU Open Source

2003-03-30 Thread Rasmus Lerdorf
This is a list for questions about PHP.  Look in the titlebar of your
browser when you go to www.php.net to see what the acronym stands for.
Beyond that, please take this stuff somewhere else.

-Rasmus

On Sun, 30 Mar 2003, John Taylor-Johnston wrote:

 Where does PHP.net stand? Is it GNU or OpenSource or both?

 What's the difference between www.GNU.org and
 www.OpenSource.org?
 I have been reading:
 http://www.oreilly.com/catalog/opensources/book/intro.html but
 don't get what DiBona, Ockman  Stone mean. OpenSource permits
 folks like RedHat to distribute a paid CD, GNU doesn't?
 OpenSource permits greating a module or plugin to work with a
 Microsoft product and GNU doesn't?

 J


 --
 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] Ereg question

2003-03-30 Thread Jason Wong
On Monday 31 March 2003 04:15, Beauford wrote:
 Just some more information. It appears that the session variable
 $formsave[dob] is causing the problem. If I echo the input $_POST['dob']
 it shows correctly, but when it's put into $formsave[dob]  the leading
 and ending 0's are being stripped.

Having read the whole thread it seems that you're only disclosing information 
when it's been totured out of you :)

May I suggest that in order to save yourself and other people's time that you 
give FULL and ACCURATE information. 

For example, at the start of the thread you're pinning the blame on your ereg, 
then you're saying the session variable is the problem. Only after it has 
been pointed out to you that what you say you're doing cannot possibly have 
the effect that you say you're seeing, do you finally disclose that you're 
using trim() on the vital variables.

Put simply, if you had posted your full and unadulterated code right from the 
start then this thread should/would/could have been resolved in about 2 
posts. Saving time and frustration for everyone involved.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Bit off more than my mind could chew,
Shower or suicide, what do I do?
-- Julie Brown, Will I Make it Through the Eighties?
*/


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



Re: [PHP] GNU Open Source

2003-03-30 Thread Manuel Lemos
Hello,

On 03/31/2003 01:05 AM, Rasmus Lerdorf wrote:
This is a list for questions about PHP.  Look in the titlebar of your
browser when you go to www.php.net to see what the acronym stands for.
Beyond that, please take this stuff somewhere else.
He was asking *where* PHP stands (regarding licenses), not *what* PHP 
stands for. Maybe PHP FAQ should have something about licenses.

--

Regards,
Manuel Lemos

On Sun, 30 Mar 2003, John Taylor-Johnston wrote:


Where does PHP.net stand? Is it GNU or OpenSource or both?

What's the difference between www.GNU.org and
www.OpenSource.org?
I have been reading:
http://www.oreilly.com/catalog/opensources/book/intro.html but
don't get what DiBona, Ockman  Stone mean. OpenSource permits
folks like RedHat to distribute a paid CD, GNU doesn't?
OpenSource permits greating a module or plugin to work with a
Microsoft product and GNU doesn't?


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


Re: [PHP] Ereg question

2003-03-30 Thread Beauford
I posted the information as I had it. I had no idea what the problem was and
posted the information I thought was FULL and ACCURATE - if this isn't good
enough - then maybe I'll look for another list where people are a little
more forgiving of new users. Remember, you were in my shoes once.

B.

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 11:20 PM
Subject: Re: [PHP] Ereg question


 On Monday 31 March 2003 04:15, Beauford wrote:
  Just some more information. It appears that the session variable
  $formsave[dob] is causing the problem. If I echo the input
$_POST['dob']
  it shows correctly, but when it's put into $formsave[dob]  the leading
  and ending 0's are being stripped.

 Having read the whole thread it seems that you're only disclosing
information
 when it's been totured out of you :)

 May I suggest that in order to save yourself and other people's time that
you
 give FULL and ACCURATE information.

 For example, at the start of the thread you're pinning the blame on your
ereg,
 then you're saying the session variable is the problem. Only after it has
 been pointed out to you that what you say you're doing cannot possibly
have
 the effect that you say you're seeing, do you finally disclose that you're
 using trim() on the vital variables.

 Put simply, if you had posted your full and unadulterated code right from
the
 start then this thread should/would/could have been resolved in about 2
 posts. Saving time and frustration for everyone involved.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Bit off more than my mind could chew,
 Shower or suicide, what do I do?
 -- Julie Brown, Will I Make it Through the Eighties?
 */


 --
 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] what could be wrong

2003-03-30 Thread Haseeb Iqbal
i am doing this
$arr=imap_sort($pIMAP,1,1);
and getting this error
Notice: (null)(): Error in IMAP command received by server. (errflg=2) in
Unknown on line 0

what could be wrong here
regards

Friendship is always a sweet responsibility, never an opportunity.
HaSeEb IqBaL.
0300-4258030

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



Re: [PHP] what could be wrong

2003-03-30 Thread Haseeb Iqbal
thanx everyone i got it
the problem was i was opening connection with OP_HALFOPEN


Friendship is always a sweet responsibility, never an opportunity.
HaSeEb IqBaL.
0300-4258030



- Original Message - 
From: Haseeb Iqbal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:09 AM
Subject: [PHP] what could be wrong


 i am doing this
 $arr=imap_sort($pIMAP,1,1);
 and getting this error
 Notice: (null)(): Error in IMAP command received by server. (errflg=2) in
 Unknown on line 0
 
 what could be wrong here
 regards
 
 Friendship is always a sweet responsibility, never an opportunity.
 HaSeEb IqBaL.
 0300-4258030
 
 -- 
 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] Ereg question

2003-03-30 Thread Jason Wong
On Monday 31 March 2003 13:58, Beauford wrote:

 I posted the information as I had it. I had no idea what the problem was
 and posted the information I thought was FULL and ACCURATE - 

Full and accurate if taken literally are absolute terms and are objective not 
subjective.

 if this isn't
 good enough - then maybe I'll look for another list where people are a
 little more forgiving of new users. Remember, you were in my shoes once.

Jeez, my suggestion was to make it easier for others to help you. If you 
insist you can always continue to post your question in installments (don't 
forget a teaser to whet people's appetite for the next episode). And yes, you 
can also look for another list if you want. These are all your choices.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Things are not always what they seem.
-- Phaedrus
*/


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



Re: [PHP] Ereg question

2003-03-30 Thread Beauford
This likely won't get through, but if it does. Post a real address so these
conversations don't go through the list. I mean I'm already a burden to the
list as it is.

B.

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 1:36 AM
Subject: Re: [PHP] Ereg question


 On Monday 31 March 2003 13:58, Beauford wrote:

  I posted the information as I had it. I had no idea what the problem was
  and posted the information I thought was FULL and ACCURATE -

 Full and accurate if taken literally are absolute terms and are objective
not
 subjective.

  if this isn't
  good enough - then maybe I'll look for another list where people are a
  little more forgiving of new users. Remember, you were in my shoes once.

 Jeez, my suggestion was to make it easier for others to help you. If you
 insist you can always continue to post your question in installments
(don't
 forget a teaser to whet people's appetite for the next episode). And yes,
you
 can also look for another list if you want. These are all your choices.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Things are not always what they seem.
 -- Phaedrus
 */


 --
 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] Ereg question

2003-03-30 Thread Peter Houchin
Beauford, Jason,

Build a bridge and get over it already sheeesh

TYVMIA
Peter


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


Re: [PHP] require/include from a different directory

2003-03-30 Thread Tim Burden
The call to include() must be relative to one of the directories listed in
open_basedir, regardless of which file the call is made from.

Usually the dir mentioned in open_basedir is the docroot, so in  your case
require include/inc_file.php;

should work from any file, in any folder.

- Original Message -
From: Greg Macek [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 3:37 PM
Subject: Re: [PHP] require/include from a different directory


 It seems I have found my problem. It has to do with the files I'm trying
 to include. They also include other files and the directories it's
 trying to include files from aren't working. I've found a workaround for
 my situation for the time being. It's not pretty, but functional.

 On Sat, 2003-03-29 at 14:19, Greg Macek wrote:
  Hi,
 
  I'm having a problem hopefully can be easily answered. I'm trying to
  organize parts of my site into different directories so that they're all
  not in the main folder so to speak; basically breaking out by what
  part of the application it is. I also have an include folder for all
  my main functions and such...
 
  /  (main directory)
  /include   (global functions, includes)
  /app_sect1
  /app_sect2
 
  what I'm trying to do from /app_sect1 is include a file from the
  include directory, but with little success. The line looks like this:
 
  require ../include/inc_file.php;
 
  But my page just doesn't work for me now.. any ideas what I'm missing?
 
  - Greg
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php




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



php-general Digest 31 Mar 2003 07:40:57 -0000 Issue 1970

2003-03-30 Thread php-general-digest-help

php-general Digest 31 Mar 2003 07:40:57 - Issue 1970

Topics (messages 141647 through 141680):

issue with connecting to DB
141647 by: Jennifer Fountain
141663 by: Joel Colombo

Re: accessing result-set with associative array
141648 by: Leif K-Brooks

Re: Ereg question
141649 by: John W. Holmes
141650 by: Beauford
141651 by: Beauford
141652 by: Beauford
141668 by: John W. Holmes
141672 by: Jason Wong
141674 by: Beauford
141677 by: Jason Wong
141678 by: Beauford
141679 by: Peter Houchin

Re: Problems with post data
141653 by: Frank
141657 by: Haseeb Iqbal
141660 by: Chris Shiflett
141667 by: John W. Holmes

Test tables existance
141654 by: Antti
141656 by: Miles Thompson
141658 by: Haseeb Iqbal
141659 by: Don Read

PHP, ASP, IIS and MySQL
141655 by: Jesper Blomström
141666 by: John W. Holmes

Re: Sessions and iframes (or frames)?
141661 by: Justin French

Parsing XML CDATA errors?
141662 by: Toby Coleridge

Parsing CSS files
141664 by: Liam Gibbs
141665 by: John W. Holmes
141669 by: Sebastian

GNU  Open Source
141670 by: John Taylor-Johnston
141671 by: Rasmus Lerdorf
141673 by: Manuel Lemos

what could be wrong
141675 by: Haseeb Iqbal
141676 by: Haseeb Iqbal

Re: require/include from a different directory
141680 by: Tim Burden

Administrivia:

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

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

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


--
---BeginMessage---
Here is the code:

?php $link = mysql_connect("xxx", "x", 
"x") or die("Could not 
connect: " . mysql_error()); print ("Connected 
successfully"); mysql_close($link);?


WhenI try to connect, I get the following error:

Warning: mysql_connect() [function.mysql-connect]: 
Access denied for user: '[EMAIL PROTECTED]' (Using 
password: YES) in /xxx//x//testdb.php on line 
2Could not connect: Access denied for user: [EMAIL PROTECTED]' (Using password: YES)

I know the userid and password work because I can connect to the db via 
phpmyadmin, etc.
version
mysql 3.23.52
php 3


I have google searched and archived searched but I cannot find anything on 
this error. We recently changed the password. 

Does anyone have any idea what is happening?

Thanks

---End Message---
---BeginMessage---
did u change the password with 'phpmyadmin' ?
u did ? ok then restart mysql 
the passwords load when mysql starts up... at least when u change it via 'phpmyadmin'
havent played much with command line password mods... may not need the restart.
i just pounded my head with the prob last week... running redhat with mysql PHP combo.
all worked after i restarted the mysql service from command line.

Joel Colombo


  Jennifer Fountain [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
  Here is the code:

  ?php
  $link = mysql_connect(xxx, x, x)
  or die(Could not connect:  . mysql_error());
  print (Connected successfully);
  mysql_close($link);
  ?


  WhenI try to connect, I get the following error:

  Warning: mysql_connect() [function.mysql-connect]: Access denied for user: '[EMAIL 
PROTECTED]' (Using password: YES) in /xxx//x//testdb.php on line 2
  Could not connect: Access denied for user: [EMAIL PROTECTED]' (Using password: YES)

  I know the userid and password work because I can connect to the db via phpmyadmin, 
etc.
  version
  mysql 3.23.52
  php 3


  I have google searched and archived searched but I cannot find anything on this 
error.  We recently changed the password. 

  Does anyone have any idea what is happening?

  Thanks

---End Message---
---BeginMessage---
It doesn't include the table name.  Use name, albumid, etc.

anders thoresson wrote:

Hi,

I've the query SELECT albums.name, albums.albumid, 
accessrights.albumid, accessrights.userid FROM albums, accessrights 
WHERE accessrights.userid = '$id' AND albums.albumid = 
accessrights.albumid.

It works allright. Using the result in a html SELECT-tag this way 
works:

while($row = mysql_fetch_array($result)) {
echo(OPTION VALUE=\$row[1]\ $row[0]);
}
But if I tries the following line, the script fails:

echo(OPTION VALUE=\$row['albums.albumid']\ 
$row['albums.name']);

with the notice:
Undefined index:  'albums.albumid' in 
bc:\web\thoresson.net\include\user_functions.php/b on line b24/b

I've been trying to learn PHP for three months now, but tonight was 
the first time I sat down with my project for two week, so I'm sorry 
if I'm bothering you with something obvious that I've just forgotten. :)

But I need to know: What am I doing wrong?

Best regards.

--
The above message is