[PHP] Re: Database creating from XML file
Another idea of doing this task is using XSLT. XML file can be tranformed to a text SQL file, then it can be called by PHP scripts. That can't be hard to do that if you know XSLT. Bernardo De Barros Franco [EMAIL PROTECTED] wrote in message news:20021105203656.93604.qmail;pb1.pair.com... Hello PHP users, I've recently tried to find info about creating databases from XML files and didn't find anything. Since there is no php.XML I'm posting it in the general section. Does anyone know where I can find PHP source code that will parse an XML file and generate SQL queries that would create tables based on the structure described on the XML? Something like: xml = Database name='db1' Table name='Table1' Attribute name='foo1' type='int4' / /Table /Database ; and some function func(xml) would return a set of SQL queries that would create that database in a particular DB (say PostgreSQL or MySQL). Anything similar would help already. Thanks in advance, Bernardo de Barros Franco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Installation error with 4.2.3
Are you aware of register_globals = off? It might be the problem. You can set register_globals = on in php.ini or you better use $_POST, $_GET, $_SERVER ... eg. $fname - $_POST[finame] or $_GET[fname] Daniele Baroncelli [EMAIL PROTECTED] wrote in message news:20021106100419.63359.qmail;pb1.pair.com... No one replied to this message yet. I am trying to address it again, as probably the previuos newsmessage title wasn't very descriptive. Thanks Daniele = Hi guys, I have very weird problem. I have installed the PHP version 4.2.3 on the LINUX virtual server of my web project. Previously I had the PHP version 4.0.6. The error I get is very weird. When I insert a record with the phpMyAdmin, the first 4 characters of each field don't get saved. Same thing happened with some data entry interfaces I coded! The only difference I can see in the two installation (provided the php.ini file is in the same location): The old version 4.0.6 was installed by the server provider and my virtual server space I can only see the .so file. The new version 4.2.3 is actually inside my virtual server space. Hence, the path I provided in the php configuration is different (I don't have idea if this can influence something). NEW VERSION (4.2.3) configuration run by me './configure' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--prefix=/usr/home/rockit/usr/local' '--with-mysql=/usr/home/rockit/usr/local/mysql' '--with-xml' '--enable-xslt' '--with-xslt-sablot=/usr/home/rockit/usr/local' '--with-regex=system' '--with-expat-dir=/usr/home/rockit/usr/local' '--with-iconv=/usr/home/rockit/usr/local' '--enable-inline-optimization' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--without-pear' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-gdbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-ttf=/usr/local' '--enable-ftp' '--with-gd=/usr/local' '--with-zlib' '--enable-gd-native-ttf' OLD VERSION (4.0.6) configuration run by the server provider './configure' '--enable-inline-optimization' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--with-config-file-path=/usr/local/lib' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--with-gettext' '--without-pear' '--with-regex=system' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-iconv=/usr/local' '--with-gdbm=/usr/local' '--with-dbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--enable-ftp' '--with-curl=/usr/local/curl' '--with-openssl=/usr/local/openssl' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-t1lib=/usr/local' '--with-zlib' '--enable-gd-native-ttf' '--with-imap' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-dom=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib' '--with-zlib' I must admit that I didn't not include all parameter as the old installation, as I didn't know most options and thought is not needed. In the new installation I instead provided additional XML parameter (after installing the correspond modules, which all seem to work fine). Hints on problem are very well welcome! Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php4.2.2 remembers last GET and POST vars in HTTP_SESSION_VARS also
PHP 4.2.* has register_globals = off as a default. You variables has to be $_POST[fname] or $_POST[fname] or $_SERVER[PHP_SELF] etc., or you can simple incides one file eg. //extract.php ? extract($_SERVER); extract($_ENV); extract($_GET); extract($_POST); extract($_REQUEST); ? in your old codes... require_once extract.php; Alexander Piavka [EMAIL PROTECTED] wrote in message news:Pine.GSO.4.33.0211061433030.21449-20;indigo... Hi, we have upgraded from php4.0.6 to php4.2.2 The problem is that php4.2.2 remembers last GET and POST vars in HTTP_SESSION_VARS also. This ruins the functionality of many programs we are running. both 4.0.6 and 4.2.2 were configured and compiled with exactly the same parameters and we are using the same php.ini conf (which is attached in the mail) In the features added between 4.0.6 and 4.2.2 we did not notice any changes that make such a change in php behaviour. Please advise how can we fix this behaviour without making changes in the code. Thanks a lot ps. these are configure options for php4.0.6 and php4.2.2 we used. ./configure --prefix=/usr/local/web/progs/php-4.0.6 --with-db3 --with-db --w ith-jpeg-dir -with-tiff-dir \ --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar d-path --with-openssl \ --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab le-shared \ --with-gnu-ld --enable-versioning --enable-static --with-config-file-path= /usr/local/web/apache-php/conf \ --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach e-php/bin/apxs \ --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s sl --without-dmalloc \ --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring ./configure --prefix=/usr/local/web/progs/php-4.2.2 --with-db3 --with-db -- with-jpeg-dir -with-tiff-dir \ --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discar d-path --with-openssl \ --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enab le-shared \ --with-gnu-ld --enable-versioning --enable-static --with-config-file-path= /usr/local/web/apache-php/conf \ --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apach e-php/bin/apxs \ --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-s sl --without-dmalloc \ --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Installing extensions (winXP)
Some extensions are like not 100% available for Win32 environment. I use PHP 4.3.0pre2, Apache 2.0.43 and J2SDK 1.4.1 For XML, you need expat-1.95.5 and copy libexpat.dll to c:\windows\system32. For XSLT, you need sablot-0.96 and copy sablot.dll to c:\windows\system32. //php.ini extension_dir = C:\php\extensions [Java] java.class.path = c:\php\extensions\php_java.jar;d:\apache2\htdocs\classes // that's right I place all my java classes here \classes java.home = c:\j2sdk1.4.1\bin java.library = c:\j2sdk1.4.1\jre\bin\client\jvm.dll java.library.path = c:\php\extensions ;Windows Extensions extension=php_xslt.dll ; for XML don't have to do anything it's built-in module extension=php_java.dll Davy Obdam [EMAIL PROTECTED] wrote in message news:004c01c28c2e$3dcd8aa0$960a;hewlett0bg96om... Hiya people, I want to install some extensions like PDF and XSLT, curl etc. I have the GD libary installed in my php.ini like this: extension=php_gd.dll. When i try to un quote the other extensions and restart Apache i get errors, that he could load this extension. Also i have done this in my php.ini : ; Directory in which the loadable extensions (modules) reside. extension_dir = C:\Program Files\PHP\extensions , is this alright? If i look at my phpinfo(); it does show those extensions but stil i get errors. I use Windows XP home with Apache 2.0.40 and PHP 4.2.3 installed as a apache(sapi) module. Can anyone help me, any help is apreciated. Also wich extensions should i use or wich are most commonly used? Thanks already... Best regards, Davy Obdam mailto:info;davyobdam.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: combo box
If I were you, I do this way. // in your HTML form. select name=flag option value=1 Husband/option ... /select // DB then insert 1, 2, 3, 4. //it will be one of them from flag variable. // when you retrieve it... if (flag == 1) echo Husband if ... and so on. :) Kang Chan Hweefarn Saputra wrote: hi :) i am creating a webpage. i use a combo box to let user choose which folder they want. after they choose, it will be saved into the database. the next time they load this page, it will retrieve the data from database and appear at the combo box. i already done that. but now the problem isthe data that i retrieve from the database will same with the options in the combo box. so, it will become 2 same options. i am afraid this will confuse the user. so i want to fix it. if u dont understand what i mean, try look at the picture coding below: folder: husband friend family boss husband ___ this is the code: select size=1 name=groupMailbox1 option?php echo $row[groupMailbox1]; ?/option ?php //Open Directory you want to include //$base='/home/a/mail'; $handel = opendir($base); //Get contents of the directory while (false !== ($file = readdir($handel))) { if (is_dir($base . / . $file) ($file !== .) ($file !== ..)) { list($filename, $ext) = explode(., $file); list($main, $sub, $include) = explode(/, $PHP_SELF); echo option value=\$file\; //Echo the file name in a combo box if ($inc==$file) echo selected; echo$file/option\n; echo $file; } } ? /selectp/p ___ how to make it so that the data that we retrieve from database, if same with the options we have, we only need to make that option selected? thanks :) hweefarn __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: i want help,thanks
the use of session is not correct. :( if u use php 4.1x .. as u do... u got to follow new standard. (see below) wrote: Hello: I want your help! The session sometime works well,sometime works badly! It creates new empty file in /tmp.I also find this problem with apache1.3.12php4.1.1sybase11.9.2linux My php.ini is fault my server config: php4.3.3 httpd2.0.44 linux 9 sybase-11.9.2 tar-vzxf php-4.3.3.tar.gz ./configure ?with-apxs2=/home/apache/bin/apxs ?with-sybase-ct=/opt/Sybase-11.9.2 ?enable-ftp ?enable-track-vars ?disable-cli make make install cp php.ini-dist /usr/local/lib/php.ini Thanks a lot Reproduce code: --- login.php: $user_array=sybase_fetch_row($result); session_start(); session_register(user_array); $_SESSION[yoursession] = $yourvars; ... index.php: session_start(); $user_name=$user_array[1]; what's your intension here? do u want to validate whether a user is logged in or not. then do this way. if (isset($_SESSION{yoursession])) { echo you are a user; } else { echo plz login !!!; } :) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and Intranets
Colin Eldridge wrote: Hi, my name is Colin Eldridge, teacher from Australia. Hello Colin, Australia! I'm here in Wollongong Uni. I am relatively new to PHP. I have set up a small intranet for my students to build and use interactive webpages. The intranet: A server(P4, XP) running Apache, MYSQL and PHP (from Janet Valade's text with CD-ROM) and 3 hosts running P2, Win98 and using IE or Mozilla as intranet browsers. Students use a browser on the 3 hosts to access PHP scripts from the server, which then deliver HTML forms back to the originating host. Hosts 'post' completed forms to server, and PHP scripts connect to the MYSQL server to update a database. Question: Is there a simple way for PHP to identify which host a form has come from? The network names of the 3 hosts are stu1, stu2 stu3. Some type of unique host Id is needed by the PHP scripts to contruct database records. For this exercise, we are not using PHP sessions, and the students do not have usernames and passwords for access to the database. Access is automatic after each host is logged onto the intranet. Yes, there is .! use env. variables. $_SERVER[SERVER_NAME] $_SERVER[REMOTE_ADDRESS] // i think this is what u r looking for if u would lke to find out more... // test.php ? echo phpinfo(); ? :) Thanks very much for your time. Regards Colin Eldridge -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 + PHP
it doesn't matter! whatever u think, and what your job is. it's all up to IT manager(?) are they listen to us or do they know what's the newest verion in php or mysql. i wouldn't think so (it got to kidding!) as we are professional... we got to act like a real prof. but.. ? here u go! my dev. env. is on win2k pro + sp4, php 5.00b2, apache 2.0.48, mysql 4.0.16, MS Access(?), XML, XSLT and without worries. production env. - i do not care (actually i can't do anything about it.) but recommend whatever linux (free), and php 4.3.4, apache 2.0.48, and mysql 4.0.16. in real life, our server runs php 4.1x, mysql 3.0x, apache 1.3.x. (register_globals = on, what a life, but i codes it eveything for OFF so that it should work later on if they upgraded it php 5.0x, r they?). is there anyone check updates except us. that's my story. Yves Arsenault wrote: Would anyone know of the issues that might affect PHP 4.3.4 and Apache 2.0.48 ? Thanks, Yves -Original Message- From: Martin Hudec [mailto:[EMAIL PROTECTED] Sent: 5 dcembre 2003 10:52 To: PHP-General Subject: Re: [PHP] Apache 2 + PHP Hi there, when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed from Gentoo portage. It was running 10 smallscale php/mysql based virtualhosts without any difficulties. On Friday 05 December 2003 15:24, Yves Arsenault wrote: Is this warning outdated? http://www.php.net/manual/en/install.apache2.php Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows. I'm running RedHat 9. I've got Apache 2.0.48 running and was ready to install the latest php 4.3.x.. Just thought I would check. -- : :. kind regards :.. Martin Hudec :.: :.: =w= http://www.aeternal.net :.: =m= +421.907.303393 :.: [EMAIL PROTECTED] [EMAIL PROTECTED] :.: :.: When you want something, all the universe :.: conspires in helping you to achieve it. :.: - The Alchemist (Paulo Coelho) -- 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