[PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Mindaugas L

Hello,

The basic problem is that the way a $_POST variable gets processed is
in the order it is in on the original form. 
I think it's very natural behaviour.

But be careful with associative arrays, I think before version
5.12.there was a bug, if you want that PHP makes an associative array
of form elements.
http://bugs.php.net/bug.php?id=37276

Enjoy

Mindaugas

On 6/9/06, Ben Liu [EMAIL PROTECTED] wrote:

Hi Mike,

Thanks for pointing that out. I hadn't thought of it but you are
right. But I still don't think this addresses the issue of ordering.
The basic problem is that the way a $_POST variable gets processed is
in the order it is in on the original form. If you want to present the
fields in one manner and process them in a different order, you have
to either use styling tricks to change the presentation order or use
some post processing to change the order of the array or use
potentially a ton of if statements or as Joao suggests, a long
switch statement. Anyhow, thanks for the tip.

- BL

On 6/9/06, Ford, Mike [EMAIL PROTECTED] wrote:

 I know you've found another (perfectly good) solution already, but I just
wanted to point out that you could have used the above scenario with the
names as the array indexes, like:

input type=checkbox name=bool_questions[first_name] value=yes

 The above input shows up in $_POST['bool_questions']['first_name'], so you
could iterate over $_POST['bool_questions'] to get the result you want.


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





--
Mindaugas

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



[PHP] Re: popup window from php page

2006-06-08 Thread Mindaugas L

Yeah, just echo JavaScript, which opens popup page. Remember php is
server side language.

On 6/8/06, William Stokes [EMAIL PROTECTED] wrote:

Hello,

How do I open a popup window from php code when a web page is loaded? Does
it require javascript usage?

Thanks
-Will

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





--
Mindaugas

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



Re: [PHP] storing single and double quote in MySQL

2006-05-25 Thread Mindaugas L

Yesterday I read this discussion and looked at php manual for
mysql_real_escape... There is good example with extra function to check php
magic quotes status. I like the idea, because the code is more portable. You
don't have to add .htaccess files nor configre php..

Beginner Mindaugas


On 5/24/06, tedd [EMAIL PROTECTED] wrote:


At 8:14 PM +0200 5/24/06, [EMAIL PROTECTED] wrote:
if magic_quotes_gpc is On, does it add slashes in front of quotes when
submit through form?
Mean, if I submit in input form (text) afan's crazy web, after
echo $_POST['record'];
I'll get afan\'s \crazy\ web. Is this because of magic_quote_gps is On?

-afan

afan:

You're getting the idea. Whatever is in your mysql dB should look
just like it would in print with quotes and all -- and without any
escape characters preceding them.

So, if your records in mysql (when viewed via something like
myphpadmin) have something like this O\'Mally, then the data is
wrong. It should be O'Mally and thus somewhere you, or
magic_quotes, have added slashes.

So, backup to your original data, turn magic_quotes OFF, use
mysql_real_escape_string to prepare the data and then add that data
to your mysql.

Upon retrieval of the data from mysql -- if -- you want to show it to
a browser, then use htmlentities. Remember mysql_real_escape_string
IN and htmlentities OUT and the world will be well.

I don't know if you are working in the same type of environment as
me, but I fixed mine by adding a .htacess file to my root. The code
is simply a text file like so:

php_value magic_quotes_gpc 0
php_value magic_quotes_sybase 0
php_value magic_quotes_runtime 0

That might work for you -- others on this list may have more detailed
information.

In any event, IMO do everything you can to turn magic_quotes OFF
because after that, then everything will be easier and you'll never
have to worry about when, or if, you should add_lashes, strip_lashes,
and other such confusing stuff.

hth's

tedd
--


http://sperling.com  http://ancientstones.com  http://earthstones.com

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





--
Mindaugas


Re: [PHP] calling JS function from php

2006-05-25 Thread Mindaugas L

Hi,

print needs escaping, so fix style=\\. Read XHTML requirements.
span style=padding-left:14.2cmfont size=2 face=Arial
color=#55script type=\text/javascript\;

I see you are missing semicolon when calling clientDate(); The same for
clientTime(); Javascripts need semicolons at the end of statement.



in the beginning style must be



On 5/25/06, Rabin Vincent [EMAIL PROTECTED] wrote:


On 5/25/06, suresh kumar [EMAIL PROTECTED] wrote:
 I am facing one problem in my project.I am trying to call a javascript
function from php.but it not executing.this is my code.

You can't call a javascript function from php. What you can
do is output javascript code that calls a javascript function.

function clientTime() {

 var cNow = new Date();
 var cHour = cNow.getHours();
var cMin  = cNow.getMinutes();
var hour= cHour + : + cMin;
return hour;
} //End function clientTime
   function clientDate() {
  var cDate  = new Date();
   var clientYear = cDate.getFullYear();
   var clientMonth = cDate.getMonth();
   var clientDay   = cDate.getDate();
   var year= clientYear + - + clientMonth + - + clientDay;
   return year;
 } //End function clientDate


   ? print span style=padding-left:14.2cmfont size=2 face=Arial
color=#55script type=\text/javascript\;
 print clientTime();
 print clientDate()/script/font/span; ?

Your functions are returning values, but you aren't printing out
those values. Try:

   print document.write(clientTime());;

Rabin

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





--
Mindaugas


Re: [PHP] Escaping double quotes

2006-05-25 Thread Mindaugas L

or heredeoc syntax :)

On 5/25/06, John Nichel [EMAIL PROTECTED] wrote:


Pavleck, Jeremy D. wrote:
 So I'm writing this page (PHP Newbie here) and it checks to see if a var
 is set, if it isn't it spits out the form info like so: echo form
 action=myform.php method=post;
 Now is there a way to 'wrap' that so I don't have to escape quotes?
 Something like perls 'qq' function is what I'm looking for.
 I tried a few different functions from the website, magic_quotes,
 addslashes, htmlspecial etc etc but none did what I was looking for



http://us2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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





--
Mindaugas


[PHP] how include works?

2006-05-23 Thread Mindaugas L

Hi

can anybody explain how require works, and what's the difference between
_once and regular? What's going on when php file is processed? In manual is
written just, that it's readed once if include_once. What does to mean
readed? Thank You
--
Mindaugas


[PHP] Fwd: Error loading php_mysql.dll

2004-11-16 Thread mindaugas kuksa

Note: forwarded message attached.




__ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 
---BeginMessage---
Hello,

I write to you because I want to ask you something
about PHP extensions.

The problem is that when I start my web server, PHP
module gives me an error: PHP Startup: Unable to load
dynamic library '...' - The specified module could not
be found. BUT THEY ARE!!! A part of my php.ini file
is:

;;
; Dynamic Extensions ;
;;

  extension=php_bz2.dll
  extension=php_cpdf.dll
; extension=php_curl.dll
  extension=php_dba.dll
  extension=php_dbase.dll
  extension=php_dbx.dll
;+extension=php_exif.dll
; extension=php_fdf.dll
  extension=php_filepro.dll
  extension=php_gd2.dll
  extension=php_gettext.dll
; extension=php_iconv.dll
; extension=php_ifx.dll
; extension=php_iisfunc.dll
  extension=php_imap.dll
; extension=php_interbase.dll
; extension=php_java.dll
; extension=php_ldap.dll
  extension=php_mbstring.dll
; extension=php_mcrypt.dll
; extension=php_mhash.dll
  extension=php_mime_magic.dll
  extension=php_ming.dll
; extension=php_mssql.dll
; extension=php_msql.dll
; extension=php_mysql.dll
; extension=php_oci8.dll
; extension=php_openssl.dll
; extension=php_oracle.dll
; extension=php_pdf.dll
  extension=php_pgsql.dll
  extension=php_shmop.dll
  extension=php_snmp.dll
  extension=php_sockets.dll
; extension=php_sybase_ct.dll
  extension=php_tidy.dll
; extension=php_w32api.dll
  extension=php_xmlrpc.dll
  extension=php_xsl.dll
; extension=php_yaz.dll
; extension=php_zip.dll 
  extension=php_exif.dll

These lines starting with semicolon shows modules i
was not able to load. I have heared that if you want
to load some modules, you have to load other modules
first. So i tried to shift modules, which i could not
load, to the end of the list. It worked out only for
the php_exif.dll module. Others still do not work.

The question is...what do i have to do to get them
working?
(well in fact i only want to start php_mysql.dll)

PS.: my system is:
OS: WinXP Pro
WEB: Apache v2.0.50, PHP v5.0.2

HELP PLEASE:)

Mindaugas Kuksa
[EMAIL PROTECTED]
+37067106156

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

[PHP] Hosting +PHP

2003-10-24 Thread Mindaugas
Hi,

How to do secure web server hosting +PHP? I don't want clients to see
filesystem usage, processes, etc. - even readonly on filesystem root /,
except on WWW CHROOT for example/home/user1.

Thanks

-- 
Mindaugas

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