Re: [PHP] What am I missing here?

2010-06-28 Thread Jay Ess

Rick Dwyer wrote:

Hello List.

I am completely at a loss for why the line of code below returns the 
desired value:


$PATH_INFO= substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRI
PT_NAME']), strlen($_SERVER['REQUEST_URI']));

BUT, putting the same line of code on 1 line fails to return anything:

$PATH_INFO= 
substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRIPT_NAME']), 
strlen($_SERVER['REQUEST_URI']));

strlen counts the newline so probably should you put a +1.

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



Re: [PHP] What am I missing here?

2010-06-21 Thread Simcha Younger
On Sat, 19 Jun 2010 13:21:02 -0400
Rick Dwyer rpdw...@earthlink.net wrote:

 Hello List.
 
 I am completely at a loss for why the line of code below returns the  
 desired value:
 
 $PATH_INFO= substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRI
 PT_NAME']), strlen($_SERVER['REQUEST_URI']));
 
 BUT, putting the same line of code on 1 line fails to return anything:
 
 $PATH_INFO=  
 substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRIPT_NAME']),  
 strlen($_SERVER['REQUEST_URI']));
 
 
 
   --Rick
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

It looks like since you broke your key in the first line, the value returned is 
0, since the key 'SRI PT_NAME' does not exist.
When you fixed this, SCRIPT_NAME was the same length as REQUEST_URI so nothing 
was returned.

look at the documentation on substr, you need to fix you parameters.
-- 
Simcha Younger sim...@syounger.com

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



[PHP] What am I missing here?

2010-06-19 Thread Rick Dwyer

Hello List.

I am completely at a loss for why the line of code below returns the  
desired value:


$PATH_INFO= substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRI
PT_NAME']), strlen($_SERVER['REQUEST_URI']));

BUT, putting the same line of code on 1 line fails to return anything:

$PATH_INFO=  
substr($_SERVER['REQUEST_URI'],strlen($_SERVER['SCRIPT_NAME']),  
strlen($_SERVER['REQUEST_URI']));




 --Rick



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



[PHP] What am I missing?

2006-03-07 Thread Gustav Wiberg

Hi there!

Why...

I have this code:

bAdd manufacturer:/bbr
form name=frmMan 
action=admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=?php echo 
$frmIDManufacturer;?frmModel=?php echo $frmIDModel;? method=post

input type=text size=30 name=frmManufacturerName
input type=submit value=ok
/form

When i press the submit - button, I get this error:

Not Found
The requested URL 
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found 
on this server.


Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL /mobilkamera/admin/phpfunctions/addnewmanufacturer.php was 
not found on this server.


???

If this is not a question that suits the list, please guide me tips where to 
look...


Best regards
/Gustav Wiberg

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



Re: [PHP] What am I missing?

2006-03-07 Thread Joe Henry
On Tuesday 07 March 2006 11:45 am, Gustav Wiberg wrote:

 form name=frmMan
 action=admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=?php
 echo $frmIDManufacturer;?frmModel=?php echo $frmIDModel;?
 method=post input type=text size=30 name=frmManufacturerName
 input type=submit value=ok
 /form

You could try using an absolute rather than a relative path:

 /mobilkamera/admin/phpfunctions/addnewmanufacturer.php
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



RE: [PHP] What am I missing?

2006-03-07 Thread Shaunak Kashyap
It is more of an HTML/HTTP question than PHP but here's my shot at a
possible explanation:

The file containing the form code seems to live in the
/mobilkamera/admin/ directory. Therefore action=admin/phpfunctions...
implies that the form is to be submitted to that path starting from the
current directory (i.e. /mobilkamera/admin/), which resolves to
/mobilkamera/admin/admin/phpfunctions...

One solution would be remove the admin/ from the action. Another (and
probably better solution) would be to use absolute paths, as Joe Henry
suggests.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


 -Original Message-
 From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 07, 2006 10:45 AM
 To: PHP General
 Subject: [PHP] What am I missing?
 
 Hi there!
 
 Why...
 
 I have this code:
 
 bAdd manufacturer:/bbr
 form name=frmMan

action=admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=?php
 echo
 $frmIDManufacturer;?frmModel=?php echo $frmIDModel;?
method=post
 input type=text size=30 name=frmManufacturerName
 input type=submit value=ok
 /form
 
 When i press the submit - button, I get this error:
 
 Not Found
 The requested URL
 /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not
found
 on this server.
 
 Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80
 
 Why is there TWO admins? Why isn't the path like this...?
 The requested URL
/mobilkamera/admin/phpfunctions/addnewmanufacturer.php
 was
 not found on this server.
 
 ???
 
 If this is not a question that suits the list, please guide me tips
where
 to
 look...
 
 Best regards
 /Gustav Wiberg
 
 --
 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 am I missing?

2006-03-07 Thread Gustav Wiberg


- Original Message - 
From: Shaunak Kashyap [EMAIL PROTECTED]
To: Gustav Wiberg [EMAIL PROTECTED]; PHP General 
php-general@lists.php.net

Sent: Tuesday, March 07, 2006 8:05 PM
Subject: RE: [PHP] What am I missing?


It is more of an HTML/HTTP question than PHP but here's my shot at a
possible explanation:

The file containing the form code seems to live in the
/mobilkamera/admin/ directory. Therefore action=admin/phpfunctions...
implies that the form is to be submitted to that path starting from the
current directory (i.e. /mobilkamera/admin/), which resolves to
/mobilkamera/admin/admin/phpfunctions...

One solution would be remove the admin/ from the action. Another (and
probably better solution) would be to use absolute paths, as Joe Henry
suggests.

Shaunak Kashyap

Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036

Direct: 323.330.9870
Main: 323.330.9900

www.worldpokertour.com

Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.



-Original Message-
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 07, 2006 10:45 AM
To: PHP General
Subject: [PHP] What am I missing?

Hi there!

Why...

I have this code:

bAdd manufacturer:/bbr
form name=frmMan


action=admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=?php

echo
$frmIDManufacturer;?frmModel=?php echo $frmIDModel;?

method=post

input type=text size=30 name=frmManufacturerName
input type=submit value=ok
/form

When i press the submit - button, I get this error:

Not Found
The requested URL
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not

found

on this server.

Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL

/mobilkamera/admin/phpfunctions/addnewmanufacturer.php

was
not found on this server.

???

If this is not a question that suits the list, please guide me tips

where

to
look...

Best regards
/Gustav Wiberg

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

Thanx!!!

/Gustav Wiberg

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



[PHP] what am I missing..interpolation?

2005-05-15 Thread blackwater dev
Hello,

this works fine:

$name=fido;
$string=my dog's name is $name;
echo $string;//prints my dog's name is fido

but when I store the string my dog's name is $name in the db and pull it out:

//do the query
$row=$datab-fetch();
$name=fido;
$string=$name['db_column'];
echo $string//prints my dog's name is $name

How can I get it to work with the db?

Thanks!

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



Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread Justin Gruenberg
On 15/05/05, blackwater dev [EMAIL PROTECTED] wrote:
 Hello,
 
 this works fine:
 
 $name=fido;
 $string=my dog's name is $name;
 echo $string;//prints my dog's name is fido
 
 but when I store the string my dog's name is $name in the db and pull it 
 out:
 
 //do the query
 $row=$datab-fetch();
 $name=fido;
 $string=$name['db_column'];
 echo $string//prints my dog's name is $name
 
 How can I get it to work with the db?

Not exactly sure if this will work, but try

echo eval($string)

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



Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread blackwater dev
Thanks for the info but I tried it both ways and get this error:

Parse error: parse error, unexpected T_FOR, expecting ',' or ';' in
dogs.php(11) : eval()'d code on line 1


On 5/15/05, Krid [EMAIL PROTECTED] wrote:
 Hi!
 Try
 eval(echo $string);
 
 blackwater dev wrote:
  Hello,
 
  this works fine:
 
  $name=fido;
  $string=my dog's name is $name;
  echo $string;//prints my dog's name is fido
 
  but when I store the string my dog's name is $name in the db and pull it 
  out:
 
  //do the query
  $row=$datab-fetch();
  $name=fido;
  $string=$name['db_column'];
  echo $string//prints my dog's name is $name
 
  How can I get it to work with the db?
 
  Thanks!
 


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



Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread Krid
Hi!
Try
eval(echo $string);
blackwater dev wrote:
Hello,
this works fine:
$name=fido;
$string=my dog's name is $name;
echo $string;//prints my dog's name is fido
but when I store the string my dog's name is $name in the db and pull it out:
//do the query
$row=$datab-fetch();
$name=fido;
$string=$name['db_column'];
echo $string//prints my dog's name is $name
How can I get it to work with the db?
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread Evert | Rooftop
Shouldn't that be:
eval(echo \$string\);
its pretty insecure though, be sure your users are not allowed to change 
the db field, because they can do some serious damage.

grt,
Evert
Krid wrote:
Hi!
Try
eval(echo $string);
blackwater dev wrote:
Hello,
this works fine:
$name=fido;
$string=my dog's name is $name;
echo $string;//prints my dog's name is fido
but when I store the string my dog's name is $name in the db and 
pull it out:

//do the query
$row=$datab-fetch();
$name=fido;
$string=$name['db_column'];
echo $string//prints my dog's name is $name
How can I get it to work with the db?
Thanks!

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


Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread Marek Kilimajer
blackwater dev wrote:
Hello,
this works fine:
$name=fido;
$string=my dog's name is $name;
echo $string;//prints my dog's name is fido
but when I store the string my dog's name is $name in the db and pull it out:
//do the query
$row=$datab-fetch();
$name=fido;
$string=$name['db_column'];
echo $string//prints my dog's name is $name
How can I get it to work with the db?
eval is an answer, but str_replace is much more secure:
$string = str_replace('$name', $name, $string);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread Richard Lynch
On Sun, May 15, 2005 8:27 am, blackwater dev said:
 Thanks for the info but I tried it both ways and get this error:

 Parse error: parse error, unexpected T_FOR, expecting ',' or ';' in
 dogs.php(11) : eval()'d code on line 1


 On 5/15/05, Krid [EMAIL PROTECTED] wrote:
 Hi!
 Try
 eval(echo $string);

I dunno where the T_FOR came from, but you may need a ; after $string:

eval(echo $string;);

I'm also guessing maybe $string doesn't have what you think it has...

echo string is: $stringhr /\n;

before you do the eval so you know what you are doing.

Or even:
$php = echo $string;;
echo evaluating: $phphr /\n;
eval($php);

Now you'll see the PHP code you are trying to run, right before the error
message about it.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] What am I missing with this code?

2002-11-08 Thread John Meyer
for($i=1;$i13;$i++) {
?
lia 
href=categoryresult.php?condition=?=urlencode(where
month(UserDOB)= . $i)??=jdmonthname($i,0)?nbsp;(?=$i?)/a/li
?php
}
?

All it's printing out is November and December, even though the month is
incrementing.


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




RE: [PHP] What am I missing with this code?

2002-11-08 Thread Ford, Mike [LSS]
 -Original Message-
 From: John Meyer [mailto:johnmeyer_1978;yahoo.com]
 Sent: 08 November 2002 11:45
 
   for($i=1;$i13;$i++) {
   ?
   lia 
 href=categoryresult.php?condition=?=urlencode(where
 month(UserDOB)= . 
 $i)??=jdmonthname($i,0)?nbsp;(?=$i?)/a/li
   ?php
   }
   ?
 
 All it's printing out is November and December, even 
 though the month is
 incrementing.

You don't seem to have grasped what a Julian day number is -- what you're producing 
here is the monthname of 12 consecutive days in IIRC about 4000BC which presumably 
just happen to fall in what would have been November and December had such months 
existed in that year!

This is a case where I really must suggest you RTFM, as there is a perfecxt example of 
what you want to do in the only user note at 
http://www.php.net/manual/en/function.jdmonthname.php

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] what am I missing here?

2002-08-15 Thread Alexander Ross

what am i missing here??  I have a simple if statement that wont do whats
inside it even when true.

this works:

   echo $key==$info_keys[0]; // returns 1 or 0 correctly
if($key==$info_keys[0])
  $query = $query;
else  $query = $query. and ;
$query = $query.$key.='.$val.';

this doesn't:
 // the $query = $query. and ; just doesn't get executed .. nor does any
other statment I put inside the if statement

   echo $key==$info_keys[0]; // returns 1 or 0 correctly
if(!$key==$info_keys[0])// if it isn't the first item in the array
 $query = $query. and ;
$query = $query.$key.='.$val.';



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




Re: [PHP] what am I missing here?

2002-08-15 Thread Rasmus Lerdorf

You are missing operator precedence.  ! is higher precedence than == so
your statement effectively becomes:

  if ( (!$key) == $info_keys[0])

which makes no sense.

Normally you would write that code as:

  if ( $key != $info_keys[0] )

-Rasmus

On Thu, 15 Aug 2002, Alexander Ross wrote:

 what am i missing here??  I have a simple if statement that wont do whats
 inside it even when true.

 this works:

echo $key==$info_keys[0]; // returns 1 or 0 correctly
 if($key==$info_keys[0])
   $query = $query;
 else  $query = $query. and ;
 $query = $query.$key.='.$val.';

 this doesn't:
  // the $query = $query. and ; just doesn't get executed .. nor does any
 other statment I put inside the if statement

echo $key==$info_keys[0]; // returns 1 or 0 correctly
 if(!$key==$info_keys[0])// if it isn't the first item in the array
  $query = $query. and ;
 $query = $query.$key.='.$val.';



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