[PHP] How to get folders names in a dir

2003-01-01 Thread Alexander Guevara
i need to get in a select box all the dirs inside a folder.. how can i do
that?




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




Re: [PHP] How to get folders names in a dir

2003-01-01 Thread Alexander Guevara
THX
John Nichel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 http://www.php.net/manual/en/ref.dir.php
 http://www.php.net/manual/en/function.is-dir.php


 Alexander Guevara wrote:
  i need to get in a select box all the dirs inside a folder.. how can i
do
  that?
 
 
 
 


 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com




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




[PHP] Making tr with $values!!!

2002-12-30 Thread Alexander Guevara
hi.. i have this and i cant get it work!!..


HERES THE CODE

---
for ($i=1;$i11;$i++){
echotr height='40px'

 td class='contenido' width='40%'bTEXT/b
  input type='text' name='nom$i' value='$nom$i'
 /td
/tr;
   }

---


so what i need is that the output in HTML shows tha value as is.. for
example the output of the  code above  is like this (im going to show only
the input  part thats the one i need to resolve!)

input type='text' name 'nom1'  value='1'

Remember the number depends on the $i.. i only showing one...
thats what that code generates... what i need is like this:

input type='text' name 'nom1'  value='$nom1'


So in conclusion what i need is the $nom1 for retrieving the value of that
variable later if an error ocurrs during a trasanction: (when an error
occurs and i have to go back to thhis page)


Thanks in advance!



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




Re: [PHP] Is there any method to filter the single quote fromastring?

2002-12-21 Thread Alexander Guevara
WEll for example i got this:
 In a field called name i write a name with single quotes for example 'Alex'
and click submit... in the verify.php i store the data i filled in the
form.php that contains name, surnmane,etcetc...

so when i save my data to the db i use the addslashes($name) in this case...
and the i look up the database and i see that the valeu oin my db for name
is like i wrote it in this cas 'Alex'.. that's perfect.. but when i try to
retrieve the user data in another page for example change_user.php i want to
retrive the user name and show it in a text box but it doesnt show up.. and
i have this code:
tdinput type='text' name='name' value='.stripslashes($userName).'
/td

where userName i retrieved from the data base with a simple query..

so tell me what is wrong there!...Thanks!

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
on 21/12/02 2:00 PM, Alexander Guevara ([EMAIL PROTECTED]) wrote:

 It works.. but when you retrieve the data from the database to a text box
it
 doesnt appear if it has the single quote ('), o tought it was cause i have
 the stripslashes but i delete stripslashes and it still doesnt appear in
the
 text box!

Huh?  I can't really understand what you're saying.

If you're adding stuff to a database, and getting an error, use
addslashes(), then on the way out of the database, you need to
stripslashes(). Easy.

If you don't get any errors, then magic quotes is probably enabled in your
php.ini file.


Justin




 Justin French [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 don't filter the quotes... escape them with add_slashes()

 justin

 on 20/12/02 10:50 PM, ªüYam ([EMAIL PROTECTED]) wrote:

 as title that I'm getting a trouble on filtering the single quote '  ,
 since
 there would be error when storing those string into MySQL, thus, i have
to
 find the appropriate method to solve it, anybody can help please?
 thx a lot







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




Re: [PHP] Is there any method to filter the single quote fromastring?

2002-12-21 Thread Alexander Guevara
Thanks.. i solved it but not with that solution.. ill give a try with it..
the way i solved was using ereg_replace before storing in the db and chnging
the ' and  with the html characters as you mention with htmlentities()

Thank you all for the responsees!.
John W. Holmes [EMAIL PROTECTED] wrote in message
000101c2a903$4672cd40$7c02a8c0@coconut">news:000101c2a903$4672cd40$7c02a8c0@coconut...
  WEll for example i got this:
   In a field called name i write a name with single quotes for example
  'Alex'
  and click submit... in the verify.php i store the data i filled in the
  form.php that contains name, surnmane,etcetc...
 
  so when i save my data to the db i use the addslashes($name) in this
  case...
  and the i look up the database and i see that the valeu oin my db for
 name
  is like i wrote it in this cas 'Alex'.. that's perfect.. but when i
 try to
  retrieve the user data in another page for example change_user.php i
 want
  to
  retrive the user name and show it in a text box but it doesnt show
 up..
  and
  i have this code:
  tdinput type='text' name='name' value='.stripslashes($userName).'
  /td

 I thought this was already covered today? First, you don't need
 stripslashes() on the data when you pull it from the database unless you
 have magic_quotes_runtime enabled. Second, slashes mean nothing in HTML.
 It doesn't recognize them as escape characters. The reason your data
 isn't appearing is because it's coming out with a value like
 value=''Alex'', which HTML sees as a value of '' and ignores the rest of
 the data and an unrecognized attribute.

 Finally, what you need to do is use htmlentities() or htmlspecialchars()
 on $userName before you place it between the quotes. This will give you
 a value of value='quote;Alexquote;', which will display correctly with
 HTML.

 ---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] No tshowing url in title bar....

2002-12-21 Thread Alexander Guevara
Dont know if this concerns to php genral.. but i want to know how can i do
for preventing showing the url in the title bar of the browser.. for example
i click a link that goes to a php page called verify.php and in the windows
browser title bar is show this.. http://www.server.com/verify.php

It is posssible to not show the url..  i mena show a title i dont know.

Thanks!



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




Re: [PHP] No tshowing url in title bar....

2002-12-21 Thread Alexander Guevara
ill try it.. about the address bar icoulc be very cool for doing it!
Larry Brown [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Before the body tag you have the head /head tags.  Place
titleTitle
 of the page/title and it will show up on the title bar instead of the
url.
 If you want to get rid of the address bar of the browser window, let me
know
 and I can post the javascript for creating that window.

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

 -Original Message-
 From: Alexander Guevara [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, December 21, 2002 12:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] No tshowing url in title bar

 Dont know if this concerns to php genral.. but i want to know how can i do
 for preventing showing the url in the title bar of the browser.. for
example
 i click a link that goes to a php page called verify.php and in the
windows
 browser title bar is show this.. http://www.server.com/verify.php

 It is posssible to not show the url..  i mena show a title i dont know.

 Thanks!



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





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




[PHP] the numeric key of an array???

2002-12-20 Thread Alexander Guevara
How can i do for printing the value of an array given the numeric key for
example i have this code:

$array = array (
'VAL1' = VALUE1,
'VAL2' = VALUE2,
'VAL3' = VALUE3
)

So the only way i have found to print the value is like this :
echo $array['VAL1'];

and it prints = VALUE1 but i want to know if its possible to do it something
like this:
echo $array[0];
i mean give the numeric key for printing VALUE1 so instead the string key
(VAL1) use the numerc (0)

Thanks in advance!



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




Re: [PHP] the numeric key of an array???

2002-12-20 Thread Alexander Guevara
Well which kind of methods are you talking about?? could you tell me some
for do it??

Thanks!

John W. Holmes [EMAIL PROTECTED] wrote in message
01c2a890$d1539cf0$7c02a8c0@coconut">news:01c2a890$d1539cf0$7c02a8c0@coconut...
  How can i do for printing the value of an array given the numeric key
 for
  example i have this code:
 
  $array = array (
  'VAL1' = VALUE1,
  'VAL2' = VALUE2,
  'VAL3' = VALUE3
  )
 
  So the only way i have found to print the value is like this :
  echo $array['VAL1'];
 
  and it prints = VALUE1 but i want to know if its possible to do it
  something
  like this:
  echo $array[0];
  i mean give the numeric key for printing VALUE1 so instead the string
 key
  (VAL1) use the numerc (0)

 You can't, because there is no key of zero in that array. All arrays are
 associative, so the only way to use $array[0] is to define $array[0].

 If you're looking to loop through your array, there are other methods.

 ---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] the numeric key of an array???

2002-12-20 Thread Alexander Guevara
Yeah this workes fine.. thanks!!

Philip Olson [EMAIL PROTECTED] wrote in message
Pine.BSF.4.10.10212210135051.36987-10@localhost">news:Pine.BSF.4.10.10212210135051.36987-10@localhost...

 No, but you can do this:

   $arr2 = array_values($array);

   print $arr2[0]; // VALUE1

 Regards,
 Philip Olson


 On Fri, 20 Dec 2002, Alexander Guevara wrote:

  How can i do for printing the value of an array given the numeric key
for
  example i have this code:
 
  $array = array (
  'VAL1' = VALUE1,
  'VAL2' = VALUE2,
  'VAL3' = VALUE3
  )
 
  So the only way i have found to print the value is like this :
  echo $array['VAL1'];
 
  and it prints = VALUE1 but i want to know if its possible to do it
something
  like this:
  echo $array[0];
  i mean give the numeric key for printing VALUE1 so instead the string
key
  (VAL1) use the numerc (0)
 
  Thanks in advance!
 
 
 
  --
  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] the numeric key of an array???

2002-12-20 Thread Alexander Guevara
Thanks.

it worked fine.. and the reply at the botton too..

Thank you so much!
John W. Holmes [EMAIL PROTECTED] wrote in message
000101c2a896$70aad5c0$7c02a8c0@coconut">news:000101c2a896$70aad5c0$7c02a8c0@coconut...
   If you're looking to loop through your array, there are other
 methods.

  Well which kind of methods are you talking about?? could you tell me
 some
  for do it??

 foreach($array as $key=$value)

 www.php.net/foreach

 while(list($key,$value) = each($array)

 www.php.net/each
 www.php.net/list

 $cnt = count($array);
 for($x=0;$x$cnt;$x++)

 www.php.net/count

 ---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] Is there any method to filter the single quote from astring?

2002-12-20 Thread Alexander Guevara
It works.. but when you retrieve the data from the database to a text box it
doesnt appear if it has the single quote ('), o tought it was cause i have
the stripslashes but i delete stripslashes and it still doesnt appear in the
text box!


Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
don't filter the quotes... escape them with add_slashes()

justin

on 20/12/02 10:50 PM, ªüYam ([EMAIL PROTECTED]) wrote:

 as title that I'm getting a trouble on filtering the single quote '  ,
since
 there would be error when storing those string into MySQL, thus, i have to
 find the appropriate method to solve it, anybody can help please?
 thx a lot





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