Re: [PHP] Multi-Sort -- how to do this?
...Sticking my neck out playing with the big boys (and girls) now... I assume you've looked at array_multisort() for this, I would think you could have multiple arrays being sorted with it (I've only ever used it for 2-array sorts). The other option would be to pop all those arrays into a single array and use array_multisort()'s ability to sort arrays-within-arrays. Otherwise Ashley's solution is another possibility; using the keys in the sorted $d to dictate where you could place the elements in the other arrays. I'd say you could do a nifty loop system which says sequentially read the indices in $d and then make a new temp array that is $a, $b or $c (depending on which you are sorting) in the sorted order then just name the temp array as the original (again, I'd say array_multisort() is fancier than this crude but elegant system). Finally, why not use quicksort or mergesort for the sorting? Bubblesort is inefficient for large lists...
RE: RES: [PHP] paging
MySQL From: zechim@gmail.com To: tedd.sperl...@gmail.com; jd...@hotmail.com; php-general@lists.php.net Subject: RES: [PHP] paging Date: Tue, 10 Feb 2009 11:33:42 -0200 MySql or MsSql or other dB? -Mensagem original- De: tedd [mailto:tedd.sperl...@gmail.com] Enviada em: terça-feira, 10 de fevereiro de 2009 11:26 Para: Jim Douglas; php-general@lists.php.net Assunto: Re: [PHP] paging At 3:26 AM + 2/10/09, Jim Douglas wrote: Does anyone have a link to any examples of paging? Jim: Sure. http://webbytedd.com/bbb/paging/ -- the code is there different examples here: http://webbytedd.com/ccc/pagination Cheers, 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 _ Windows Live™: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_022009
RE: [PHP] paging
I saw your site originally. I have paging working and I also have this example working, http://www.w3schools.com/php/php_ajax_database.asp My problem is not getting paging to work, it's getting paging to work outputting the results of clicking on the page number to the content pane. I have a CSS that has left, right, header, footer and a content pane. After I click on the drop down it outputs to the content pane just fine. Thanks, Jim Date: Tue, 10 Feb 2009 08:26:23 -0500 To: jd...@hotmail.com; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: Re: [PHP] paging At 3:26 AM + 2/10/09, Jim Douglas wrote: Does anyone have a link to any examples of paging? Jim: Sure. http://webbytedd.com/bbb/paging/ -- the code is there different examples here: http://webbytedd.com/ccc/pagination Cheers, 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 _ Windows Live™: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009
[PHP] paging
Does anyone have a link to any examples of paging? I have this example up and running, http://www.w3schools.com/php/php_ajax_database.asp I have paging working as below, my problem is when I add a CSS style sheet I now have 4 panes. How can I direct the paging results to the content pane? ?php $q=$_GET[q]; $start=$_GET[start]; $con = mysql_connect('localhost', 'root', 'mypassword'); if (!$con) {die('Could not connect: ' . mysql_error());} mysql_select_db(bar, $con); $page_name=getbars.php; if(!isset($start)) {$start = 0;} $sql2=select * from bars WHERE geog_id = '.$q.'; $result2=mysql_query($sql2); echo mysql_error(); $nume=mysql_num_rows($result2); $eu = ($start - 0); $limit = 10; $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $sql=select * from bars WHERE geog_id = '.$q.' limit $eu, $limit; $result = mysql_query($sql); echo table border='0'; while($row = mysql_fetch_array($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ff';} else{$bgcolor='#f1f1f1';} echo tr ; //echo td align=left bgcolor=$bgcolor id='title'nbsp;font face='Verdana' size='2'A HREF= . $row['bar_website'] .. $row['bar_name'] . /A/div/font/td; echo div id='lbBarList' /div; echo td align=left bgcolor=$bgcolor id='title'nbsp;font face='Verdana' size='2'A HREF= . $row['bar_website'] .. $row['bar_name'] . /A/div/font/td/div; echo /tr; } echo /table; if($nume $limit ){ // Let us display bottom links if sufficient records are there for paging /// Start the bottom links with Prev and next link with page numbers / echo table align = 'center' width='50%'trtd align='left' width='30%'; if our variable $back is equal to 0 or more then only we will display the link to move back if($back =0) { print a href='$page_name?start=$back'font face='Verdana' size='2'PREV/font/a; } } echo /tdtd align=center width='30%'; $i=0; $l=1; for($i=0;$i $nume;$i=$i+$limit){ if($i $eu){ //echo a href='$page_name?start=$i'font face='Verdana' size='2'$l/font/a ; echo a href='$page_name?start=$i'font face='Verdana' size='2'$l/font/a ; } else { echo font face='Verdana' size='4' color=red$l/font;} $l=$l+1; } mysql_close($con); _ Windows Live™: Keep your life in sync. http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_022009
Re: [PHP] Google Chrome
Beta or not, it's still amazingly fast. Despite the fact you can't scroll up with the mouse wheel...
Re: [PHP] Google Chrome
Once. 'Nuff said.
[PHP] PHP MS-Word plugin
Hi everyone, I'm pretty sure that this question has been asked to death in the past, but I'm just curoius as to whether there is a plugin that can edit Microsoft Office Word documents in PHP. I'm interested in this because I am trying to put a text watermark on each page, but doing it online, without having to download the document, watermarking it, and then reuploading it (I won't deny that I'm lazy). So my question is has this even been done before? I've had a little search around and nothing exciting has popped out, so I'm wondering if anyone has used/heard of/made something as daunting as this before? Thanks in advance, DT
[PHP] Problem using PHP with Apache (probably something silly)
Hello, First off, I hope everyone had Happy New Year. Onto business, I am trying to install PHP 5.2.0 on a WinXP computer, using Apache 2.2.3 as the web server with MySQL enabled extension. My problem is that when I start up Apache with the edited httpd.conf file including the following code: # For PHP 5 do something like this: LoadModule php5_module c:/php/php5apache2_2.dll AddType application/x-httpd-php .php # configure the path to php.ini PHPIniDir C:/php And then trying a simple phpinfo() test on it, it gives the following error. The instruction at 0x007874cd referenced memory at 0x0014. The memory could not be read. The dumprep.exe message has the following interesting information: szAppName: httpd.exe szModName: php5ts.dll offset: 000974cd I'm wondering 3 things: Has this happened to anyone else when they were trying to install PHP on Apache? Is there any advice people can give me? Is there any relatively hassle free approach to manually fix this annoying problem? Thanks in advance, D.T.
Re: [PHP] Problems with PHP and MySQL
disregard if you've already done this... you might want to do a quick php app with phpinfo, to determine if/what version of mysql php sees.. it's quite possible that php isn't seeing/interfacing with mysql. php needs to not only be built with a version of mysql, but the php.ini file also needs to be setup correctly. -bruce -Original Message- From: Jochem Maas [EMAIL PROTECTED] Sent: Feb 5, 2005 8:46 AM To: Sarah [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Problems with PHP and MySQL Sarah wrote: Hi, I'm relatively new to PHP, but have already written a few functional web-based scripts. I recently decided to implement a MySQL-based system, but hit the following problem... I have PHP version 5.03, and MySQL v 4.19. I downloaded and compiled both, and both work perfectly alone. However, when I run a command-line app to manipulate my database, I get the following error: __ [EMAIL PROTECTED]:~# ./useradmin -a -u unclebulgaria -p uberwomble constructor called Fatal error: Call to undefined function mysql_connect() in veep/useradmin on line 16 Fatal error: Call to undefined function mysql_close() in /veep/useradmin on line 22 [EMAIL PROTECTED]:~# __ I _think_, given the version of MySQL you are using, you should compile in and use the mysqli extension iso of the mysql extension. ^! these to links may help you: http://www.zend.com/php5/articles/php5-mysqli.php http://be.php.net/mysqli failing that you might want to check this page for an overview of funcs you can use to determine exactly what is available, with more accuracy than phpinfo() e.g.: var_dump( extension_loaded(mysql), extension_loaded(mysqli), get_loaded_extensions(), get_extension_funcs (mysql), get_extension_funcs (mysqli) ); -- 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 PHP and MySQL
sarah... rather than deal with classes/objs... (at least initially) just create a simple php/mysql app that sets up the user/passwd/host for the db, and see if you can do a successful mysql_connect check the return/error codes to see if the call/code works this will quickly tell you if you actually have php/mysql setup properly... once you've done this... you can get into the guts of your app, to determine where the prob is -bruce -Original Message- From: Sarah [EMAIL PROTECTED] Sent: Feb 5, 2005 7:41 AM To: php-general@lists.php.net Subject: [PHP] Problems with PHP and MySQL Hi, I'm relatively new to PHP, but have already written a few functional web-based scripts. I recently decided to implement a MySQL-based system, but hit the following problem... I have PHP version 5.03, and MySQL v 4.19. I downloaded and compiled both, and both work perfectly alone. However, when I run a command-line app to manipulate my database, I get the following error: __ [EMAIL PROTECTED]:~# ./useradmin -a -u unclebulgaria -p uberwomble constructor called Fatal error: Call to undefined function mysql_connect() in veep/useradmin on line 16 Fatal error: Call to undefined function mysql_close() in /veep/useradmin on line 22 [EMAIL PROTECTED]:~# __ You might think 'Aah! the doofus has forgotten to link MySQL into the compiled PHP interpreter'. However, my phpinfo() page gives the following information: __ Configure command: './configure' '--with-apxs2=/opt/apache/sbin/apxs' '--prefix=/usr' '--sysconfdir=/etc/php5' '--with-dba' '--with-db4' '--with-auth' '--with-zlib' '--with-tiff' '--with-jpeg' '--with-mysql=/usr' __ And... __ MySQL-related data: mysql MySQL Support enabled Active Persistent Links 0 Active Links0 Client API version 4.1.9 MYSQL_MODULE_TYPE external MYSQL_SOCKET/tmp/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib -lmysqlclient Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host localhost localhost mysql.default_password wurms wurms mysql.default_port 33063306 mysql.default_socketno valueno value mysql.default_user wiggly wiggly mysql.max_links Unlimited Unlimited mysql.max_persistentUnlimited Unlimited mysql.trace_modeOff Off _ Finally, the client program is: _ #!/usr/bin/php ?php class UserDB { static $user='wiggly'; static $pass='wurms'; static $db='multimedia_access'; private $m_link; private $m_live; function __construct() { print(constructor called\n); $this-m_link = mysql_connect('localhost', self::$user, self::$pass); $this-m_live = mysql_select_db(self::db); } function __destruct() { mysql_close($this-m_link); print(destructor called); } function Add($u, $p) { $H = md5($u, true); // $R = mysql_query(INSERT INTO users (userkey, user, password) values ($H, $u, $p), $this-m_link); $S = mysql_real_escape_string(INSERT INTO users (userkey, user, password) values ('$H', '$u', '$p'), $this-m_link); $R = mysql_query($S, $this-m_link); if (!$R) { printf(SQL query error during Add operation\n); } return $R; } function Delete($u) { $H=md5($u, true); $R=mysql_query(DELETE FROM users WHERE userkey=$H); if ($R) { $R=mysql_query(DELETE FROM iplist WHERE userkey=$H); } if (!$R) { printf(SQL query error during Add operation\n); } return $R; } function Replace($u, $p) { return 0; } function Tabulate() { $R=mysql_query(SELECT user,password FROM TABLE users); if (!$R) { printf(SQL query error during List operation\n); }
[PHP] in need of php code for user management/admin function...
hi... i'm looking for 'open source' code that can be used in a website for handling user registration, user admin functions... does anybody know of a good set of functions that can provide this kind of feature set. or, can anybody give me opinions regarding apps that you've used that have had this kind of functionality... as long as the code is open source, i can rip out/recode the functionality that i'm looking for... i'm looking for something that would be mysql based, with the ability to allow users to register/login, and have an admin function that allows the admin to deny/enable/disable users, as well as track various attributes within the site... if i have the basic shell/structure, i can modify the code to my needs.. comments/criticisms/thoughts... thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] in need of a directory/listing script/app
hi... i'm looking for a good app/function/code to allow users to select a given item(s) from a list of categories. i'd also like the user to be able to display users who have selected a given category from the list... i can't seem to find an app that has this kind of code incorporated... thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ldap functionality
hi... i'm in need of an app that has/should have directory/user/member functionality. i want to setup a process to allow an adim to create different fields and categories for a user to enter. think of a company employee database, where you have the employe name, and then the various groups/projects the employee might belong to... i'm trying to figure out if there's already an app that you may have run across that kind of does this, and if you haven't, what might be the best soln/easiest soln to implement.. i've started to research ldap, but i'm not sure that this is the best approach (given that i have no experience with ldap!) i'm open to a php/perl/linux/mysql/apache solution. searching through php/google hasn't turned up anything as of yet... if you have any thoughts let me know... thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Understanding intval() and types conversion
so... you're saying that 7.9 (repeating) is equal to 8.0 i say prove it.. as i recall the numbers might be for all practical purposes the same, they are in fact vastly different... so, prove your assertion... -bruce -Original Message- From: Richard Lynch [EMAIL PROTECTED] Sent: Jan 25, 2005 2:57 PM To: Jochem Maas [EMAIL PROTECTED] Cc: Jordi Canals [EMAIL PROTECTED], PHP List php-general@lists.php.net Subject: Re: [PHP] Understanding intval() and types conversion my guess this is a round error issue - never noticed this problem before... this is a problem right? anybody? You can say it is a round error issue. You can not say it is a problem. You simply have to be aware that the float number which you think of as 8.... inside of PHP may well be represented as 7.... down in the guts of the machine. It may help you feel better about this if you recall from grade school mathematics, that, in point of fact: 7.999... is EXACTLY equal to 8.000... Those who doubt this fact are requested to remember how to convert decimals such as: 0.333... to fractions (1/3), and then apply that exact same method to 7.999... You will quickly find yourself with a fraction (72/9) which is precisely equal to 8/1 which is 8. EVERY floating point number, then, that ends in x000... has a second representation, exactly equal, which ends in (x-1)999... Bottom line, however you look at it, is that you can NEVER be 100% certain that a computer's float number will convert to what you expect in an integer because their internal representation simply does not allow for perfection. This is a feature, not a bug. :-) -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Understanding intval() and types conversion
no.. he didn't. 8.0 = 8.0 7. (repeating) = 7. (repeating) 8.0 != 7. (repeating) now, if you want to get into conversations with regards to internal binary representations because of the limits of the register architecture in computers, then i might say the issue is the fact that the algorithms employed within the hardware are flawed... but let's not start screwing with basic math theory the statement that he uses where he states that there is a limit to the level of precision is lazy at best... (from a mathmatical perspective) or can i simply say, 15000 = 14,800 based upon my level of precision -bruce -Original Message- From: Jochem Maas [EMAIL PROTECTED] Sent: Jan 25, 2005 3:42 PM To: Bruce Douglas [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], Jordi Canals [EMAIL PROTECTED], PHP List php-general@lists.php.net Subject: Re: [PHP] Understanding intval() and types conversion Bruce Douglas wrote: so... you're saying that 7.9 (repeating) is equal to 8.0 i say prove it.. as i recall the numbers might be for all practical purposes the same, they are in fact vastly different... so, prove your assertion... he did. you have to consider the two the same, given that there is always a limit to the level of precision - the alternative would be to say no 2 numbers are ever equal and that make for boring mathematics. actually the underlying maths kinda makes my head spin :-) -bruce -Original Message- From: Richard Lynch [EMAIL PROTECTED] Sent: Jan 25, 2005 2:57 PM To: Jochem Maas [EMAIL PROTECTED] Cc: Jordi Canals [EMAIL PROTECTED], PHP List php-general@lists.php.net Subject: Re: [PHP] Understanding intval() and types conversion my guess this is a round error issue - never noticed this problem before... this is a problem right? anybody? You can say it is a round error issue. You can not say it is a problem. You simply have to be aware that the float number which you think of as 8.... inside of PHP may well be represented as 7.... down in the guts of the machine. It may help you feel better about this if you recall from grade school mathematics, that, in point of fact: 7.999... is EXACTLY equal to 8.000... Those who doubt this fact are requested to remember how to convert decimals such as: 0.333... to fractions (1/3), and then apply that exact same method to 7.999... You will quickly find yourself with a fraction (72/9) which is precisely equal to 8/1 which is 8. EVERY floating point number, then, that ends in x000... has a second representation, exactly equal, which ends in (x-1)999... Bottom line, however you look at it, is that you can NEVER be 100% certain that a computer's float number will convert to what you expect in an integer because their internal representation simply does not allow for perfection. This is a feature, not a bug. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] looking for a combination contact application/social networking app
hi... i'm in need of a glorified contact type application. i want/need to be able to allow users to enter their information into the system, specify what category(s) they belong to, be able to see others, rank others, etc... i also would like to be able to have some form of relational/6-degrees/ryze type of system so the users can see/find others with similar interests.. and of course, i'd like this to be open source!!! anbody have any ideas, or seen anything closely resembling anything like this.. i'd even be willing to look at multiple apps, with the intent of putting them together as a comprehensive app!! thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NT domain info
mikey... i'm not a guru... but this sounds like something that someone should have already done (or thought about) in perl. you might find that there's already a perl app/solution that gets you close to what you need, that would allow you to either use the perl solution, or rewrite what it does in php... good luck!! bruce -Original Message- From: Mikey [EMAIL PROTECTED] Sent: Jan 19, 2005 4:13 PM To: '[php] PHP General List' php-general@lists.php.net Subject: [PHP] NT domain info Hi NG! Does anyone here know of a way of getting at the user account information from a windows domain controller from a Linux box, specifically in PHP? I was thinking of writing a COM object for the windows box running a simple socket service for updates, but that seems like an awful lot of coding (not to mention having to write COM garbage). Has anyone else here had to tackle a similar problem, or does anyone know enough about Windows and domain accounts to be able to point me in the right direction? TIA, Mikey -- 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] XML Filters for illegal characters
Hello, I'm wondering if anyone knows of a filter that can take data to be wrapped in XML tags and filter this data encoding any illegal XML characters or, if they cannot be encoded, remove them. The problem I have is a database that contains text that must be wrapped in XML. Some of this text has illegal characters in it (probably copied from MS Word). Some of the characters that keep popping up are not very frequently used, so I'm hoping whatever filters get suggested, they can simply strip out these characters if they cannot encode them. thanks for your help. -- Doug Jones Co-Op Web Developer [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] XML Filters for illegal characters
Yes, I have tried htmlentities. Unfortunately it doesn't seem to be catching the characters that are plaguing my program. -- Doug Jones Co-Op Web Developer [EMAIL PROTECTED] -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 05, 2005 11:32 AM To: Jones, Douglas 1 Cc: php-general@lists.php.net Subject: Re: [PHP] XML Filters for illegal characters Jones, Douglas 1 wrote: I'm wondering if anyone knows of a filter that can take data to be wrapped in XML tags and filter this data encoding any illegal XML characters Have you tried htmlentities()? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML Filters for illegal characters
Perhaps I am misunderstanding your problem, so let me ask it another way. Is the problem that you are getting characters entered into the database that are encoded in one way (e.g. UTF-8) when you expected the characters to be encoded in another way (e.g. ISO-8859-1)? No, the problem involves characters in the text that are Illegal XML characters much like is an Illegal XML character. Only, the one the character that my software is reporting as illegal is apparently not one that is caught by the normal filters (like htmlentities or even some functions specifically coded for XML that I found on the PHP.net website). I think the problem with the filters that I have tried is that they only attempt to change entities that are can be encoded to something XML safe. Ideally, what I want is something that just removes the offending character if it cannot make it safe for XML. So, say is made into amp; but an unexpected symbol is simply removed. For example (suppose ^ is a symbol that cannot be encode for this example): input: string output: stramp;ing input: str^ing output: string I hope this makes things clear. I think that a function just like htmlentities but one that just removes characters that are illegal but can not be fixed would be the ideal solution. If anyone needs further clarification, I would be happy to try to provide it. -- Doug Jones Co-Op Web Developer [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Server with php
richard... i'm not sure of the email/list name.. but there is an apache email list.. if you get to the apache.org site.. they could help you.. they're actually pretty good.. sorry i don't have the name right at my fingers right now!! good luck... -Original Message- From: Richard Lynch [EMAIL PROTECTED] Sent: Jan 4, 2005 12:31 PM To: Ramiro Trevino [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Apache Server with php Ramiro Trevino wrote: I am having issues with the installation and configuration of my Apache server 2.0.52(win32). All is well when I restart the server with the exception of, when I load the following lines. I opened up the httpd.conf file and searched for #LoadModule ssl_module modules/mod_ssl.so. Directly underneath that line, I added LoadModule php4_module D:/php/sapi/php4apache2.dll. My plan was to run PHP as a module for Apache, instead of as a CGI binary but every time I add this line my server will not restart but I get an error stating The requested operation has failed. I checked to ensure the path was correct to this dll and all is well. Any suggestions? I don't think you are allowed to specify a full path to your DLL. Copy the php4apache2.dll into the same directory where the SSL DLL is, and change the LoadModule to match as much as possible. Actually, if there are *ANY* other *working* Apache modules, use those as your guideline instead. You've got SSL commented out, so it's not much of a guideline to follow, since it's not working (on purpose) -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] distributed architecture....
hi... i'm contemplating a project where a number of websites would communicate with each other via some network of round robin/distributed servers. Each 'client' website/app would be considered to be a 'node' of the overall network, and be able to upload/download information to the network. The master servers would maintain the information, such that if a request for information came from one of the 'client' sites, the master server would shove the information back to the client for display. the overall goal of the project would be a way of allowing a client site to 'share/exchange' information with other client sites within the network, and to allow the content of a given client site to be influenced by the content of other sites within the network... has anybody heard/seen anything like this...?? in searching google/sourceforge/freenet/etc.. i can't find anything that's similar, or that could be used as a starting point for the architecture... the closest i can find is the open source gnutella/limeware p2p app structure... thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] distributed architecture....
I would also suggest that you look into SOAP for this project. My office hosts a search program that uses SOAP to go out and search the databases of remote sites, most of which run architectures completely different than ours. It would probably be pretty easy to use SOAP to get the data off of the master servers (use RPC calls) and it would probably be pretty simple to upload the data using SOAP as well. -- Doug Jones Co-Op Web Developer [EMAIL PROTECTED](856) 792-9454 -Original Message- From: Bruce Douglas [mailto:[EMAIL PROTECTED] Sent: Thursday, December 30, 2004 9:52 AM To: php-general@lists.php.net Subject: [PHP] distributed architecture hi... i'm contemplating a project where a number of websites would communicate with each other via some network of round robin/distributed servers. Each 'client' website/app would be considered to be a 'node' of the overall network, and be able to upload/download information to the network. The master servers would maintain the information, such that if a request for information came from one of the 'client' sites, the master server would shove the information back to the client for display. the overall goal of the project would be a way of allowing a client site to 'share/exchange' information with other client sites within the network, and to allow the content of a given client site to be influenced by the content of other sites within the network... has anybody heard/seen anything like this...?? in searching google/sourceforge/freenet/etc.. i can't find anything that's similar, or that could be used as a starting point for the architecture... the closest i can find is the open source gnutella/limeware p2p app structure... thanks bruce [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
Re: [PHP] what am I doing wrong? PHP5 on Fedora
if you want to know/have a rough guide on building/compiling php with mysql/mysqli support, the following link should help you out... although it's for linux.. http://marc.theaimsgroup.com/?l=php-generalm=109026859726530w=2 it kind of walks you through what you need to do.. hope it helps... peace.. -Original Message- From: Rory Browne [EMAIL PROTECTED] Sent: Dec 30, 2004 11:00 AM To: php-general@lists.php.net Subject: Re: [PHP] what am I doing wrong? PHP5 on Fedora Sorry if you recieved this twice. Head's wreaked today, and I keep making mistakes, such as posting to a person instead of to the list. If you're using apache2 then you need to add something along the lines of --with-apxs to your ./configure line. With apache1.3 it was --with-apxs=/path/to/apxs. I'm not sure what whether it's still --with-apxs, or --with-apxs2, but either way you'll probably be looking for the path to apxs2. Just for your information apxs is the APache eXtension System. If you want to use locate, on recently created files, then you should schedule locate to run updatedb more often. your locate is only as recent as your last updatedb. On Thu, 30 Dec 2004 10:39:50 -0500, blackwater dev [EMAIL PROTECTED] wrote: I don't seem to have an apxs directory. I don't even have an apache directory as apachectl resides in /usr/sbin/apachectl Of course apache was installed from the fedora install. How do I install this against apache? On Thu, 30 Dec 2004 10:20:01 -0500, John Nichel [EMAIL PROTECTED] wrote: blackwater dev wrote: **First let me say that I am a linux newbie** I have installed Fedora 3 on a development box. I then downloaded the php5 source and followed the php documentation: # ./configure --with-mysql # make # make install What did you build it against? You have no webserver type in your configure line. If I'm not mistaken, all you have above will do is build the cli, and not the loadable module. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [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 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] RE: help with PEAR and SOAP
Greg, The code that you gave seems like it would work...only I'm not sure how I can reformat the result before it gets sent back to the soap client. For instance, I have a function that simply builds a string containing XML and returns that. I wrap this function in a class. The constructor for this class creates an instance of SOAP_Server (from the PEAR SOAP package). This object is passed $this (the class I created to wrap my function) and the service method is called from the SOAP_Server class. After I call the service method, the processing is taken care of and the SOAP package calls my function with the correct parameters and returns that to the client. The only place that I would really have control over the value getting returned is inside my function. I don't think the conversion of the chars is happening here. Does PHP automatically convert special HTML chars? If so, is there a way to stop it from doing this? In my other message, I wasn't really asking for people who have used something other than SOAP for returning XML but I was asking if anyone has used an implementation of SOAP for PHP other than the one in the PEAR library. I know that there is nusoap and that php has some soap functions that can be compiled in, perhaps one of these implementations is better? The only thing else I can think of is that the PEAR SOAP libraries are doing the conversion on the data before it sends it to the client. Perhaps there is a way to tell it to stop this behavior. Thanks. - Doug Jones Co-Op Web Developer -Original Message- From: Greg Beaver [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 29, 2004 1:37 AM To: Jones, Douglas 1 Subject: Re: help with PEAR and SOAP [offlist] Douglas 1 Jones wrote: Hello, I have the SOAP PEAR package set up correctly to the point where I can send a request and get a response. However, my web service is designed to return XML back to the caller. When I do this, all of the tags have their and converted to lt; and gt;. I have spent much time searching the web for an answer to this, but have come up empty handed. If anyone knows how to solve this that would be great. Also, if anyone has experience writing a web service in PHP that returns XML I am open to suggestions of approaches other than using the PEAR SOAP package. Before digging too deeply, be sure you try doing a reverse html_specialchars() on the result and see if that doesn't fix your problem. Something like: ?php $tr = get_html_translation_table(HTML_SPECIALCHARS); $result = strtr($result, $tr); ? As for alternatives to SOAP, perhaps an offlist discussion would work better as it doesn't really have anything to do with PHP until you start implementing it :). What kind of information does the web service provide? Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help with PEAR and SOAP
Hello, I have the SOAP PEAR package set up correctly to the point where I can send a request and get a response. However, my web service is designed to return XML back to the caller. When I do this, all of the tags have their and converted to lt; and gt;. I have spent much time searching the web for an answer to this, but have come up empty handed. If anyone knows how to solve this that would be great. Also, if anyone has experience writing a web service in PHP that returns XML I am open to suggestions of approaches other than using the PEAR SOAP package. Thanks, - Doug Jones Co-Op Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compiling PHP Source guides
if you want to know/have a rough guide on building/compiling php with mysql/mysqli support, the following link should help you out... although it's for linux.. http://marc.theaimsgroup.com/?l=php-generalm=109026859726530w=2 it kind of walks you through what you need to do.. hope it helps... peace.. -Original Message- From: [EMAIL PROTECTED] Sent: Dec 22, 2004 2:10 PM To: Donald Tyler [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Compiling PHP Source guides Quoting Donald Tyler [EMAIL PROTECTED]: I did RTFM. The exact page you linked to in fact: QUOTE: Requirements In order to have these functions available, you must compile PHP with support for the mysqli extension. END QUOTE That is the whole point of my request. I need a guide explaining *how* to compile the PHP Source. The directions to compile the PHP source *are* on the page at http://us4.php.net/manual/en/install.unix.php -- you compile it using the make steps in the directions there. (But it seems the problem is that you don't recognize those as compilation instructions, which is understandable if you're a newbie. The page also says that Basic Unix skills (being able to operate make and a C compiler) are a prerequisite, so you probably should find a person you can rely on to deliver those skills repeatably or teach them to you, which is not something you really get from a mailing list. Get a good intor Unix book. After all, you wouldn't expect that if you subscribed to a heart surgery mailing list and said I'm a complete newbie -- can you tell me how to do a quadruple bypass? someone would step you through it? Yes, there are differences in degree, but...! :) -- 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] can I compile php source
after looking at the msgs on this list for this thread... i'm curious. if you see an email that you don't want to respond to, why can't you simply choose not to respond to it, and ignore the msg. peace.. -Original Message- From: Paul Aviles [EMAIL PROTECTED] Sent: Dec 21, 2004 7:48 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] can I compile php source some people will never get it. - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: Paul Aviles [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, December 21, 2004 10:41 AM Subject: RE: [PHP] can I compile php source [snip] no sympathy, reality. So, if someone asks how to past the max_upload size limit will you send them to google or maybe point them to your web site how-to? hmmm. be kind, is free, and people will respect you more. [/snip] Nope, because the question requires more than a yes or no answer. I would most likely say something like... RTFM... http://us2.php.net/manual/en/features.file-upload.php I am not on this list to earn respect. I am here to learn and where possible, teach. And if you want people to be more politically correct so no one gets insulted or gets their feelings hurt you have come to the wrong place. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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] can I compile php source
now guys/ladies.. this was funny! and can we move on... ! -Original Message- From: Matthew Sims [EMAIL PROTECTED] Sent: Dec 21, 2004 1:35 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can I compile php source On Wednesday 22 December 2004 01:37, Paul Aviles wrote: Guys, this is trivial. It takes the same effort to provide the answer to whoever this guy was, than to lecture him on how to think. Teach a person to fish ... -- Jason Wong - Gremlins Associates - www.gremlins.biz You know, I bet that man is getting sick of eating fish all the time. Teach a man to shoot a cow... -- --Matthew Sims --http://killermookie.org -- 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] can I compile php source
and this response was helpful to the guy who asked the original question, how i mean, aside from showing that you know how to do a link, what did you show peace... -Original Message- From: John Nichel [EMAIL PROTECTED] Sent: Dec 20, 2004 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can I compile php source QT wrote: hi, is there any way to compile php source to make binary file for protecting source code? best regards Yes. http://www.catb.org/~esr/faqs/smart-questions.html -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delivering large files via PHP (300MB)
hi.. you might also look into 'bit torrent'... peace.. -Original Message- From: Richard Davey [EMAIL PROTECTED] Sent: Dec 13, 2004 11:53 AM To: [EMAIL PROTECTED] Subject: [PHP] Delivering large files via PHP (300MB) Hi all, Just thought I would pick the collective brain on this one. I have a requirement to deliver a large EXE file to customers after they order. The file is just under 400 MB in size and, because they have just purchased it, I obviously cannot have this file in a public location on the web server that someone could browse to. I can push the file out quite easily using a modified header and a simple script to check if they can download it or not, but with such a large file a significant number of web browsers fail to obtain the entire EXE before closing - or any other number of factors kick into play (their PC resets, ISP disconnects, Windows crashes, etc). Some browsers support resuming download, but not when the file has been sent via the headers I use, also FTP is not an option as I cannot create and destroy FTP users on the server easily (or for that matter assume the customer knows how to perform FTP operations). I'm also aware that it's not such a hot idea to lock-up Apache for the time it takes to download the whole file, especially with a large number of users doing this. So I came up with an idea that I'd like your opinions on: I built a small but friendly Windows application (50KB in size) that will connect to the web server via HTTPS, check the download credentials and if all is ok, it then downloads the file via HTTP in 1MB chunks. The file is just a single EXE file sat outside of my web root, and the PHP script that serves the file uses fopen() to open the file, then fseeks to the required section of it, reads in 1MB worth of data, closes the file and then echos this out (after suitable headers of course, shown below) header('Content-Type: application/force-download'); header('Content-Transfer-Encoding: Binary'); header(Content-Length: $total_chunksize); header(Content-Disposition: attachment; filename=\$chunkname\); The Windows app performs various checks on the file segments as they download and eventually stitches the whole thing back together at the end (there is a resume download feature so you can come back to it at a later time if you need, or your ISP disconnects). A quick MD5 file integrity check with the server confirms the file has downloaded fully. I have tested this out on some massive files across a range of PCs and Windows installations and it works perfectly, so I'm happy that the Windows side of things is correct. But I would be interested to hear peoples views on the PHP side of the equation - would it be better for Apache to be running PHP scripts that shove out smaller 1MB chunks as opposed to doing a fpassthru on a 300MB+ file? Or do you think there is another more elegant solution? I'm aware my app is for Windows only (although I could easily port it to OS X), but the files they are downloading are PC games anyway, so it's no bad thing in this case. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- 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] problems after installing on new hard-drive
I recently had a hard-drive go down in which I was running os x 10.2.x. I do not remember exactly what version of mysql, php etc. I had on it. I had a small mysql database with some php code that worked fine. Now that I have my new drive I have put php 4.3.2, phpmyadmin 2.5.7-pl1, and mysql 4.0 (for os x 10.3.4). One error was when trying to connect to server which is my machine in this case. But when I ran that same code using an include, it worked fine. After copying the code from my include file into where the error was it worked fine as well. And yep it was definetly the same code. Also, after hitting my submit, there is no data being passed via my post. It also gives me an Warning: Invalid argument supplied for foreach(). As I said all this code worked fine on my os x 10.2.x. Any help would be appreciated, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what file holds my databases
Really stupid question. I set up apache, mysql, phpadmin etc., and started personal web sharing of course on my mac and created a couple of databases. My question is on my hard-drive, where and/or what file holds my databases? Thanks for any help, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] load data infile
I have a tab delimited file I am trying to load in my database using: LOAD DATA INFILE '/users/dbs/sites/phpmyadmin/gus/exptab.txt' INTO TABLE datable; But all it will load is the first record and I have about 2000 records. There are 20 columns of data in my 'exptab.txt' file I am loading and there are 20 fields in datable. Any ideas, if you could email me directly I would appreciate it, thanks, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using htmlentities with data in textarea
As John H told me (which is true) I should run my words through htmlentities. I have a textarea in a form for individuals to type in a list of words. From there I place these words in an array and then perform calculations and echo the words back out with the resulting calculations. But if one enters:w' my word ends upw\' I have tried using htmlentities in my array and other places (to take the slash out) but to no avail. Here is what I tried when putting my words in my array: $zchrpos = 0; $tok = strtok($zwords, \r); while ($tok !== FALSE) { $toks[] = htmlentities(trim($tok)); $tok = strtok( \r); $zchrpos++; } Any help would be appreciated, Doug Sorry about the return receipt turned on in previous emails! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] placing values in html teaxtarea
After doing calculations etc on my data I am wanting to place it in a textarea form in html. I am having trouble getting my data to show up in my texarea. For example, say after all my calculations I my field called $test ends up containing This is a test. Here is what I tried: textarea name=zoutput rows=20 cols=70 wrap value=? echo $test; ? / /textarea I can add the $test to input like this but not a textarea. Name: input type=text name=zfname value=? echo $test; ?/ br Is this possible? Thanks, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] after submitting, working with data on same page
I have my two html textarea fields followed by these two buttons. form action=?=$_SERVER['PHP_SELF']? method=post br input type=submit name=calcentry value=Calc Your Entry / input type=submit name=clearentry value=Clear Your Entry / /form I have textarea1 to type words into. I have textarea2 for my results. I have people type words in textarea1 and after hitting the calcentry button I want to reload the same page, go into my: if ($calcentry) {...} part of my code and do some calculations with php and mysql and put my output into textarea2. But after submitting and re-loading the page my textarea1 field is empty. So my first question is how do I keep the data in textarea1 so when I perform my submit I can do some calculations on it etc? Then how can I place my results into textarea2. So all I want is to type words into a textarea field, reload the same page, do some calcs on these words, and place the results into textarea. So it amounts to having the exact same page but now I have my calculated results in the second textarea. I have all my code for calcs etc. and it works fine. Thanks for any help, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] after suubmitting, working with data on same page
Just to make it simple this is my whole page for now, when putting words in the textarea zwords and hitting calc your entry it never goes into my if statement: html body ? if ($_POST['$calcentry'] == Calc Your Entry) { echo 'xxx' . $zwords . 'xxx'; } ? textarea name=zwords rows=20 cols=30 wrap / /textarea textarea name=zoutput rows=20 cols=70 wrap / /textarea BR form action=?=$_SERVER['PHP_SELF']? method=post br input type=submit name=calcentry value=Calc Your Entry / /form /body /html Thanks, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] after suubmitting, working with data on same page
Sorry about that. It did execute my if but shows nothing for $zwords. So my echo shows: xx after entering cat and pressing my calc your entry. How do I get my value(s) I entered in to work with? Thanks -- From: Marek Kilimajer Sent: Friday, July 9, 2004 1:41 PM To: Hull, Douglas D Cc: Note To Php general List (E-mail) Subject: Re: [PHP] after suubmitting, working with data on same page if ($_POST['calcentry'] == Calc Your Entry) { Hull, Douglas D wrote: Just to make it simple this is my whole page for now, when putting words in the textarea zwords and hitting calc your entry it never goes into my if statement: html body ? if ($_POST['$calcentry'] == Calc Your Entry) { echo 'xxx' . $zwords . 'xxx'; } ? textarea name=zwords rows=20 cols=30 wrap / /textarea textarea name=zoutput rows=20 cols=70 wrap / /textarea BR form action=?=$_SERVER['PHP_SELF']? method=post br input type=submit name=calcentry value=Calc Your Entry / /form /body /html Thanks, Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need to refine this:
Just my two cents :) $temp = ; echo table\n; while ($mydata = mysql_fetch_object($myquery)) { if ($temp != $mydata-district) { $temp = $mydata-district; echo tr bgcolor=\#CC\td$mydata-district/td/tr\n; } echo tr bgcolor=\#CC\td$mydata-city/td td$mydata-place/td td$mydata-meetingtime/td/tr\n; } echo /table\n; Hope it helps. __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array to string?
Hello everybody. Is there any built-in function to convert an array to string? Thanks. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array to string?
I just found it: implode. Sorry to bother you. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.3 Install, Errors??
I finally have my installation of PHP 4.3.3 to work, thanks to your help and a couple other people on IRC. For knowledge sack here's how I resolve the problem. Installed port/packages of... png-1.2.5p1 jpeg-6b gd-1.8.3 (built in library of PHP would not work for me) ImageMagick-5.2.9 zlib (build in. standard part of OpenBSD, /usr/lib/) To resolve the config: error: fix png.h not found. error I was unable to do this without making a symbolic link. cd /usr/local/include; ln -s libpng/*. This would crate a symbolic link of each file in /usr/local/include/libpng in /usr/local/include. Than run configure, and everything was just fine. ./configure --with-mysql --with-xml --with-apxs --without-pear --with-config-file-path=/var/www/conf --with-zlib --with-zlib-dir=/usr --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local make make install Thanks for the help! Unless you need PEAR, you're fine. Try configuring --without-pear. You should really be doing this anyways unless actually need PEAR. Evan Nemerson On Thursday 11 September 2003 02:10 pm, Adam Douglas wrote: Hi. I have a machine that's been freshly installed with PHP 4.1.1. I wanted to upgrade it to PHP 4.3.3. So I did the following below as SU and received the below errors. Is this something I should be worried about? How can I resolve the errors? Never have had this happen before in the past. I ran phpinfo() and it shows PHP 4.3.3, but is the install of PHP okay? If you require any additional information let me know, thanks! # make install Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PHP SAPI module: apache [activating module `php4' in /var/www/conf/httpd.conf] cp libs/libphp4.so /usr/lib/apache/modules/libphp4.so chmod 755 /usr/lib/apache/modules/libphp4.so cp /var/www/conf/httpd.conf /var/www/conf/httpd.conf.bak cp /var/www/conf/httpd.conf.new /var/www/conf/httpd.conf rm /var/www/conf/httpd.conf.new Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/ Installing PEAR environment: /usr/local/lib/php/ Parse error: parse error in /usr/files/storage/Software/php-4.3.3/pear/package-Archive_Tar .xml on line 1 *** Error code 255 Stop in /usr/files/storage/Software/php-4.3.3 (line 263 of Makefile). *** Error code 1 Stop in /usr/files/storage/Software/php-4.3.3 (line 269 of Makefile). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
Mmm... okay. I tried that and nothing. Is there no way for me to determine what the problem is? Error message some place, log file, etc? I do not understand why this is not work. Even a simple example from the PHP manual on system() does not work. I meant to do this: $szPipe = `/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf`; Backticks is simply the ` sign (usually the character above the tab). Popularly know as `hair on the ear` in my country :-) for example if you want to invoke ls from php you just type $result = `ls`; hey presto the output from ls is now in your $result variable. Ohhh okay. Well if you mean to do this, $szPipe = popen(`/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf`, r);. This does not seem change anything. If I do this with the system() example, I get Warning: system(): Cannot execute a blank command in /htdocs/index.php on line 14. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
No I have Safe_Mode = off. I also have error_reporting = E_ALL and display_errors = on and I have php errors to log to a log file. I have no log file of php errors nor is there an error being display on the page. Geez this is frustrating, yeah that's what I figure but you would think there can be something done about this or at least get some error message to determine what is going on. btw have you checked if you are in safe_mode? in php.ini error level can also be set in php.ini my guess is that you have a problem in your chroot setup. Adam Douglas wrote: Mmm... okay. I tried that and nothing. Is there no way for me to determine what the problem is? Error message some place, log file, etc? I do not understand why this is not work. Even a simple example from the PHP manual on system() does not work. I meant to do this: $szPipe = `/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf`; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.3 Install, Errors??
Hi. I have a machine that's been freshly installed with PHP 4.1.1. I wanted to upgrade it to PHP 4.3.3. So I did the following below as SU and received the below errors. Is this something I should be worried about? How can I resolve the errors? Never have had this happen before in the past. I ran phpinfo() and it shows PHP 4.3.3, but is the install of PHP okay? If you require any additional information let me know, thanks! # make install Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PHP SAPI module: apache [activating module `php4' in /var/www/conf/httpd.conf] cp libs/libphp4.so /usr/lib/apache/modules/libphp4.so chmod 755 /usr/lib/apache/modules/libphp4.so cp /var/www/conf/httpd.conf /var/www/conf/httpd.conf.bak cp /var/www/conf/httpd.conf.new /var/www/conf/httpd.conf rm /var/www/conf/httpd.conf.new Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/ Installing PEAR environment: /usr/local/lib/php/ Parse error: parse error in /usr/files/storage/Software/php-4.3.3/pear/package-Archive_Tar.xml on line 1 *** Error code 255 Stop in /usr/files/storage/Software/php-4.3.3 (line 263 of Makefile). *** Error code 1 Stop in /usr/files/storage/Software/php-4.3.3 (line 269 of Makefile). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to access a program outside of PHP?
Hi. I'm trying to develop a web interface to the ghostscript (gs) application. I have the ghostscript syntax down perfectly in the console. Now when I go to try and do it in PHP I get nothing. No errors, nothing just a blank page with PHP logs turned on and errors turned on. I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my case Apache (httpd) is chrooted to /var/htdocs/. So I figured I would have to copy ghostscript and all it's dependencies to /var/htdocs/ at least for it to work. Still nothing. Here's the code I used below. At this point I do not know what direction to go to get this to work or if it is even possible. I've tried exec(), system() and popen() api functions. I get nothing no results, no errors what so ever. BTW, ghostscript does appear to work fine in the chrooted directory via the console. At this point the below code is all I have. The syntax for ghostscript shown below just outputs the data of the 2 PDF files to the pdfwrite so it will merge them together into a merged.pdf file. Quite simple actually. $szPipe = popen(/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf, r); I tried resulting to something simple to get this to work. I took the example from the PHP manual system() page (http://www.php.net/manual/en/function.system.php). In this example is it suppose to return Last Line of Output: and Return value: 127? This occurs with system() and passthru(). I thought it should return the last line of a ls would show in the console. Any ideas or direction on how to do this would be greatly appreciated. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
1) please try $szPipe and see if you get any output. 2) if you are jailed in /var/htdocs/ your pathname /htdocs/qs is incorrect. 3) I guess you tried running gs from the jail either as yourself or as root. please see if nobody or apache (the webserver's user) can run gostscript. 1) When I echo out $szPipe I get Resource id #2. 2) Oops, that chrooted in /var/www/. So I thought I should be putting just a /htdocs/, no? 3)Yes I tried running gs in the console as root works fine and as myself and that works fine. The user is www that runs httpd. How could I test to see if www has access? To my understanding such accounts can not be used to log in with. I have chown the /htdocs/ to be www:. Hi. I'm trying to develop a web interface to the ghostscript (gs) application. I have the ghostscript syntax down perfectly in the console. Now when I go to try and do it in PHP I get nothing. No errors, nothing just a blank page with PHP logs turned on and errors turned on. I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my case Apache (httpd) is chrooted to /var/htdocs/. So I figured I would have to copy ghostscript and all it's dependencies to /var/htdocs/ at least for it to work. Still nothing. Here's the code I used below. At this point I do not know what direction to go to get this to work or if it is even possible. I've tried exec(), system() and popen() api functions. I get nothing no results, no errors what so ever. BTW, ghostscript does appear to work fine in the chrooted directory via the console. At this point the below code is all I have. The syntax for ghostscript shown below just outputs the data of the 2 PDF files to the pdfwrite so it will merge them together into a merged.pdf file. Quite simple actually. $szPipe = popen(/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf, r); I tried resulting to something simple to get this to work. I took the example from the PHP manual system() page (http://www.php.net/manual/en/function.system.php). In this example is it suppose to return Last Line of Output: and Return value: 127? This occurs with system() and passthru(). I thought it should return the last line of a ls would show in the console. Any ideas or direction on how to do this would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
Hi. I'm trying to develop a web interface to the ghostscript (gs) application. I have the ghostscript syntax down perfectly in the console. Now when I go to try and do it in PHP I get nothing. No errors, nothing just a blank page with PHP logs turned on and errors turned on. Does the Apache user have permission to run this program? PHP runs as the Apache user when installed as a module. It should. I've moved the gs and all dependencies into /var/www/htdocs/. I've ran it from that location and it seems to work fine. Also I've chowned the /htdocs/ to be www:www. Should have all the rights it needs. Apache/HTTPD runs as www. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] executing shell commands.
Hi! I'm not sure this could be your problem, but this is what I see: $numlin = '/bin/cat /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhosts/eqty/$system | /bin/wc -l'; I think you should write it like this: $numlin = /bin/cat /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhosts/eqty/$system | /bin/wc -l; I had this kind of problem once and my script wasn't replacing the variable ($system). It was just writing $system in the string. Hope this helps. Regards, Douglas. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
1) When I echo out $szPipe I get Resource id #2. Sorry i was thinking of backticks. btw have you tried it ? (backticks) Backticks? Is this a PHP API function, I can't find it? That's the thing here I haven't been able to get things to work and I have no clue what I should use, exec(), system(), popen(), etc. gs just needs to be run, I do not require any output back from it other than if I can determine if it's been ran or not (true/false). 3)Yes I tried running gs in the console as root works fine and as myself and that works fine. The user is www that runs httpd. How could I test to see if www has access? To my understanding such accounts can not be used to log in with. I have chown the /htdocs/ to be www:. can't login yes. but you can try: sudo -u www /htdocs/gs Okay, tried that and yes it worked. Any more ideas? Is there any logs I could look at to find out more, I've looked around but haven't found anything as of yet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-General List post bounces???
Why do I keep getting this? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 10:12 AM To: [EMAIL PROTECTED] Subject: [ERR] RE: [PHP] How to access a program outside of PHP? Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access a program outside of PHP?
Backticks is simply the ` sign (usually the character above the tab). Popularly know as `hair on the ear` in my country :-) for example if you want to invoke ls from php you just type $result = `ls`; hey presto the output from ls is now in your $result variable. Ohhh okay. Well if you mean to do this, $szPipe = popen(`/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf /htdocs/Sep08-113523.pdf`, r);. This does not seem change anything. If I do this with the system() example, I get Warning: system(): Cannot execute a blank command in /htdocs/index.php on line 14. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs ASP.NET formal opinions request
Thanks to everybody for your kind responses. By the way, I go to the Universidad de El Salvador (Central America). In a such poor country like this, Free Software and Open Source could be the answer to the government's software needs. Unfortunately, MS has the monopoly in the government's software, and our leaders see GNU like We don't have any support for that. Nobody guarantees us the GNU software's good performance. With MS we can demand answers to SOMEBODY. They say that they prefer to pay to get that warranty. I know that it's going to be hard, but I'm willing to fight for what I believe in. Wish me luck :D Thanks again. Regards, Douglas. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP vs ASP.NET formal opinions request
Hello everybody. I've been doing some research about the PHP vs ASP.NET debate, because I need to justify the use of PHP in my graduation work. In my University, people in charge of approving the graduation works advocate Microsoft's technologies. They don't believe in the free software movement or the open source movement. Some guys tried to develop a system using PHP and those people made them change to ASP.NET. They say because It's the future. According to them it's where the money is. Well, I only have one year using PHP, but I'll try to fight. I've read a lot of opinions that have been very useful to me. I collected a lot of those opinions and printed to show them to the authorities, but they said that I needed formal basis (books, scientific journals, etc.) to justify the use of PHP. They said that they'd only allow BIG COMMERCIAL, IMPARTIAL, RECOGNIZED WEBSITES opinions and articles. I pretend to use this comparison found in the Microsoft MSDN website: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/phpvsaspnet.asp Can you give me some pointers (websites, names, etc) where I could find this kind of formal comparison about both technologies? I've been looking for some book that covers this issue. I've also been looking for some magazine article that I could use. I'd appreciate any kind of help. Thanks. Regards, Douglas. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs ASP.NET formal opinions request
Thank you for the links Mr. Rees. I specially liked the one about MS giving $500K to the Peruvian President. Thanks to everybody's help I have some BIG COMMERCIAL, IMPARTIAL, RECOGNIZED WEBSITES articles like IBM, Yahoo and Google. I'm very thankful to all of you. Regards, Douglas. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable variables question?
Hello everybody. I have the following class method: function HTTPValidator($method) { $this-data = ${'_'.$method}; $this-rules= array(); $this-required = array(); } data, rules and required are arrays. The parameter $method can have the values: GET or POST. I'm trying to store the superglobal array in the data class property. To get the superglobal array ($_GET or $_POST), I try to build these strings '_'.$method. I'm sure this part works, PHP builds the string _GET or _POST according to the $method parameter. I use ${'_'.$method} to get the contents of the superglobal. But this piece of code doesn't work. It seems like PHP doesn't build the $_GET or $_POST string. Funny thing, I tried the same code on another script and worked. Here's that script: ?php echo 'pre'; print_r($_POST); echo '/prebrbr'; $method = 'POST'; $data = ${'_'.$method}; echo 'pre'; print_r($data); echo '/prebrbr'; ? (I even tried to send the $method parameter as '_GET' and '_POST', and didn't work either). I'm very confused. Thanks for any help. __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Variable variables question?
Thanks for the answer Mike. Thanks for the explanation, but I think this is a different case, isn't? I'm not trying to do this ${$_POST}, I'm trying to make this string $_POST. And I have another question. Why does this code work? ?php echo 'pre'; print_r($_POST); echo '/prebrbr'; $method = 'POST'; $data = ${'_'.$method}; echo 'pre'; print_r($data); echo '/prebrbr'; ? It does what I want it to do. I use it as the action of the same form I submitted before and it does print the superglobal array twice. The difference between this code and the one that doesn't work is that the latter is a class method. What do you think? Thanks again. __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading/writing the value of an UL/LI text value
Hi. I have a question regarding the DOM model. Does anyone know how to write to the UL/LI text value using the DOM model. I more or less can write to select/option attributes of the DOM. but I can't figure out how to write (or read) the text of a UL-LI attribute I'd like to be able to do something like: echo document.foo.element.LU.LI.text = dfdgd; ; (of course, using whatever the appropriate doument string would be...) Any pointers/code samples/web sites would be helpful Thanks Bruce [EMAIL PROTECTED] (925) 866-2790 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] creating new mail account on a domain
This is entirely dependant on what mail server you are running, how it's configured, and what tools you have at your disposal for controlling it (CLI, web, ...). If you actually want help with this issue, we're going to need a lot more detail. -Original Message- From: Lars Tvedt [mailto:[EMAIL PROTECTED] Sent: Sunday, April 06, 2003 12:48 PM To: [EMAIL PROTECTED] Subject: [PHP] creating new mail account on a domain How do i create a new mail account on a domain? My domain is waveartists.com and I wish to create a new mail account without using the server admin panel. but rahter using a php script. Do anyone know how to do this? any help appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Quick Sessions ?
Let's ask the dumb questions first: Is your webserver parsing .html files for PHP? -Original Message- From: Anthony [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 3:03 PM To: [EMAIL PROTECTED] Subject: [PHP] Quick Sessions ? I have an issue. For some reason I can't pass session data to pages within different folders. What I have is a page in like mydomain.com/something/somepage.php This page creates session information and holds it correctly. The app collects user data and then eventualy sends a location header to ../index.html - in this file there is php that check to see if the session data is there and. no longer there!!! So what gives? Can I not pass session info from pages in folders? I'm not changing the domain, so I shouldn't loose the cookie I'm lost Please help me out :) - Anthony -- 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.ini file not being updated with install
If you are using php as a DSO, you need to restart your webserver to load the new install. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:25 PM To: [EMAIL PROTECTED] Subject: [PHP] php.ini file not being updated with install Hello Everyone, I updated php recently in order to add the --with-ldap part. so my config.nice file now looks like: './configure' \ '--with-apache=../apache_1.3.27' \ '--with-mysql=/usr' \ '--with-oci8=/opt/oracle/product/9.2.0' \ '--enable-sigchild' \ '--with-ldap' \ $@ To update php, I ran make clean then the above ./configure line and then: make make install Now it looks like my command line php executable has been updated and is able to connect to ldap. However if I check out my phpinfo() from the web, it does not show the new Build Date. It still shows all the information from the last time I complied php and still cannot connect to ldap. Could anyone please help?? Thanks, Tracy -- 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] Which PHP version is stable with apache 2.0.39
Something you should note before diving into making PHP work with Apache 2.0.39 - Apache 2.0.45 was recently released, to address a DOS vulnerability in Apache2 on all platforms. You may want to upgrade (or have your system administrator upgrade) to Apache 2.0.45. A second note, when I went from 2.0.39 and PHP 4.2.x to Apache 2.0.43 and 4.3.0, my life became a whole lot easier as PHP and Apache seemed to behave a lot better together. So beyond upgrading Apache for security reasons, I would recommend using the latest PHP 4.3.x as well. Mark -Original Message- From: Jason Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 8:45 PM To: Jennifer Goodie; [EMAIL PROTECTED] Subject: RE: [PHP] Which PHP version is stable with apache 2.0.39 Jennifer, Thank you, I have followed that link previously and however find it somewhat confusing. ~These versions of PHP are compatible to Apache 2.0.40 and later. ~Note: Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 its known ~to work in conjunction with Apache 2.0.39. Don't try to use this version of ~PHP with any other version of Apache. We do not recommend to use PHP 4.2.3 ~along with Apache 2.0.39. In one part it is saying that it is known to work and then goes on to say is not recommended. Does anyone know why it is not recommended. Thanks Jason All mentioned versions of PHP will work still with Apache 1.3.x. -Original Message- From: Jennifer Goodie [mailto:[EMAIL PROTECTED] Sent: Friday, 4 April 2003 11:25 AM To: Jason Smith; [EMAIL PROTECTED] Subject: RE: [PHP] Which PHP version is stable with apache 2.0.39 http://www.php.net/manual/en/install.apache2.php -Original Message- From: Jason Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 5:22 PM To: [EMAIL PROTECTED] Subject: [PHP] Which PHP version is stable with apache 2.0.39 Hi, Need some information as I cant seem to find it in the manual or online. We are running apache 2.0.39 on redhat 7.3 and would like to run PHP on the same server. I am having trouble finding out if there is a stable version that runs with Apache 2.0.39 Any help appreciated Cheers jason -- 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] 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
RE: [PHP] Storing a graphic file in a MySQL database
Here's a good start: http://www.phpbuilder.com/columns/florian19991014.php3 -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 7:56 AM To: [EMAIL PROTECTED] Subject: [PHP] Storing a graphic file in a MySQL database Where can I find some information on storing a graphic file such as a JPG or GIF into a MySQL database. I'm assuming I have to convert it to a binary format and store it that way. Or maybe this isn't possible? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems with post data
Yes, the webserver that works is running apache2, however it's 2.0.44 instead of 2.0.43... I'm upgrading the broken one now to see if that fixes the problem. -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 10:50 AM To: 'Mark Douglas'; [EMAIL PROTECTED] Subject: RE: [PHP] Problems with post data 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems with post data
Just an FYI, 2.0.44 still isn't working on this server, while it does on another... I don't know what to do now, so I'm just going to write code to deal with this bug. -Original Message- From: Mark Douglas [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 10:38 PM To: '[EMAIL PROTECTED]' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Problems with post data Yes, the webserver that works is running apache2, however it's 2.0.44 instead of 2.0.43... I'm upgrading the broken one now to see if that fixes the problem. -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 10:50 AM To: 'Mark Douglas'; [EMAIL PROTECTED] Subject: RE: [PHP] Problems with post data 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 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] How to remove only the last character?
Good day. Is there any PHP function that removes only the last character of a string and returns the new string? I'm looking in the manual and I can't find anything. Until now I'm doing this: $var=substr($var,0,strlen($var)-1) Is this the most efficient way? Thanks. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to remove only the last character?
I want to thank you Ian, Zydox and Nicos. After Zydox response I checked the manual again and read this part in the substr function: If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative) Sorry to bother you guys, and thanks again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php/sendmail/apache/linux...
hey... I'm sure the question has been answered a 1000 times!!! I'm trying to create a simple app to send email via PHP, using the mail function. I'm using RedHat(Linux 8.0 , Sendmail), PHP(4.2.2), Apache (2.0.40). I'm using the following piece of code: === //test mail $to = [EMAIL PROTECTED]; $subject = savannah registration; $message = testing mail; $reply = From: [EMAIL PROTECTED]\r\n .Reply-To: [EMAIL PROTECTED]\r\n; echo to = . $to . br; echo subject = . $subject . br; echo msg = . $message . br; echo reply = . $reply . br; $q1 = mail($to, $subject, $message, $reply); echo return val = . $q1 . br; === Pretty simple eh... The problem that I have is that the mail doesn't appear to get sent. When I look in the /var/spool/clientmqueue directory, I see a great deal of what look to be error msgs They appear to be telling me that the mail couldn't be delivered, but I can't tell why I was able to successfully send a test msg via Sendmail from the command line by telnet. So I know the Sendmail engine/daemon seems to be performing... The PHP.ini file appears to be setup correctly, with the sendmail_path pointing to sendamil. Any ideas as to what I need to do, or should be checking Any pointers/assistance would be greatly appreciated. Thanks -Bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: php/sendmail/apache/linux...
Brian The following information is what I have... I created the following PHP app I'm running it from the command line. - #! /usr/bin/php -q ? # # a.php - test app for the php mail function # $toaddress = [EMAIL PROTECTED]; $subject = test; $content = Name: www \n .E-mail Address: [EMAIL PROTECTED] \n; $e = mail($toaddress, $subject, $content); if ($e == False) { echo mail = false\n; } else { echo mail = true\n; } ? - The response was: --- mail = false --- As you can see, the mail app failed.. The information from the /var/spool/clientmqueue/ dir is: [root@lserver2 savannah]# more /var/spool/clientmqueue/dfh0P2qeLE006055 This is a MIME-encapsulated message --h0P2qeLE006055.1043463166/lserver2.mesa.com The original message was received at Fri, 24 Jan 2003 18:52:40 -0800 from root@localhost - The following addresses had permanent fatal errors - [EMAIL PROTECTED] (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - 550 5.1.2 [EMAIL PROTECTED] Host unknown (Name server: [localhost]: host not found) --h0P2qeLE006055.1043463166/lserver2.mesa.com Content-Type: message/delivery-status Reporting-MTA: dns; lserver2.mesa.com Arrival-Date: Fri, 24 Jan 2003 18:52:40 -0800 Final-Recipient: RFC822; [EMAIL PROTECTED] Action: failed Status: 5.1.2 Remote-MTA: DNS; [localhost] Last-Attempt-Date: Fri, 24 Jan 2003 18:52:45 -0800 --h0P2qeLE006055.1043463166/lserver2.mesa.com Content-Type: message/rfc822 Return-Path: root Received: (from root@localhost) by lserver2.mesa.com (8.12.5/8.12.5/Submit) id h0P2qeLD006055; Fri, 24 Jan 2003 18:52:40 -0800 Date: Fri, 24 Jan 2003 18:52:40 -0800 From: root root Message-Id: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: test Name: www E-mail Address: [EMAIL PROTECTED] --h0P2qeLE006055.1043463166/lserver2.mesa.com-- == [root@lserver2 savannah]# more /var/spool/clientmqueue/Qfh0P2qeLE006055 V6 T1043463166 K0 N0 P31120 I3/2/1991420 Fr $_localhost $r $slocalhost ${daemon_flags}c u SMAILER-DAEMON C:root rRFC822; [EMAIL PROTECTED] RPF:root H?P?Return-Path: g H??Received: from localhost (localhost) by lserver2.mesa.com (8.12.5/8.12.5/Submit) id h0P2qeLE006055; Fri, 24 Jan 2003 18:52:46 -0800 H?D?Date: Fri, 24 Jan 2003 18:52:46 -0800 H?F?From: Mail Delivery Subsystem MAILER-DAEMON H?x?Full-Name: Mail Delivery Subsystem H?M?Message-Id: [EMAIL PROTECTED] H??To: root H??MIME-Version: 1.0 H??Content-Type: multipart/report; report-type=delivery-status; boundary=h0P2qeLE006055.1043463166/lserver2.mesa.com H??Subject: Returned mail: see transcript for details H??Auto-Submitted: auto-generated (failure) . The above files are pretty much greek to me!! Other than telling me it can't seem to handle the [EMAIL PROTECTED] address... which is odd... As a test, I changed the email address.. I get the same response... Is there something that I'm missing that has to be set for this to work I have Linux Redhat 8.0, PHP 4.2.2... I have the sendmail RPM and the PHP RPMs from the Redhat 8.0 installation disks Any help/assistance will be appreciated Thanks... Bruce [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Brian Schmidt Sent: Friday, January 24, 2003 6:04 PM To: [EMAIL PROTECTED] Subject: RE: php/sendmail/apache/linux... On Fri, 24 Jan 2003, Bruce Douglas wrote: However, as I stated, I'm fairly sure that the Sendmail app is working given that I was able to send an email from the command line when i did a telnet localhost 25 I'm just not certain as to how to do it through PHP Bruce, How about trying something really simple like this. I know it works. It's part of an HTML form I've used, so you'll need one with a $name, $email, and $morestuff input section: $toaddress = [EMAIL PROTECTED]; $subject = My Subject; $mailcontent = Name: .$name.\n .E-mail Address: .$email.\n .Additional Information: \n.$morestuff.\n; mail($toaddress, $subject, $mailcontent); thanks bruce [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Lucas Albers Sent: Friday, January 24, 2003 4:12 PM To: [EMAIL PROTECTED] Subject: RE: php/sendmail/apache/linux... Test the mailserver with the command cat message.txt | mail -f [EMAIL PROTECTED] User the Perl sendmail mail wrapper to send the mail. http://search.cpan.org/src/MIVKOVIC/Mail-Sendmail-0.78_5/README --Luke --Computer Science Sysadmin, MSU Bozeman --admin(AT)cs.montana.edu 994-3931 -Original Message
[PHP] a simple getenv question....
Hi... A simple question... In the following code: ? $ip = getenv(REMOTE_ADDR); echo ip = .$ip; echo ip = . getenv(REMOTE_ADDR); echo ip = . getenv('REMOTE_ADDR'); echo ip = . $REMOTE_ADDR;-- ? I can only seem to get the last line to display the correct value. It's as if I can't seem to get/return any of the SERVER environment variables using the getenv() function I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. I've checked through the PHP.INI file, but couldn't seem to find why this might be occuring. Any help/assistance would be appreciated. thanks bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] a simple getenv question....
phpinfo() returns everything as expected.. but not having the code .. i don't know what internal method it uses to access the information... but thanks... -bruce -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 4:18 PM To: 'Jim Lucas'; 'Bruce Douglas'; [EMAIL PROTECTED] Subject: RE: [PHP] a simple getenv question The simplest way to start looking would be phpinfo() page for starters. Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Thursday, 23 January 2003 10:15 AM To: Bruce Douglas; [EMAIL PROTECTED] Subject: Re: [PHP] a simple getenv question just copied your code and it worked fine for me. system: Apache 1.3.26 PHP 4.2.2 I would look into apache 2.0 and the env vars that are available from it. - Original Message - From: Bruce Douglas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 22, 2003 3:57 PM Subject: [PHP] a simple getenv question Hi... A simple question... In the following code: ? $ip = getenv(REMOTE_ADDR); echo ip = .$ip; echo ip = . getenv(REMOTE_ADDR); echo ip = . getenv('REMOTE_ADDR'); echo ip = . $REMOTE_ADDR; -- ? I can only seem to get the last line to display the correct value. It's as if I can't seem to get/return any of the SERVER environment variables using the getenv() function I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. I've checked through the PHP.INI file, but couldn't seem to find why this might be occuring. Any help/assistance would be appreciated. thanks bruce [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 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] a simple getenv question....
Timothy, Thanks for your input.. but I was trying to get a better understanding as to why the getenv() function was apparently not returning the SERVER environment vars. thanks -bruce -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 4:39 PM To: 'Bruce Douglas'; [EMAIL PROTECTED] Subject: RE: [PHP] a simple getenv question Do this: ?php print_r($_SERVER); ? If what you want is here this just use: $_SERVER['REMOTE_ADDR'] etc You will need to have a look at the source of the output as the rendered view will look a little strange. Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Bruce Douglas [mailto:[EMAIL PROTECTED]] Sent: Thursday, 23 January 2003 10:33 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] a simple getenv question phpinfo() returns everything as expected.. but not having the code .. i don't know what internal method it uses to access the information... but thanks... -bruce -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 4:18 PM To: 'Jim Lucas'; 'Bruce Douglas'; [EMAIL PROTECTED] Subject: RE: [PHP] a simple getenv question The simplest way to start looking would be phpinfo() page for starters. Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Thursday, 23 January 2003 10:15 AM To: Bruce Douglas; [EMAIL PROTECTED] Subject: Re: [PHP] a simple getenv question just copied your code and it worked fine for me. system: Apache 1.3.26 PHP 4.2.2 I would look into apache 2.0 and the env vars that are available from it. - Original Message - From: Bruce Douglas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 22, 2003 3:57 PM Subject: [PHP] a simple getenv question Hi... A simple question... In the following code: ? $ip = getenv(REMOTE_ADDR); echo ip = .$ip; echo ip = . getenv(REMOTE_ADDR); echo ip = . getenv('REMOTE_ADDR'); echo ip = . $REMOTE_ADDR; -- ? I can only seem to get the last line to display the correct value. It's as if I can't seem to get/return any of the SERVER environment variables using the getenv() function I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0. I've checked through the PHP.INI file, but couldn't seem to find why this might be occuring. Any help/assistance would be appreciated. thanks bruce [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 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested if in a for statement
I think your error is this: $userVars = array($nameFirst, $nameLast, $pass, $pass2, $auth, $dob_year, $dob_month, $dob_day); for ($i=0; $i = count($userVars); $i++) { if (empty($userVars[$i])) { echo please enter all required info; break; } } You're using eight variables, so $userVars have indexes like these $userVars[0]=$nameFirst, $userVars[1]=$nameLast, ... , $userVars[7]=$dob_day In the for loop you're using $i = count($userVars), that is $i=8, but you declare $i =0... so the loop is running nine times 0,1,...,8 The echo that you're seeing is the last run, cause empty($userVar[8]) is true (there is nothing in that index) Got it? Make it $i count($userVars). I hope this help you. Douglas. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb session cookie question?
Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] callbacks to methods inside a class/object
Is there a clean way to make use of PHP builtins that use callbacks and point those call backs to a method inside the class/object: A good example would be: ... class XMLClass { var $parser; function XMLClass() { $this-parser = xml_parser_create(); xml_parser_set_option($this-parser, XML_OPTION_CASE_FOLDING, TRUE); xml_set_element_handler($this-parser, $this-start, $this-end); xml_set_character_data_handler($this-parser, $this-data); } function goodbye() { // a manual destructor xml_parser_free($this-parser); // other things possibly too } function start($p2, $name, $attr) { // do things here } function data($p2, $data) { // do some more here } function end($p2, $name) { // do even more things here } [... and so on ...] ... But since there is no way to set a callback to $this-[function_name] one must create a global function that uses a global object and passes things to the method inside the class.. Is the a way to address this? or perhaps a better way to deal with callback function names? --Douglas Marsh _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4.04 -- 4.1.2 incompatible
Petre Agenbag wrote: My oh my OK, can someone help with this one??? My original Form conatined the following: form action=test.php method=POST enctype=multipart/form-data bla, bla And then things broke, so, out of curiosity, I removed the enctype= part, and now it works/ Another tip you might find useful if you're writing code that outputs a FORM that posts to itself, is to echo $PHP_SELF instead of hard-coding the target. If you happen to move your code elsewhere in the future, this will save you the time of having to go back and specify a new POST target. drw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] domxml
Hi, I have a web page with a form. I want the user to be able to use the £ symbol in a text field on the form. I then pass the value of the text field(the £ symbol) to a DOMXML function which creates a XML string which is transformed into XHTML using the XSLT functions. I have a meta tag defining the encoding of the web page as UTF-8. (So the £ symbol is being passed into the DOMXML function in this format? I echo it out just before doing this and it displays correctly.) the DOMXML functions use UTF-8 for input and output. When I echo the XML output before passing it to the XSLT functions, I see that it has placed a  symbol immediately before the £ symbol. Why? What is going on? Any ideas very much appreciated. Douglas. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] seesion_register() with arrays
Hi All, I´m trying to register into a session an array which has returned from a mysql_fetch_array function. But when I call $array it returns empty or something like this. Do you know how can I do this operation? Regards! Here go my scripts: ? # script1.php4 session_start(); $sql = select * from table1; $result = mysql_query ($sql); ... form name=form1 method=post action=test.php4?session_id=?echo session_id();? while ($array = mysql_fetch_array($result)) {...} session_register (array); ? ? # script2.php4 session_start($session_id); if (session_is_registered(array)) { while ($array) { echo $array[fieldname]; } } else { echo Errorbr; } ?
RE: [PHP] Session Initially Does Work
There is a session problem with 4.1 If register_globals is ON, then use session_register(). If it's off, then use $_SESSION[name] = value; and the value will automatically be registered. What kind of session problem? I currently have register_globals set to on. I am already using session_register(). Hi. I've run into a problem with my PHP session. I'm running PHP 4.1.0 on OpenBSD v3.0 using .HTACCESS and mod_mysql. I have a PHP file that is referenced every time content is requested on the web site (this file also sets/restores the session). This PHP file includes [include()] the requested content within. When my session is created I register 6 variables. The problem comes into play when you want to access one of the 6 registered variables on the initial page (after the user logs in). For some reason the registered variables are not recognized. I'm accessing the register variables using $_SESSION[variable_name]. I've also assigned values to these variables. The funny thing about the whole issue is if you reload/refresh the page or load something else after the initial page everything works fine. I require this to work initially because if someone comes in directly using a link certain content will render a error message because the registered variable is not present for some reason. Oh and yes the cookie to set the session is being put on the client's machine properly and at the initial page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session Initially Doesn't Work
Alright that's good to hear. In a specific case that I'm having this problem the main PHP file is including file (content) that refers to $_SESSION[nSID_PeopleID] in main. This value is vital in rendering the page. So it should be there right? Also about removing session_name(), how can I do this. It was my understanding that you must call session_name before session_start() and session_register(). Is this not correct? Ahhh, so that's your problem thenthe include isn't getting the session id. I've never used an include with a session setup before but I would see the easiest thing to do be have the include first echo the session id number and see if it is actually getting passed or not on the first call echo session_id(); Yuppers. I played around with the echo session_id(); and found it was not getting into the scope of the included file. So I removed all session_register() and replaced it with $_SESSION['varname'] = 'value'; and it solve the problem. Your not suppose (not recommended) to use session_register() anways, right? Thanks for the help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session Initially Does Work
Hi. I've run into a problem with my PHP session. I'm running PHP 4.1.0 on OpenBSD v3.0 using .HTACCESS and mod_mysql. I have a PHP file that is referenced every time content is requested on the web site (this file also sets/restores the session). This PHP file includes [include()] the requested content within. When my session is created I register 6 variables. The problem comes into play when you want to access one of the 6 registered variables on the initial page (after the user logs in). For some reason the registered variables are not recognized. I'm accessing the register variables using $_SESSION[variable_name]. I've also assigned values to these variables. The funny thing about the whole issue is if you reload/refresh the page or load something else after the initial page everything works fine. I require this to work initially because if someone comes in directly using a link certain content will render a error message because the registered variable is not present for some reason. Oh and yes the cookie to set the session is being put on the client's machine properly and at the initial page. Am I doing something wrong? Any suggestions would be greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session Initially Does Work
I already have this setup. The session works just not on the initial page after login. Add ? session_start(); ? At the top of each page, before anything else is done. -Original Message- From: Adam Douglas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:15 PM To: PHP-General (mailing list) (E-mail) Subject: [PHP] Session Initially Does Work Hi. I've run into a problem with my PHP session. I'm running PHP 4.1.0 on OpenBSD v3.0 using .HTACCESS and mod_mysql. I have a PHP file that is referenced every time content is requested on the web site (this file also sets/restores the session). This PHP file includes [include()] the requested content within. When my session is created I register 6 variables. The problem comes into play when you want to access one of the 6 registered variables on the initial page (after the user logs in). For some reason the registered variables are not recognized. I'm accessing the register variables using $_SESSION[variable_name]. I've also assigned values to these variables. The funny thing about the whole issue is if you reload/refresh the page or load something else after the initial page everything works fine. I require this to work initially because if someone comes in directly using a link certain content will render a error message because the registered variable is not present for some reason. Oh and yes the cookie to set the session is being put on the client's machine properly and at the initial page. Am I doing something wrong? Any suggestions would be greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session Initially Does Work
something else after the initial page everything works fine. I require this to work initially because if someone comes in directly using a link certain content will render a error message because the registered variable is not present for some reason. Oh and yes the cookie to set the session is being put on the client's machine properly and at the initial page. When do you set the session cookie? Keep in mind cookies don't not function in the same call they are created so say you create the cookie on page A, until the user refreshes page A or goes to page B the cookie won't actually be in effect. Well the cookie is set at the start of the PHP file that gets referenced each time. I'm not setting any manual cookies just using the default session cookie set by PHP. Below is all the code I use for the session. Formatting is kind of goofed up in e-mail but it's there. So even though the cookie is placed in the client's browser it's not used/session is not used or recognized until you refresh/reload or go to another page?? -- Code Snippet -- session_name(sid); $nSession = session_start(); if(isset($REMOTE_USER)) { if(!$nSID_PeopleID) { $szQuery = SELECT WebAccounts.People_ID, WebAccounts.Security_Level, People.Status_Type_ID, Company.Company_Status_ID FROM WebAccounts, People, Company WHERE WebAccounts.People_ID=People.People_ID AND People.Company_ID=Company.Company_ID AND User_Name='$REMOTE_USER'; $szDBConn = mysql_connect(server_address,user_name,password) or die(could not connect to server for security authentication.); mysql_select_db(venmar, $szDBConn) or die(could not connect to venmar for security // authentication.); $saResults = mysql_query($szQuery, $szDBConn) or die (could not query venmar for security authentication.); $obResults = mysql_fetch_row($saResults); $nSID_PeopleID = $obResults[0]; $nSID_SecurityLevel = $obResults[1];$nSID_PeopleStatus = $obResults[2]; $nSID_CompanyStatus = $obResults[3]; $szQuery1 = SELECT PeopleMailing.Country_ID FROM PeopleMailing, WebAccounts WHERE WebAccounts.People_ID=PeopleMailing.People_ID AND WebAccounts.User_Name='$REMOTE_USER'; $dbConnection = mysql_connect(server_address, user_name, password) or die(could not connect to server for security authentication.); mysql_select_db(venmar, $szDBConn) or die(could not connect to venmar for security authentication.); $saResults1 = mysql_query($szQuery1, $szDBConn) or die (could not query venmar for security authentication.); $obResults1 = mysql_fetch_row($saResults1); $nSID_Country = $obResults1[0]; if(!$obResults1[0]) { $szQuery1 = SELECT Company.Country_ID FROM Company, WebAccounts, People WHERE WebAccounts.People_ID=People.People_ID AND People.Company_ID=Company.Company_ID AND WebAccounts.User_Name='$REMOTE_USER'; $saResults1 = mysql_query($szQuery1, $szDBConn) or die (could not query venmar for security authentication (24).); $obResults1 = mysql_fetch_row($saResults1); $nSID_Country = $obResults1[0]; } mysql_close(); if($obResults[2] == 1 $obResults[3] == 1) { if($nSession == 1) { session_register(nSession); session_register(nSID_PeopleID); session_register(nSID_SecurityLevel); session_register(nSID_PeopleStatus); session_register(nSID_CompanyStatus); session_register(nSID_Country); $szQuery = SELECT First_Login, Last_Login, Creation_Date FROM WebAccounts WHERE User_Name='$REMOTE_USER'; $dbConnection = mysql_connect(server_address, user_name, password) or die(could not connect to server for security authentication.); mysql_select_db(venmar, $dbConnection) or die(could not connect to venmar for security authentication.); $saResults = mysql_query($szQuery, $dbConnection) or die (could not query venmar for security authentication.); $obResults = mysql_fetch_row($saResults); if($obResults[0] == 00) {
RE: [PHP] Session Initially Does Work
That's correct, although the cookie will remain resident it requires an inital page change/refresh. However after looking at your code I'm not convinced that is the problem since the first page of a session creation should still be usable with the session as the session ID is still resident in memory. Have you tried running the page w/o the use of session_name()? Alright that's good to hear. In a specific case that I'm having this problem the main PHP file is including file (content) that refers to $_SESSION[nSID_PeopleID] in main. This value is vital in rendering the page. So it should be there right? Also about removing session_name(), how can I do this. It was my understanding that you must call session_name before session_start() and session_register(). Is this not correct? Also as an FYI $REMOTE_USER is an unsecure variable to use for checking authentication. Basically because a url parameter will overwrite the original $REMOTE_USER. easiest method (for me anyways) is: $REMOTE_USER = getenv('REMOTE_USER'); Yes I've never felt good about using REMOTE_USER. I will implement that idea right now, thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec() or passthru()
Hi, I have a bash script I need to run. I have tried all the various program execution commands. My script never completes. It only get 1/4 of the way through. I have tried running the script in the background. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec() or passthru()
Hi, I have a bash script I need to run. I have tried all the various program execution commands. My script never completes. It only get 1/4 of the way through. I have tried running the script in the background. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What is - mean in php?
Used in conjunction with classes. class Foo { var bar; function Foo($bar) { $this-bar = $bar; } } $foo = new Foo(foobar); echo $foo-bar; // foobar For interests sake here's the same in C++ (correct me if I'm wrong it's been a long time since I used C++ or pointers). class Foo { char *bar; function Foo(bar) { this.bar = bar; } } Foo *foo = new Foo(foobar); cout (*foo).bar; // foobar // which also works as. cout foo-bar; // foobar -Original Message- From: Stephano Mariani [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 12:57 To: 'Kearns, Terry'; 'S.Murali Krishna'; 'Jack' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] What is - mean in php? PHP uses - as C++ uses ., since PHP already uses . for strings. Stephano Mariani -Original Message- From: Kearns, Terry [mailto:[EMAIL PROTECTED]] Sent: Friday, 8 March 2002 12:28 AM To: 'S.Murali Krishna'; Jack Cc: [EMAIL PROTECTED] Subject: RE: [PHP] What is - mean in php? Because I'm not a hacker on the PHP engine, I don't really know but I also saw this symbol when learning C++ recently. It is used in C++ as a shortcut to dereferencing and accessing an objects properties/methods on objects which are on the free store (heap). Normally C++ uses the dot operator to access methods/properties (eg. foo.do()), but when the object needs to first be dereferenced, then foo-do() can be used as a shortcut to (*foo).do(). Of course, this doesn't help you at all does it :) But I thought it was an interesting connection to C++ and maybe hints at how PHP internally manages objects. Perhaps it's just a coincidence. [TK] -Original Message- From: S.Murali Krishna [mailto:[EMAIL PROTECTED]] Sent: Monday, 4 March 2002 9:48 PM To: Jack Cc: [EMAIL PROTECTED] Subject: Re: [PHP] What is - mean in php? If you have any Object Oriented Programming experience, then you may not had asked this. Its a operator to access methods, and variables inside a instance of a class , in which the variable before - is the instance of the class and the latter is a method or variable of that class. This is what I know, if you have any explanatory docs, pls let me know. On Mon, 4 Mar 2002, Jack wrote: Dear all There is one symbol in PHP that i always see is -, could anyone pls tell me what is this, and what does that do? Here is the statement i saw could some pls explain what it means? if (!empty($row-usd_period) Thx a lot Jack [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php [EMAIL PROTECTED] --- We must use time wisely and forever realize that the time is always ripe to do right. -- Nelson Mandela --- -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need help with a PHP script
echo T.$username.$password; is PHP 2 and earlier proper syntax for PHP 3+ is echo T+$username+$password; or echo T$username$password; Doug
RE: [PHP] Need help with a PHP script
I can't believe I just sent this. For those who care it's the other way around. -Original Message- From: Douglas Maclaine-cross Sent: Monday, March 04, 2002 14:08 To: 'PHP'; [EMAIL PROTECTED] Subject: RE: [PHP] Need help with a PHP script echo T.$username.$password; is PHP 2 and earlier proper syntax for PHP 3+ is echo T+$username+$password; or echo T$username$password; Doug
RE: [PHP] Re: regular expressions
Use single quotes? I think that stops it from interpreting the regular expression before hand. -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:32 To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: regular expressions yeah! remember that php interprets the string first, before it gets to reg.ex. !! That's some I keep forgetting... lol Martin -Original Message- From: Murray Chamberlain [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 2:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: regular expressions I think you have some un-needed code there. But anyway you might need to use a double backslash infront of the | If that doesn't work mail me back Muz German Castro Donoso [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a problem with ereg function. In php 4.0.5 i use this if ( ereg(([0-9][0-9]*)\|(\w\w*),$opcion, $registros) ) { ... } and no problem. But, in php 4.1.1 don't work. I think that may be the escape of | character. Note: I'm looking for a | in the string. Then i need escape the | Any idea for fix it? Thanks German Castro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I have a PHP and Flash5 Problem.
Ming! http://www.php.net/manual/en/function.swfmovie.php Don't make the mistake I made and overlook what Flash Action Script is capable of though. Doug -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:43 To: [EMAIL PROTECTED] Subject: [PHP] I have a PHP and Flash5 Problem. I know that you can generate images with PHP, is there away of generating FLASH docs? Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012
RE: [PHP] Regex function needed
$string = ereg_replace([A-Za-z']{1,3}, , $string); // don't forget I'm I haven't checked but something like this. -Original Message- From: Michael Kimsal [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:59 To: [EMAIL PROTECTED] Subject: [PHP] Regex function needed Looking for a regex (preg or ereg) to remove all 1, 2 and 3 character words. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regex function needed
I don't know about preg but how about this monster? $str = I'm okay now aren't I. Do I work? 'mm; while(eregi(' [a-z\']{1,3} ', $str)) $str = eregi_replace(' [a-z\']{1,3} ', ' ', $str); while(eregi(' [a-z\']{1,3}([^a-z\' ])', $str)) $str = eregi_replace(' [a-z\']{1,3}([^a-z\' ])', '\1', $str); while(eregi('([^a-z\' ])[a-z\']{1,3} ', $str)) $str = eregi_replace('([^a-z\' ])[a-z\']{1,3} ', '\1', $str); $str = eregi_replace('^[a-z\']{1,3} ', '', $str); $str = eregi_replace('^[a-z\']{1,3}([^a-z\'])', '\1', $str); $str = eregi_replace(' [a-z\']{1,3}$', '', $str); $str = eregi_replace('([^a-z\' ])[a-z\']{1,3}$', '\1', $str); echo $str; -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 11:09 To: Michael Kimsal; [EMAIL PROTECTED] Subject: Re: [PHP] Regex function needed after some puzzling I came to this: $str = One as a start. This is or was a test for short words, although an, should be deleted to.; $str = preg_replace(array(/\b[A-Za-z']{1,3}\b/, /[ ]{1}([ ]{1}|[,]{1}|[.]{1}|[:]{1})/), array(, \\1), $str); print $str; which means: first: replace all 1,2 or 3 character occurrences by nothing after that, replace all spaces that are followed by one comma, or one period, or one : by that comma, period or : hope this is what you wanted? Edward - Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Michael Kimsal [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 08, 2002 1:10 AM Subject: Re: [PHP] Regex function needed Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal: Looking for a regex (preg or ereg) to remove all 1, 2 and 3 character words. ? $string=over deze regex loop ik nu al de hele dag en een uur te piekeren. 't wil niet! of wel! l'a.; $string= .$string; while (preg_match(/\W\w{1,3}\W/i,$string)) $string = preg_replace(/\W\w{1,3}\W/i, , $string); $string=substr($string,1); echo $string; ? -- 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] How? :)
$news = mysql_query(select * from bookmarks ORDER by TNum,AU asc); $old_TNum = ; while ($mydata = mysql_fetch_object($news)) { $new_TNum = $mydata-TNum; if ($new_TNum != $old_TNum) #when TNum occurs the first time, echo it once only. { $old_TNum = $new_TNum; $body .= b.$temp.:/b; } $body .= li.$mydata-AU./li; } -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 14:05 To: [EMAIL PROTECTED] Subject: [PHP] How? :) Let's say I have two fields TNum and AU. TNum is a selectoptionBritishoptionAmericanoptionCanadian AU input name of an author. I want to sort them as follows. British Shakespeare American Joyce Samuels Twain Canadian Majors Kamboureli How do I get this to work in this code below? I want to echo TNum one time only and echo every AU. $news = mysql_query(select * from bookmarks ORDER by TNum,AU asc); while ($mydata = mysql_fetch_object($news)) { if (...??) #when TNum occurs the first time, echo it once only. { $body .= b.$mydata-TNum.:/b; } $body .= li.$mydata-AU./li; } -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Swapping BR for \n... ?
Or an even simpler str_replace(\n, BR, $sourcestring); -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 15:14 To: 'Jon'; [EMAIL PROTECTED] Subject: RE: [PHP] Swapping BR for \n... ? I'm processing a form but all the functions I've found on the web only seem to add the BR after the \n. I need to remove the \n altogether - anyone know how I can kill the \n and put a BR in it's place? Sounds like you want a simple ereg_replace(\n, BR, $sourcestring); Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: installing php with apache rpm???
At 10:04 PM 12/26/2001 -0800, Fred wrote: This guy has some great modular php rpms that will do the trick: http://rpms.arvin.dk/php/ Fred Duane Douglas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hello, i have an apache rpm installed. stuff will break if i uninstall it. how do i install php to work with it? thanks for the link. unfortunately, the rpm packages there don't work with rh linux 7.2. does anyone have another suggestion? tia Duane Douglas ASP / SQL Server Tutoring and Training -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] installing php with apache rpm (rh linux 7.2)???
hi gang! i have an apache rpm installed. stuff will break if i uninstall it. how do i install php to work with it? tia Duane Douglas ASP / SQL Server Tutoring and Training -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Can you fake a onClick?
I have checked the archives and not really found an answer, so here goes. My form contains a function called CountIt which increments a counter file on the site. I mainly use it to count the hits on the page. I also have multiple a links to .zip .txt files which can be accessed or downloaded. Is it possible somehow to fake an onclick event so that when the user clicks on the link I can use the CountIt function to increment a counter for that link?