Re: [PHP] "x" as a multiplier
Hi, try $newwidth." x ".$newheight instead. It's important to put the spaces inside the " <- ...don't know the word :-) If it's still not working you could try settype($newwidth, "string"); settype($newheight, "string"); echo $newwidth." x ".$newheigt; but I think, this is not necessary! HTH, Bastian > Exactly. But it's only giving me one of the numbers without the space > between the numbers and the x. > > > > $newwidth . "x" . $newheight -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prevent storing data when reload
On Wednesday 04 December 2002 07:39, Justin French wrote: > > When I reload the page the data gets stored once more. I'm sure this is a > > well known problem. Are there any smart tricks to prevent this from > > happening? > > Yes, and they get discussed on this list almost daily... a quick search > would have helped. If only browser makers made their browsers behaved properly according to specs. Most of these page refreshing problems occur when people use the "BACK" button after they filled in a form (probably to see what they filled in). In stupid browsers like IE and Mozilla it _forces_ you to repost the data. IOW the back button doesn't really go back, to the previous state, like what the specs say it should do. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Above all else -- sky. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to handle "so called" expired sessions??
I was the original poster to this topic. Quite suprised it continued.. I have my sessions stored in a database, thus I thought the problem was there, but have come to realise, that is how sessions behave naturally. I originally thought, that the expired session garbage collection dumps stale sessions, if the user is away after the default 24 minutes. But in my case, it does, but since the user still has a valid session cookie containing valid data, the session is brought back from the dead even if hours has passed, and the browser hasn't closed. Not desirable for me. As Tom pointed out to me, (which I haven't gotten around to do as yet) in not so many words -> 1. When the user logs in assign a session variable to lets say time() + 600 (10 mins in the future). 2. Each page load, refresh the session variable in step 1 *if* the session variable references a future timestamp. 3. If on a page load, the session variable references a past (older than time() - 600) timestamp, core dump the session data -> $_SESSION = array(); to /dev/null, hell, whatever makes you happy... Although I haven't gotten around to using these steps, it seems like it would work for what Im trying to achieve. John W. Holmes wrote: No question :) It's just that this is what the original question was about and why I suggested doing his own sesssion timeout check as the deleting proccess is too unreliable to depend on for timeout handling. PHP will quite happily return stale data which could be bad in a login type of situation. Okay. I think I thought you were the original poster. How do you know it's returning "stale" data, though? If the cookie is valid, and there is still a session file (or data in memory), then why is it stale or expired. Maybe I'm just missing something here. If it's expired because you think it's too old, then you track your own timestamps and do your own cleanup. Is that what you're saying? ---John Holmes... -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Instalaciñon PHP
Hoa a todos, Deseo hacer uso de PHP para crear formularios con la finalidad de acceder a una base de datos MySQL 3.23.53a (todo sobre Linux). Tengo instalado ahora mismo RADIUS y MySQL e iba a decidirme a montar PHP. He estadoobservando las indicaciones de instalación y la verdad, soy bastante novato en el entorno Linux, y ya me he visto con problemas para instalar lo anterior. Alguien podría echarme una mano indicándome las opciones necesarias para la instalción, así como los cambio que deba efectuar sobre el servidor web Apache? Muchisimas gracias
[PHP] Not able to connect to FTP server
Hi friends, I am having a DSL Internet connectivity in our office and my PC is connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the browser(Mozilla) in my PC is configured to connect to net through the proxy When I tried to connect to our ftp site using the following script, I have received the message that Unable to connect. But the same script is working fine with a direct modem connection. The script is // connect to ftp server if(!($ftp=ftp_connect("ftp.dirw.net"))) { print("Unable to connect"); exit; } Please suggest me on how to connect to the ftp site using the proxy server. Regards, Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formating numbers & date
On Wednesday 04 December 2002 08:29, Jeff Bluemel wrote: > ... but the date format doesn't seem to > allow me to pass it a date. Your code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Information Processing: What you call data processing when people are so disgusted with it they won't let it be discussed in their presence. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Show Folder Contents in Form
On Wednesday 04 December 2002 09:41, Stephen wrote: > Nevermind, I fixed it. But now I have another problem. One, my select box > has some sub-directories. How cna I filter those out? It is also showing a > bunch of numbers. I included a screenshot of the select box. The following > is the code: > > function sortByTime($a, $b) > { > if ($a["time"] == $b["time"]) return 0; > return ($a["time"] < $b["time"]) ? -1 : 1; > } > if($handle = opendir('/Inetpub/wwwroot/checker/modules/')) > { > while (false != ($file = readdir($handle))) > { > if ($file != "." && $file != "..") To filter out directories add an extra check here using is_dir(). > $files[] = array("file" => $file, "time" => > filectime("/Inetpub/wwwroot/checker/modules/".$file)); > } Your "bunch of numbers" is the file creation date and originates from the above and assigned to your box further down. > usort($files, "sortBytime"); > > echo ""; > while (list(,$filearr) = each($files)) > { > echo " value=\"".$filearr["file"]."\">".$filearr["file"]."".$filearr["time"]; > } > echo ""; > } >?> It's all very well asking for help and receiving some code in return. You have to take some time out to understand what the code is actually doing instead of just blindly using it. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I have always noticed that whenever a radical takes to Imperialism, he catches it in a very acute form. -- Winston Churchill, 1903 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] request for help/advice (xml content management)
Hello, I am the creator of eNetwizard Content Management Server, an open source content management system using the LAMP suite. I am getting ready for its first major release and have come across some problems that I need to address first... I'm not really sure where to start this is such a *huge* project... Some preliminary information about the project can be found here: http://projects.enetwizard.net/cmserver.ehtml http://sourceforge.net/docman/display_doc.php?docid=12504&group_id=59790 Content is stored as XML in files within a matrix folder. eNetwizard defines several scopes allowing templates and content to be generated on the fly in a scopeable manner. For example, any website at enetwizard.net has the same look and feel because of the domain scope matrix file; I have made this file publicly accessible if you go here: http://www.enetwizard.net/matrix1.php Another scope is the page scope which is where the main content for a page is located, so for the default page at enetwizard.net, it looks like this file: http://www.enetwizard.net/matrix2.php This allows the server to automatically assemble and render content in a variety of formats as you can see here: http://www.enetwizard.net/default.exml (as XML) http://www.enetwizard.net/default.ehtml (as HTML) This is the main idea behind "general content" stored by the server -- there are other ways of doing things that are even more advanced but they will not be discussed here. In order for this to work, I created an xmldoc class that can assemble all of the files together and create the file accordingly. It is then outputted via the server class. Examples of these files are here: http://www.enetwizard.net/xmldoc.php http://www.enetwizard.net/server.php Worth noting, the matrix files can contain PHP code, which is evaluated in the xmldoc class to create an actual XML document. These two classes are in their elementary forms. And they already have more issues than can be tolerated for such an advanced content management system. First of all, I cannot use the & character anywhere because of the fact it is an XML file. This creates a serious problem and must be addressed. Secondly, any errors that exist in a matrix file will effectively break the page. This too is a major issue that muse be addressed, especially since it conflicts with the website wizard (which is responsible for managing existing and new content). I believe there must be a smarter way to do this and I would like any feedback one might have in this arena. I believe using regex's might be a better solution, especially since some unique tags, such as a tag must replace be replaced by the xmldoc class with the actual content of the wizard it is referencing, same scenario for the tag (which are customizable web applications), etc. At present this cannot work the way I have it set up. I cannot make a public release until this is fixed stably and fully productive. I am looking for someone who can help me with this XML stuff, and other competent programmers who would like to volunteer for this project. And I'm always interested in those who can translate both the localization files (eNetwizard supports any language) and the main network (enetwizard.net) into other languages. Please contact me if you can help. Thanks! If you have any questions, please feel free to ask them. Robert Samuel White eNetwizard Technical Services 284 Walnut Highland, Michigan 48357 +1 (248) 889-6363 www.rswfire.com www.enetwizard.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with session variables
On Wednesday 04 December 2002 14:12, Manuel Ochoa wrote: > I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at > the following code as I cannot figure out what I'm doing wrong. > > Page1. > session_start(); > session_register("step"); > $step=1; > header("location: page_A.php"); > > Page_A. > session_start(); > extract($_SESSION); > $step=2; > header("location: page_B.php"); > > Page_B. > session_start(); > extract($_SESSION); > print("$step"); > > Output is always "1". I thought that session variables were global? What am > I doing wrong? If register_globals is disabled then you DO NOT use the session_register(), session_unregister() functions. You set them directly using: $_SESSION['step'] = 2 You remove them using: unset($_SESSION['step']) If register_globals is enabled THEN you use the session_register(), session_unregister() functions. In which case in your examples above, the use of extract($_SESSION) is meaningless, and you need to session_register('step'), then $step = 2. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* You have taken yourself too seriously. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP not reporting errors, but hangs!!
On Wednesday 04 December 2002 11:55 am, Siva Kumar wrote: > About 3 months back I posted the following message to the list: > > On Saturday 12 October 2002 12:11 pm, Siva Kumar wrote: > > I am running Apache/PHP with Postgresql. For the past one day, whenever > > there is an error in the php script, instead of reporting the error, the > > page takes forever to load. Normal html pages load properly. > > Now we found what causes the problem. > > By default debugger.enable is set to false in the php_ini. Somehow, the > value got changed to 'true' (don't know how) resulting in the problem > described above. The debugger started in the background whenver a page > with error is called, and the browser does not show the page. > > When the value is reset to 'false' it works as expected. > > Can someone explain, how the value can change on its own. (This has > happened for the second time yesterday). > > Best regards, > > Siva > > > > Ma Siva Kumar, > BSG LeatherLink, > Chennai, India. > http://www.leatherlink.net/ -- Ma Siva Kumar, BSG LeatherLink, Chennai, India. +91 44 6215110 +91 44 7170019 [EMAIL PROTECTED] http://www.leatherlink.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B I blame PHP. Can't be MySQL. echo $sql displays the EXACT same thing. Debugging ... Works jdaxell.ccl = 2 records found: $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\'"ready maria"\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.test.inc.phps Doesn't work - Resembles +ready +maria $sql = "SELECT id,AU,ST,BT,AT FROM $table WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = "SELECT id,AU,ST,BT,AT FROM ".$table." WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.table.inc.phps :0 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B I blame PHP. Can't be MySQL. echo $sql displays the EXACT same thing. Debugging ... Works jdaxell.ccl = 2 records found: $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\'"ready maria"\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.test.inc.phps Doesn't work - Resembles +ready +maria $sql = "SELECT id,AU,ST,BT,AT FROM $table WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = "SELECT id,AU,ST,BT,AT FROM ".$table." WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.table.inc.phps :0 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cold Fusion conversion issues: app vars and cached queries
--- Steve W <[EMAIL PROTECTED]> wrote: > My company is looking to move our site away from Cold > Fusion due to the cost. We had talked about JSP, but I > would highly prefer PHP. After evaluation, with the > generic database functions now supporting Oracle in CVS, > I think this might be a possibility. However, there are > 2 concerns I have in converting from Cold Fusion. > > 1) Application variables > 2) Cached queries I can possibly field the first one. ColdFusion has server, application, session, and client scopes, right? Each have their own unique characteristics about them. However, if you speak with the top Macromedia engineers, you will see that client variables are preferred in most cases for high-traffic applications. Server, application, and session variables must be locked with cflock to solve synchronization problems, and cflock under load can present some noticeable bottlenecks. CF's client variables are basically identical to PHP session variables. Rather than having a variable scope such as client.foo, PHP has an array $_SESSION["foo"]. PHP, by default, stores session variables on the local filesystem, so you will want to alter this behavior if you are developing for a clustered environment (which I assume you will be). You have much more flexibility in PHP to alter its default session management mechanism than you have flexibility in the cfapplication tag, but it is not nearly as quick and convenient to do so (especially for using a data store for session storage). However, once you do this once, you will find that programming for the PHP environment is no more difficult than for ColdFusion, and you will probably learn to appreciate the flexibility. I am not aware of an equivalent feature to ColdFusion's cached queries, but perhaps someone else can speak up on that one. > I've seen some solutions to both problems, but mainly I > want the solution to meet one and ideally both of the > following qualifications. First, I don't want to have to > use an add in module. I'd like to only use core PHP > functions and modules that are part of the full PHP > distribution and not SRM or other add-on modules. If you use PHP's built-in session management, you will have no problems with this. Your code will include any logic you add to alter the default behavior, such as in the case of using a central data store for session variables. If you write your own utility, which is pretty trivial, you will also not run into any trouble. I honestly do not care for either PHP or ColdFusion's built-in session management, so I prefer the flexibility PHP gives me to alter its. When developing ColdFusion applications for high-profile sites, I often implement my own mechanism. > These issues above as well as things like not being able > to centrally configure a database connection by using an > alias for the name are areas PHP lacks in comparision to > Cold Fusion. ColdFusion definitely makes managing database connections easier. PHP has no equivalent to the cfadministrator, so many things like this are easier with CF. However, I think you will find that PHP has a slight edge in performance in this regard, even when using native drivers (which you should, of course) in CF. I cannot rightly comment on PHP's Oracle support, however, as I have never used it. > Our CF application gets installed at client sites. Using > PHP, it would require a code change in a db connect file > to change the DB connection information where it really > should be configurable in a central PHP conf file. There are differences, no doubt. I understand your point; you let your clients configure their database connection with cfadministrator and assign it a name that your code uses in its cfquery tags. This makes code quite portable. With PHP, it is not too much more trouble to ask them to assign it a username, password, and name (of the database). Otherwise, you can do like many people do and allow your clients to configure and/or install your application according to their own environment. Meaning, you don't write cfadministrator in PHP, but you do let them change database access credentials and any other basic configuration by using your application. > Even with this being said, I'd like to use PHP for our > application if the 2 issues above can be resolved. I wouldn't look to people being excited about trying to match features with ColdFusion. PHP and CF are simply different. In a survey done a year or two ago (around the time CF 5 came out, I believe), PHP was rated as the most flexible and efficient, and CF was rated as the easiest for beginners and therefore generally more productive. Most PHP developers would prefer to be free from all of the bloat that would be necessary to make it as easy to administer as CF. Also, remember that a big difference stems from the fact that CF is a separate process. PHP (when used as an Apache module, for example) is nothing in and of itself. You really just have a more intelligent Web serve
[PHP] Help with session variables
I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at the following code as I cannot figure out what I'm doing wrong. Page1. session_start(); session_register("step"); $step=1; header("location: page_A.php"); Page_A. session_start(); extract($_SESSION); $step=2; header("location: page_B.php"); Page_B. session_start(); extract($_SESSION); print("$step"); Output is always "1". I thought that session variables were global? What am I doing wrong?
Re: [PHP] Whimper, help :)
Peter Houchin wrote: Mostly varchar(255) and a couple of text. (I may have one longtext). But should that make a difference? Like I said, I can run the same SQL in PHPMyAdmin (a MySQL interface) and I get the correct reponse. But pass it through PHP and kablooey. Won't work? John > what are the field types in the mysql DB? > > > -Original Message- > > From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 4 December 2002 4:13 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] Whimper, help :) > > > > > > Tom, > > Anyone, > > > > No I'm not looking for a ", I'm trying to pass double quotes into MySQL. > > Like I said, it works when debugging: > > > > http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+ > > maria%26quot%3B > > http://ccl.flsh.usherb.ca/print/display.test.inc.phps > > > > but fails when I try to pass my double quotes in: > > > > http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+ > > maria%26quot%3B > > http://ccl.flsh.usherb.ca/print/display.table.inc.phps > > > > $sql = "SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH > > (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) > > AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; > > > > I already have the $search > > > > I have tried many variations. > > > > > If you are looking for " in a string just quote it with ' > > > example > > > $like = '"ready maria"'; > > > $ sql = " SELECT .. WHERE LIKE '$like'"; > > > no need to escape anything > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- John Taylor-Johnston - "If it's not open-source, it's Murphy's Law." ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not able to connect to FTP server
Hi friends, I am having a DSL Internet connectivity in our office and my PC is connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the browser(Mozilla) in my PC is configured to connect to net through the proxy When I tried to connect to our ftp site using the following script, I have received the message that Unable to connect. But the same script is working fine with a direct modem connection. The script is // connect to ftp server if(!($ftp=ftp_connect("ftp.dirw.net"))) { print("Unable to connect"); exit; } Please suggest me on how to connect to the ftp site using the proxy server. Regards, Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mcrypt 2.4.x - trouble with small data fields?
>Is there a minimum field size for using mcrypt? Boy I feel dumb now. :) My answer was in my post. Mcrypt returns a string that is usually longer than the original string, since the return has to be a multiple of the block size used. So a 2-character string takes "blocksize" characters when encrypted. Mcrypt also apparently needs the extra characters when decrypting. - Steve Yates - If at first you don't succeed, lower your standards. ~ Taglines by Taglinator - www.srtware.com ~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Whimper, help :)
what are the field types in the mysql DB? > -Original Message- > From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 4 December 2002 4:13 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Whimper, help :) > > > Tom, > Anyone, > > No I'm not looking for a ", I'm trying to pass double quotes into MySQL. > Like I said, it works when debugging: > > http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+ > maria%26quot%3B > http://ccl.flsh.usherb.ca/print/display.test.inc.phps > > but fails when I try to pass my double quotes in: > > http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+ > maria%26quot%3B > http://ccl.flsh.usherb.ca/print/display.table.inc.phps > > $sql = "SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH > (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) > AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; > > I already have the $search > > I have tried many variations. > > > If you are looking for " in a string just quote it with ' > > example > > $like = '"ready maria"'; > > $ sql = " SELECT .. WHERE LIKE '$like'"; > > no need to escape anything > > > -- > 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] Whimper, help :)
Tom, Anyone, No I'm not looking for a ", I'm trying to pass double quotes into MySQL. Like I said, it works when debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.test.inc.phps but fails when I try to pass my double quotes in: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.table.inc.phps $sql = "SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; I already have the $search I have tried many variations. > If you are looking for " in a string just quote it with ' > example > $like = '"ready maria"'; > $ sql = " SELECT .. WHERE LIKE '$like'"; > no need to escape anything -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Prevent storing data when reload
"Lars Espelid" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > When I reload the page the data gets stored once more. if (record already exists) { echo "hey you hit reload!" } else { [save record to database] } - Steve Yates - I know a good tagline when I steal one. ~ Taglines by Taglinator - www.srtware.com ~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
Hi, Wednesday, December 4, 2002, 2:06:36 PM, you wrote: JTJ> Martin, JTJ> Anyone, JTJ> I'm desperate :( PHP isn't sending my SQL correctly. It's not a MySQL problem. It's my PHP syntax. JTJ> Debugging: JTJ> http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B JTJ> $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST JTJ> (\'"ready maria"\' IN BOOLEAN MODE) ORDER BY id asc'; JTJ> Yay ... :) it works!!! (http://ccl.flsh.usherb.ca/print/display.test.inc.phps) JTJ> If I copy & paste this SQL into PHPMyAdmin, it works. JTJ> BUT IT WON'T WORK IN PHP. The code belows echos $sql correctly, but MySQL thinks it received: JTJ> +ready +maria JTJ> not JTJ> "ready maria" JTJ> See: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B JTJ> $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST JTJ> (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id JTJ> asc'; JTJ> $sql = "SELECT ... FROM `$table` WHERE MATCH ... AGAINST JTJ> ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id JTJ> asc"; JTJ> See (http://ccl.flsh.usherb.ca/print/display.table.inc.phps) JTJ> What is the correct PHP syntax to get MySQl to read my SQl correctly? JTJ> What am I f***ing up? JTJ> John If you are looking for " in a string just quote it with ' example $like = '"ready maria"'; $ sql = " SELECT .. WHERE LIKE '$like'"; no need to escape anything -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[6]: [PHP] How to handle "so called" expired sessions??
Hi, Wednesday, December 4, 2002, 1:59:11 PM, you wrote: JWH> Okay. I think I thought you were the original poster. How do you know JWH> it's returning "stale" data, though? If the cookie is valid, and there JWH> is still a session file (or data in memory), then why is it stale or JWH> expired. Maybe I'm just missing something here. If it's expired because JWH> you think it's too old, then you track your own timestamps and do your JWH> own cleanup. Is that what you're saying? Yes exactly, common problem is someone logs in but doesn't log out and the session is open to everyone, session timeout is supposed to help prevent these cases or at least reduce the chance. But of course the main use of session timeout is to frustrate developers who take more than 40 mins to suss out the next bit of code -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Whimper, help :)
Martin, Anyone, I'm desperate :( PHP isn't sending my SQL correctly. It's not a MySQL problem. It's my PHP syntax. Debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST (\'"ready maria"\' IN BOOLEAN MODE) ORDER BY id asc'; Yay ... :) it works!!! (http://ccl.flsh.usherb.ca/print/display.test.inc.phps) If I copy & paste this SQL into PHPMyAdmin, it works. BUT IT WON'T WORK IN PHP. The code belows echos $sql correctly, but MySQL thinks it received: +ready +maria not "ready maria" See: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; $sql = "SELECT ... FROM `$table` WHERE MATCH ... AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER BY id asc"; See (http://ccl.flsh.usherb.ca/print/display.table.inc.phps) What is the correct PHP syntax to get MySQl to read my SQl correctly? What am I f***ing up? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[4]: [PHP] How to handle "so called" expired sessions??
> No question :) > It's just that this is what the original question was about and why I > suggested > doing his own sesssion timeout check as the deleting proccess is too > unreliable > to depend on for timeout handling. PHP will quite happily return stale > data > which could be bad in a login type of situation. Okay. I think I thought you were the original poster. How do you know it's returning "stale" data, though? If the cookie is valid, and there is still a session file (or data in memory), then why is it stale or expired. Maybe I'm just missing something here. If it's expired because you think it's too old, then you track your own timestamps and do your own cleanup. Is that what you're saying? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to make a individual submit...
> i have got me a form, that when submitted is effectlively only one > variable, > but when i submit it, it grabs the last field displayed instead of the one > selected.. normally this would be easy but I think because I have it > inside > a loop it's playing havock on me.. > > > -[form code in side the while loop] - > // print all records in the DB > while ($myrow = mysql_fetch_array($res)): > $count++;?> > > echo $count;?> > > > class="content"> > class="content"> > value=""> value="send">// pass on $myrow['id'] to next page > > > --- Okay, so you've got a bunch of hidden elements all with the same name and a bunch of submit buttons with the same name. Which "number" do you expect the "submit" button you choose to send? It's only going to choose the last one, since that was the last "number" that was given a value. The easy way to do this would be to just send the value you're after as the value of your submit button. Or, you could put form tags within your code above, so each hidden element and submit button is it's own form. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] How to handle "so called" expired sessions??
Hi, Wednesday, December 4, 2002, 1:33:03 PM, you wrote: No question :) It's just that this is what the original question was about and why I suggested doing his own sesssion timeout check as the deleting proccess is too unreliable to depend on for timeout handling. PHP will quite happily return stale data which could be bad in a login type of situation. JWH> Okay, so what's your question? The cookie and data is still there, but JWH> it's expired? How? As far as I know it's not expired until it is JWH> deleted. JWH> ---John Holmes... -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to make a individual submit...
howdy i have got me a form, that when submitted is effectlively only one variable, but when i submit it, it grabs the last field displayed instead of the one selected.. normally this would be easy but I think because I have it inside a loop it's playing havock on me.. -[form code in side the while loop] - // print all records in the DB while ($myrow = mysql_fetch_array($res)): $count++;?> // pass on $myrow['id'] to next page --- --[processing code of the form]-- function usubmit(){ $id = $_POST['number']; $res=mysql_query("SELECT * from users WHERE id='$id'"); $num = mysql_numrows($res) or die ( Header("Location: logerror.php?op=log_error") ); $email = mysql_result($res, 0, 'email'); $passwd = mysql_result($res, 0, 'passwd'); $uname = mysql_result($res, 0, 'uname'); $fname = mysql_result($res, 0, 'firstname'); if(!$boo){ echo mysql_error(); } else { //test output of values echo $id; // show's id to be the last id in the DB echo ""; echo $email; echo ""; echo $uname; echo ""; echo $passwd; echo ""; echo $fname; echo ""; } --- Cheers Peter "the only dumb question is the one that wasn't asked" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] How to handle "so called" expired sessions??
Hi, Wednesday, December 4, 2002, 1:04:07 PM, you wrote: S> I have a similar problem only my sessions expire once you leave the site, S> even for a second. I'm not so experienced with cookies so how can I fix S> this? S> - Original Message - S> From: "Tom Rogers" <[EMAIL PROTECTED]> S> To: "John W. Holmes" <[EMAIL PROTECTED]> S> Cc: "'Gerard Samuel'" <[EMAIL PROTECTED]>; "'php-gen'" S> <[EMAIL PROTECTED]> S> Sent: Tuesday, December 03, 2002 9:52 PM S> Subject: Re[2]: [PHP] How to handle "so called" expired sessions?? >> Hi, >> >> Wednesday, December 4, 2002, 4:01:07 AM, you wrote: >> >> Ive just been getting myself deep into using sessions. >> >> Sessions are working as it should except for one condition. >> >> Say I log into the site, and the session is started, and I don't do >> >> anything for the next 30 mins, then go back to the site. >> >> Im temporarily logged out, but because the session cookie is still >> JWH> good, >> >> the next page load logs me back in. >> >> How do the people who use sessions handle this type of scenario?? >> >> JWH> Whether your logged back in or not is dependant on your program. Once >> JWH> you are gone for over X minutes, your session file is deleted. So, S> even >> JWH> though the cookie is still good, the session will not have any data. >> JWH> What's usually done is to check for a certain session value, like >> JWH> $_SESSION['logged_in'] and if it's present, then continue, otherwise >> JWH> force the user to log back in again. >> >> JWH> ---John Holmes... >> >> Not quite that simple as the cleanup proccess may not have run and the S> data is >> still sitting there, I use msession so I am not sure if the normal session S> stuff >> will return expired data after it expires and before it is S> deletedmsession >> does so I hacked it to cleanup if expired data is requested. >> >> -- >> regards, >> Tom >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> You will have to put phpinfo(32); at the top of your page and see what the browser is sending for session info sounds like it is not sending the session cookie. Are you using apache style authentication? netscape will not send a cookie and auth info together (at least that is what I have noticed when I tried that style of authenticating and eventually abandoned it :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] How to handle "so called" expired sessions??
> Wednesday, December 4, 2002, 4:01:07 AM, you wrote: > >> Ive just been getting myself deep into using sessions. > >> Sessions are working as it should except for one condition. > >> Say I log into the site, and the session is started, and I don't do > >> anything for the next 30 mins, then go back to the site. > >> Im temporarily logged out, but because the session cookie is still > JWH> good, > >> the next page load logs me back in. > >> How do the people who use sessions handle this type of scenario?? > > JWH> Whether your logged back in or not is dependant on your program. Once > JWH> you are gone for over X minutes, your session file is deleted. So, > even > JWH> though the cookie is still good, the session will not have any data. > JWH> What's usually done is to check for a certain session value, like > JWH> $_SESSION['logged_in'] and if it's present, then continue, otherwise > JWH> force the user to log back in again. > > JWH> ---John Holmes... > > Not quite that simple as the cleanup proccess may not have run and the > data is > still sitting there, I use msession so I am not sure if the normal session > stuff > will return expired data after it expires and before it is > deletedmsession > does so I hacked it to cleanup if expired data is requested. Okay, so what's your question? The cookie and data is still there, but it's expired? How? As far as I know it's not expired until it is deleted. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] How to handle "so called" expired sessions??
> I've noticed this as well with the things I've been doing for sessions. > They way I understand it is that the server side session storing values is > supposed to expire after a certain lenght of time. I currently have this > at default so I think it should expire after 24 mins. The cleanup is done > within php itself so nothing is cleaned up until php is called again. Is > this correct? If so, I have sessions located within my /tmp directory that > are over 3 weeks old and have been there ever since they were first > created. The default way sessions are set up is that there is a one percent chance that the cleanup process will be triggered on each request. Maybe you've just never hit that 1% ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My first post
Hi, Tuesday, December 3, 2002, 7:37:20 AM, you wrote: VE> Hi. VE> I'm new in PHP. Could you point me where can i download a sample script VE> about how can i paginate some results? VE> TIA Here is a class that will create a google like pagination of results if that is what you are after :) count = $count; $this->show = $show; $this->maxpages = $max; ($this->count % $this->show == 0)? $this->pages = intval($this->count/$this->show) :$this->pages intval($this->count/$this->show) +1; if(!empty($_GET['search_page'])){ $this->page = $_GET['search_page']; $this->start = $this->show * $this->page - $this->show; } } function get_limit(){ $limit = ''; if($this->count > $this->show) $limit = 'LIMIT'.$this->start.','.$this->show; return $limit; } function make_head_string($pre){ $r = $pre.' '; $end = $this->start + $this->show; if($end > $this->count) $end = $this->count; $r .= ($this->start +1).' - '.$end.' of '.$this->count; return $r; } function make_page_string($words,$pre='Result Page:'){ $r = $pre.' '; if($this->page > 1){ $y = $this->page - 1; $r .= 'Previous '; } $end = $this->page + $this->maxpages-1; if($end > $this->pages) $end = $this->pages; $x = $this->page - $this->maxpages; $anchor = $this->pages - (2*$this->maxpages) +1; if($anchor < 1) $anchor = 1; if($x < 1) $x = 1; if($x > $anchor) $x = $anchor; while($x <= $end){ if($x == $this->page){ $r .= ''.$x.' '; } else{ $r.= ''.$x.' '; } $x++; } if($this->page < $this->pages){ $y = $this->page + 1; $r .= 'Next '; } return $r; } } //Usage mysql_connect("**.**.**.**", "**", "") or die (mysql_error()); $Query = "SELECT COUNT(*) AS cnt FROM tabletosearch WHERE fieldtosearch LIKE '%" .$searchword. "%'"; $query = mysql_query($Query) or die(mysql_error()); $row = mysql_fetch_array($result); $count = $row['cnt']; if($count > 0){ //start class total number of results,number of results to show,max number of pages on a sliding scale (ends up as 2x this number..ie 20) $page = new page_class($count,5,10); $limit = $page->get_limit(); $Query2= "SELECT * FROM tabletosearch WHERE fieldtosearch LIKE '%" .$searchword. "%' ORDER BY whatever ASC ".$limit; $result = mysql_query($Query2) or die(mysql_error()); $hstring = $page->make_head_string('Results'); $pstring = $page->make_page_string("&searchword=".$searchword."&whatever=".$whatever);//add the other variables to pass to next page in a similar fashion echo "".$hstring.""; while($row = mysql_fetch_array($result)){ echo "".$show_data_here.""; } echo "".$pstring.""; } ?> Note: the search variables on subsequent pages will be passed by GET method -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] How to handle "so called" expired sessions??
I have a similar problem only my sessions expire once you leave the site, even for a second. I'm not so experienced with cookies so how can I fix this? - Original Message - From: "Tom Rogers" <[EMAIL PROTECTED]> To: "John W. Holmes" <[EMAIL PROTECTED]> Cc: "'Gerard Samuel'" <[EMAIL PROTECTED]>; "'php-gen'" <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 9:52 PM Subject: Re[2]: [PHP] How to handle "so called" expired sessions?? > Hi, > > Wednesday, December 4, 2002, 4:01:07 AM, you wrote: > >> Ive just been getting myself deep into using sessions. > >> Sessions are working as it should except for one condition. > >> Say I log into the site, and the session is started, and I don't do > >> anything for the next 30 mins, then go back to the site. > >> Im temporarily logged out, but because the session cookie is still > JWH> good, > >> the next page load logs me back in. > >> How do the people who use sessions handle this type of scenario?? > > JWH> Whether your logged back in or not is dependant on your program. Once > JWH> you are gone for over X minutes, your session file is deleted. So, even > JWH> though the cookie is still good, the session will not have any data. > JWH> What's usually done is to check for a certain session value, like > JWH> $_SESSION['logged_in'] and if it's present, then continue, otherwise > JWH> force the user to log back in again. > > JWH> ---John Holmes... > > Not quite that simple as the cleanup proccess may not have run and the data is > still sitting there, I use msession so I am not sure if the normal session stuff > will return expired data after it expires and before it is deletedmsession > does so I hacked it to cleanup if expired data is requested. > > -- > regards, > Tom > > > -- > 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: Re[2]: [PHP] How to handle "so called" expired sessions??
I've noticed this as well with the things I've been doing for sessions. They way I understand it is that the server side session storing values is supposed to expire after a certain lenght of time. I currently have this at default so I think it should expire after 24 mins. The cleanup is done within php itself so nothing is cleaned up until php is called again. Is this correct? If so, I have sessions located within my /tmp directory that are over 3 weeks old and have been there ever since they were first created. Ed On Wed, 4 Dec 2002, Tom Rogers wrote: > Hi, > > Wednesday, December 4, 2002, 4:01:07 AM, you wrote: > >> Ive just been getting myself deep into using sessions. > >> Sessions are working as it should except for one condition. > >> Say I log into the site, and the session is started, and I don't do > >> anything for the next 30 mins, then go back to the site. > >> Im temporarily logged out, but because the session cookie is still > JWH> good, > >> the next page load logs me back in. > >> How do the people who use sessions handle this type of scenario?? > > JWH> Whether your logged back in or not is dependant on your program. Once > JWH> you are gone for over X minutes, your session file is deleted. So, even > JWH> though the cookie is still good, the session will not have any data. > JWH> What's usually done is to check for a certain session value, like > JWH> $_SESSION['logged_in'] and if it's present, then continue, otherwise > JWH> force the user to log back in again. > > JWH> ---John Holmes... > > Not quite that simple as the cleanup proccess may not have run and the data is > still sitting there, I use msession so I am not sure if the normal session stuff > will return expired data after it expires and before it is deletedmsession > does so I hacked it to cleanup if expired data is requested. > > -- > regards, > Tom > > > -- > 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[2]: [PHP] How to handle "so called" expired sessions??
Hi, Wednesday, December 4, 2002, 4:01:07 AM, you wrote: >> Ive just been getting myself deep into using sessions. >> Sessions are working as it should except for one condition. >> Say I log into the site, and the session is started, and I don't do >> anything for the next 30 mins, then go back to the site. >> Im temporarily logged out, but because the session cookie is still JWH> good, >> the next page load logs me back in. >> How do the people who use sessions handle this type of scenario?? JWH> Whether your logged back in or not is dependant on your program. Once JWH> you are gone for over X minutes, your session file is deleted. So, even JWH> though the cookie is still good, the session will not have any data. JWH> What's usually done is to check for a certain session value, like JWH> $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH> force the user to log back in again. JWH> ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the data is still sitting there, I use msession so I am not sure if the normal session stuff will return expired data after it expires and before it is deletedmsession does so I hacked it to cleanup if expired data is requested. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prevent storing data when reload
put if (!isset($blocker)) { your form goes here within your form add print " end your form } With this, your input form is on the page when the page first loads (and $blocker is not set), but disapears when the data is submitted and the page reloads. Even if the user hits the refresh button on the browser, the $blocker variable is still set and the form doesn't reapear. You can chain up a bunch of these and accomplish with one page what would have taken several. Hope this helps, Hugh - Original Message - From: "Lars Espelid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 3:17 PM Subject: [PHP] Prevent storing data when reload > Hello, > > I have a php-page whith a form-schema which stores data to a mysql-database > on submit. (The schema posts data to the same page (php-self).) > > When I reload the page the data gets stored once more. I'm sure this is a > well known problem. Are there any smart tricks to prevent this from > happening? > > Thanks! > > Lars > > > > -- > 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] Re: Show Folder Contents in Form
Nevermind, I fixed it. But now I have another problem. One, my select box has some sub-directories. How cna I filter those out? It is also showing a bunch of numbers. I included a screenshot of the select box. The following is the code: $file, "time" => filectime("/Inetpub/wwwroot/checker/modules/".$file)); } usort($files, "sortBytime"); echo ""; while (list(,$filearr) = each($files)) { echo "".$filearr["file"]."".$filearr["time"]; } echo ""; } ?> - Original Message - From: "Stephen" <[EMAIL PROTECTED]> To: "Nick Eby" <[EMAIL PROTECTED]> Cc: "PHP List" <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 8:28 PM Subject: Re: [PHP] Re: Show Folder Contents in Form > I finally got around to checking this thing out. Doesn't work... I'm getting > these errors: > > Warning: readdir(): supplied argument is not a valid Directory resource in > c:\inetpub\wwwroot\checker\admin\add_module.php on line 136 > > Warning: Wrong datatype in usort() call in > c:\inetpub\wwwroot\checker\admin\add_module.php on line 142 > > Any ideas why and how to fix it? > > > - Original Message - > From: "Nick Eby" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, December 02, 2002 4:16 PM > Subject: [PHP] Re: Show Folder Contents in Form > > > > you could first read the files and their modified-dates into an array; > sort > > the array; and finally build a select widget from the array... > > > > function sortByTime($a, $b) > > { > > if ($a["time"] == $b["time"]) return 0; > > return ($a["time"] < $b["time"]) ? -1 : 1; > > } > > > > while (false !== ($file = readdir("/some/directory/"))) > > { > > if ($file != "." && $file != "..") > > $files[] = array("file" => $file, "time" => > > filectime("/some/directory/".$file)); > > } > > > > usort($files, "sortBytime"); > > > > echo ""; > > while (list(,$filearr) = each($files)) > > echo "".$filearr["file"]." > > ".$filearr["time"]; > > > > "Stephen" <[EMAIL PROTECTED]> wrote in message > > 000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior... > > > Hello, > > > > > > Is it possible, and if so how, to get the filenames and last edited > > > time/date, then display them in a select field in a form for a user to > > > select? I'd need to show them in order of most recently edited to last > > > edited. How can this be done if it can? > > > > > > Thanks, > > > Stephen Craton > > > http://www.melchior.us > > > > > > "Life is a gift from God. Wasting it is like destroying a gift you got > > from > > > the person you love most." -- http://www.melchior.us > > > > > > > > > > > -- > > 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] Re: Show Folder Contents in Form
I finally got around to checking this thing out. Doesn't work... I'm getting these errors: Warning: readdir(): supplied argument is not a valid Directory resource in c:\inetpub\wwwroot\checker\admin\add_module.php on line 136 Warning: Wrong datatype in usort() call in c:\inetpub\wwwroot\checker\admin\add_module.php on line 142 Any ideas why and how to fix it? - Original Message - From: "Nick Eby" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 02, 2002 4:16 PM Subject: [PHP] Re: Show Folder Contents in Form > you could first read the files and their modified-dates into an array; sort > the array; and finally build a select widget from the array... > > function sortByTime($a, $b) > { > if ($a["time"] == $b["time"]) return 0; > return ($a["time"] < $b["time"]) ? -1 : 1; > } > > while (false !== ($file = readdir("/some/directory/"))) > { > if ($file != "." && $file != "..") > $files[] = array("file" => $file, "time" => > filectime("/some/directory/".$file)); > } > > usort($files, "sortBytime"); > > echo ""; > while (list(,$filearr) = each($files)) > echo "".$filearr["file"]." > ".$filearr["time"]; > > "Stephen" <[EMAIL PROTECTED]> wrote in message > 000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior... > > Hello, > > > > Is it possible, and if so how, to get the filenames and last edited > > time/date, then display them in a select field in a form for a user to > > select? I'd need to show them in order of most recently edited to last > > edited. How can this be done if it can? > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > > > "Life is a gift from God. Wasting it is like destroying a gift you got > from > > the person you love most." -- http://www.melchior.us > > > > > > -- > 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] POST data
> Can someone tell me how I can access data from a POST? I don't mean > the variables because the data I'm getting doesn't have any. I have a > client that is doing a simple HTTP Post to a server and appending xml > data right after the header. I need access to the xml blob. In php.ini, there is this setting: ; Always populate the $HTTP_RAW_POST_DATA variable. ;always_populate_raw_post_data = On It's off by default. You could turn it on and then use that variable to get all of the data, possibly. I think it would be $GLOBALS['HTTP_RAW_POST_DATA'] with register globals off? Search the PHP site for more info on it. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formating numbers & date
ok - I've been looking through this... the number_format is working great (actually I finally found that function right before I read your response), but the date format doesn't seem to allow me to pass it a date. Jeff "Kevin Stone" <[EMAIL PROTECTED]> wrote in message 01ff01c29b0b$381e2380$6601a8c0@kevin">news:01ff01c29b0b$381e2380$6601a8c0@kevin... > To change the number of decimal places look into the number_format() > function. > To change the date/time structure the date() function will do what you need. > Search for both on www.php.net > > -Kevin > > > - Original Message - > From: "Jeff Bluemel" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, December 03, 2002 1:11 PM > Subject: [PHP] formating numbers & date > > > > I'm curious how I change the number of decimal places displayed, and also > > changing the date / time structures before displaying them with an echo > > command. > > > > Jeff > > > > > > > > -- > > 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] MySQL Server
"mysql"-database contains all the system tables and users. Users are only inserted there and defined for which database they are made. As Jason suggested, look at mysql.com they have a fine manual with tutorials and long descriptions which lead to easy solutions to create users. i.e. search for the "grant"-statement. Thomas On Tue, 3 Dec 2002 16:56:40 -0700 [EMAIL PROTECTED] (Chase) wrote: > Thanks for the info... As it turns out, I am just a blithering idiot... I > didn't know that I had to create a separate user... As I said, that shows > my newbieness... > > However, this has lead me to another question... The default database, > "mysql," comes with a "users" file already... How do I create that in a new > database?? Or can I just copy the existing to a new database? > > Chase > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Tuesday 03 December 2002 23:09, Chase wrote: > > > I am the first to admit that this question belongs on a MySQL newsgroup > > > instead of here, but I can't seem to find a newsgroup that will answer > > > me... > > > > www.mysql.com > > > > > Here is a newbie question. I am running a Win2K Advanced Server with > IIS > > > 5, PHP4, and MySQLmax 3.23.53. I am by no means experienced in > setting > > > up any of these items, but my simple question is, how do I determine the > > > name of the MySQL server so I can get PHP to connect to it? > > > > If they're all on the same server use 'localhost'. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.biz > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > My father was a God-fearing man, but he never missed a copy of the > > New York Times, either. > > -- E.B. White > > */ > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date
> Hi, > > please could someone tell me how i can return a month in text from an int > ie > > getMonth(12) > How about: $Months = array( , 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); echo $Months[12]; // Dec Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cold Fusion conversion issues: app vars and cachedqueries
on 04/12/02 6:23 AM, Steve W ([EMAIL PROTECTED]) wrote: > These issues above as well as things like not being able to centrally > configure a database connection by using an alias for the name are > areas PHP lacks in comparision to Cold Fusion. Our CF application gets > installed at client sites. Using PHP, it would require a code change > in a db connect file to change the DB connection information where it > really should be configurable in a central PHP conf file. If you're installing the App on various servers, clearly there needs to be SOME form of configuration upon installation... the document root could be in a different place, the database username and password stuff could be different, permissions could be different, etc etc. Generally this is achieved with an include()'d file, which keep all your config vars in one spot. Since a heap of my sites run on shared servers, I don't like the idea of central shared configs -- well, at least not above the config settings in php.ini and at .htaccess level. Speaking of which, PHP can be configured to automatically include a certain file at the top and bottom of every script that gets run. I think the php.ini directive is auto-prepend, or something like that... Perhaps this also address' your application variables question too? > Even with this being said, I'd like to use PHP for our application if > the 2 issues above can be resolved. I'm not up-to-speed with CF, so I can't address your exact issues, but I know that there are thousands of large enterprise sites running PHP (yahoo for example), so there MUST be a way to achieve everything you need. Justin French http://Indent.com.au Web Development & Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Server
Thanks for the info... As it turns out, I am just a blithering idiot... I didn't know that I had to create a separate user... As I said, that shows my newbieness... However, this has lead me to another question... The default database, "mysql," comes with a "users" file already... How do I create that in a new database?? Or can I just copy the existing to a new database? Chase "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Tuesday 03 December 2002 23:09, Chase wrote: > > I am the first to admit that this question belongs on a MySQL newsgroup > > instead of here, but I can't seem to find a newsgroup that will answer > > me... > > www.mysql.com > > > Here is a newbie question. I am running a Win2K Advanced Server with IIS > > 5, PHP4, and MySQLmax 3.23.53. I am by no means experienced in setting > > up any of these items, but my simple question is, how do I determine the > > name of the MySQL server so I can get PHP to connect to it? > > If they're all on the same server use 'localhost'. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > My father was a God-fearing man, but he never missed a copy of the > New York Times, either. > -- E.B. White > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prevent storing data when reload
> When I reload the page the data gets stored once more. I'm sure this is a > well known problem. Are there any smart tricks to prevent this from > happening? Yes, and they get discussed on this list almost daily... a quick search would have helped. 1. the "script" that does all the validating and inserting SHOULD NOT send any output to the browser... after insert, put in a header("Location: script.php?action=thanks") style redirect. This means that if the user hits refresh, they will only be refreshing the "thanks" page, NOT the insert page, because it never gets to the browser. Yes, this can all be done in one script, it may need some re-organisation though. 2. when generating the HTML form, include a hidden field with a unique string in it. Insert this string with the rest of the form data, and make sure that this string is only inserted once... so, if they hit "refresh", you'll know that the form has already been submitted, and the data already inserted, so don't insert it again :) Cheers Justin French http://Indent.com.au Web Development & Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Prevent storing data when reload
yep have the submit got to another page and then have a header location in there to go back to the original page that the form is on > -Original Message- > From: Lars Espelid [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 4 December 2002 10:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Prevent storing data when reload > > > Hello, > > I have a php-page whith a form-schema which stores data to a > mysql-database > on submit. (The schema posts data to the same page (php-self).) > > When I reload the page the data gets stored once more. I'm sure this is a > well known problem. Are there any smart tricks to prevent this from > happening? > > Thanks! > > Lars > > > > -- > 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] Howto: run local script to update remote script
I was wondering how I could have a local PHP (4.2.3) script running on Apache 1.3.27 / WinXP Pro send my current local IP address to a remote server running PHP 4.1.2, RedHat 7.3 & Apache 1.3.26.. In the Linux based script, I'd want it to basically display my current IP address to friends who know the remote URL to connect to my FTP/HTTP server(s) and grab mp3s, etc.. I'm a complete newbie, and in my php.net/google.com searches the only thing I've come across is something called a CRON Job.. From my little experience and understanding, I've always thought a Cron Job was something that only was valid on *nix platforms and not Win32.. Am I mistaken? My remote linux server has a dedicated IP, although my Win32 machine obviously doesn't.. I assume this would make it easier to communicate from local to remote? >From my little understanding, I assume the local script would need to place my IP address in a variable (within say: ipaddy.inc) and the remote script would be updated as the variable was read from ipaddy.inc when someone visited the page..? If anyone could point me to a tutorial, function name(s) or offer some code to get me started, I'd greatly appreciate it.. Apache & PHP load on my local (Win32) machine when it boots and it's always running.. I just can't get past the auto-run-a-local-php-script area for the most part.. TIA.. Take care.. peace.. eriol -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Prevent storing data when reload
Hello, I have a php-page whith a form-schema which stores data to a mysql-database on submit. (The schema posts data to the same page (php-self).) When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Thanks! Lars -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anybody knows LWC::UserAgent (Perl) equivalent for PHP?
Haha, working on this same problem myself, right now. I used curl. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $base . $page . '?' . $query); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIE, $_SESSION['session']); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $buffer = curl_exec($ch); curl_close($ch); It's pulling in data from the $_SESSION for the cookie, but read up and you can see how to put in your own cookies. Some more info at php.net/curl it's not very friendly there though, but once you get the idea you'll go far. Some examples(not many, I might add) over at: http://curl.haxx.se/libcurl/php/examples/ Hope this helps. As far as without curl, can't really help you there. Others can I'm sure. Vincnetas Vienozinskis wrote: message the same as the subject :) i need something for PHP to work with site that requires cookies. And i hate to handle HTTP header and all those Coocies by my self :) --Joseph Guhlin http://www.bahwi.cc/ Web Developer / Unix Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "x" as a multiplier
Adam, I know this. In reaction to the subject of John's post I cleared up the fact that x can not be acting as a multiplier becuase it is not an operator. My suggestion was that there may something else in his code that is causing the confusion.. making it look like it's doing something that it's not actually doing. Does that make more sense? :-\ John, please copy and paste the output of the following experiment.. $a = 1; $b = 2; echo "$ax$b"; echo $a."x".$b; echo $a.'x'.$b; -Kevin - Original Message - From: "John Meyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 3:59 PM Subject: RE: [PHP] "x" as a multiplier > Exactly. But it's only giving me one of the numbers without the space > between the numbers and the x. > > -Original Message- > From: Adam Williams [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 03, 2002 3:48 PM > To: Kevin Stone > Cc: John Meyer; [EMAIL PROTECTED] > Subject: Re: [PHP] "x" as a multiplier > > > I don't think he's trying to multiply, I think he wants to print #x#, like > 800x600 or 1024x768, etc... > > Adam > > On Tue, 3 Dec 2002, Kevin Stone wrote: > > > Is it possible you're mistaken somehow? x isn't an operator in PHP. > > Executing $a x $b will give you a parse error. Anything in quotes is > > automatically casted as a string. > > -Kevin > > > > - Original Message - > > From: "John Meyer" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, December 03, 2002 3:20 PM > > Subject: [PHP] "x" as a multiplier > > > > > > > Code: > > > > > > $newwidth . "x" . $newheight > > > > > > > > > What I want to get out is a string, like 89x115. All I am getting > though, > > > is one number, even though if I do this > > > > > > $newwidth . " x " . $newheight > > > > > > It prints out just fine. What is going on here? > > > > > > > > > -- > > > 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] "x" as a multiplier
At 23:20 03.12.2002, John Meyer said: [snip] >Code: > >$newwidth . "x" . $newheight > > >What I want to get out is a string, like 89x115. All I am getting though, >is one number, even though if I do this > >$newwidth . " x " . $newheight > >It prints out just fine. What is going on here? [snip] Not sure what you mean here, you say you only get one number, but "it prints out fine"? However, this gives exactly what you want: Output for both cases: 1024x768 1024x768 -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace works on normal string but not with a string build from a file
Thx, I had created a workarround, withs was looping through every line of the file and doing a rtrim. But your hint pointed me to the better solution The modifier m alone didn't do the job, because I uses a dot to match any character. But without the s modifier it will not match a new line. So both modifiers gets it all to work! Thx for the tip! Kind regards Jeroen Olthof, "John W. Holmes" <[EMAIL PROTECTED]> schreef in bericht 000801c29af6$a1a28450$7c02a8c0@coconut">news:000801c29af6$a1a28450$7c02a8c0@coconut... > > take a look at the following code > > basic problem is, it works with the custom build string in the script > but > > not if get the code from a file. > > I allways used ereg_replace but after installing a newer version of > php > > (4.2.2) it became very slow, so now I'm trying preg_replace > > > > please help !!! > > kind regards Jeroen olthof, > > > > > $opentag = ''; > > $closetag = ''; > > > > // building the string in this script will give the wanted result > > $string = ''; > [snip] > > $string .= ''; > > > > // building the string from a text file won't give the wanted result; > > // uncomma the next file for testing > > // $string = implode(false,@file('./loadlooptest2.html')); > > > > echo "--result--\n\n\n"; > > echo $result = preg_replace("/.*$opentag(.*)$closetag.*/", > '\\1',$string); > > echo "\n\n\n--modified\n\n\n"; > > echo $modified_template = ereg_replace("$opentag.*$closetag", > > '{replaced}', > > $string); > > Well, that string and the file aren't exactly the same. The file has > newlines in it, the string you're creating does not. So in the string, > it's all on the same line, while it's on separate lines in the file. > > Preg_replace may be looking for that pattern on a single line. The /m > modifier may help in this circumstance, I'm not sure though. > > ---John Holmes... > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] "x" as a multiplier
Exactly. But it's only giving me one of the numbers without the space between the numbers and the x. -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:48 PM To: Kevin Stone Cc: John Meyer; [EMAIL PROTECTED] Subject: Re: [PHP] "x" as a multiplier I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: > Is it possible you're mistaken somehow? x isn't an operator in PHP. > Executing $a x $b will give you a parse error. Anything in quotes is > automatically casted as a string. > -Kevin > > - Original Message - > From: "John Meyer" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, December 03, 2002 3:20 PM > Subject: [PHP] "x" as a multiplier > > > > Code: > > > > $newwidth . "x" . $newheight > > > > > > What I want to get out is a string, like 89x115. All I am getting though, > > is one number, even though if I do this > > > > $newwidth . " x " . $newheight > > > > It prints out just fine. What is going on here? > > > > > > -- > > 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] Anybody knows LWC::UserAgent (Perl) equivalent for PHP ?
message the same as the subject :) i need something for PHP to work with site that requires cookies. And i hate to handle HTTP header and all those Coocies by my self :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST data
At 23:47 03.12.2002, Brian Duke said: [snip] >Can someone tell me how I can access data from a POST? I don't mean >the variables because the data I'm getting doesn't have any. I have a >client that is doing a simple HTTP Post to a server and appending xml >data right after the header. I need access to the xml blob. [snip] Not sure if this gives you the posted data, but you could try $_SERVER['QUERY_STRING']. Or simply print_r the $_SERVER array to check if it is available. -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST data
Can someone tell me how I can access data from a POST? I don't mean the variables because the data I'm getting doesn't have any. I have a client that is doing a simple HTTP Post to a server and appending xml data right after the header. I need access to the xml blob. Thanks, Brian - Brian (Be sure to remove the # symbol before replying to my email address) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "x" as a multiplier
I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: > Is it possible you're mistaken somehow? x isn't an operator in PHP. > Executing $a x $b will give you a parse error. Anything in quotes is > automatically casted as a string. > -Kevin > > - Original Message - > From: "John Meyer" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, December 03, 2002 3:20 PM > Subject: [PHP] "x" as a multiplier > > > > Code: > > > > $newwidth . "x" . $newheight > > > > > > What I want to get out is a string, like 89x115. All I am getting though, > > is one number, even though if I do this > > > > $newwidth . " x " . $newheight > > > > It prints out just fine. What is going on here? > > > > > > -- > > 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] Cold Fusion conversion issues: app vars and cached queries
My company is looking to move our site away from Cold Fusion due to the cost. We had talked about JSP, but I would highly prefer PHP. After evaluation, with the generic database functions now supporting Oracle in CVS, I think this might be a possibility. However, there are 2 concerns I have in converting from Cold Fusion. 1) Application variables 2) Cached queries I've seen some solutions to both problems, but mainly I want the solution to meet one and ideally both of the following qualifications. First, I don't want to have to use an add in module. I'd like to only use core PHP functions and modules that are part of the full PHP distribution and not SRM or other add-on modules. Second, I'd prefer not to have to serialize the results, save as a file, and read the file as updates would seem to become more difficult on higher load systems with having to update files. Updates to our cached queries and application variables generally only occur a few times a day. These issues above as well as things like not being able to centrally configure a database connection by using an alias for the name are areas PHP lacks in comparision to Cold Fusion. Our CF application gets installed at client sites. Using PHP, it would require a code change in a db connect file to change the DB connection information where it really should be configurable in a central PHP conf file. Even with this being said, I'd like to use PHP for our application if the 2 issues above can be resolved. Thanks in advance, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "x" as a multiplier
Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: "John Meyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 3:20 PM Subject: [PHP] "x" as a multiplier > Code: > > $newwidth . "x" . $newheight > > > What I want to get out is a string, like 89x115. All I am getting though, > is one number, even though if I do this > > $newwidth . " x " . $newheight > > It prints out just fine. What is going on here? > > > -- > 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] "x" as a multiplier
Code: $newwidth . "x" . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . " x " . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] formating numbers & date
To change the number of decimal places look into the number_format() function. To change the date/time structure the date() function will do what you need. Search for both on www.php.net -Kevin - Original Message - From: "Jeff Bluemel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 1:11 PM Subject: [PHP] formating numbers & date > I'm curious how I change the number of decimal places displayed, and also > changing the date / time structures before displaying them with an echo > command. > > Jeff > > > > -- > 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] re: ini_set() / Jason Wong / dynamically setting this?
Matt -- ...and then Matt Babineau said... % % Hi everyone: Hi! ... % % I am working on a website, and I have a shared hosting account on a % win2k machine. When I upload from my local machine to the shared hosting % machine I have to change a variable on each of my pages that gives me % the proper path to including the necessary files to execute the page % properly. If I don't I get an error. What I've done is put a bit of code in each of my scripts # this will let us figure out where we are and then always source the right include stuff! # it does not work with symlinks (__FILE__ reports the *target*) # you must have a full env tree in your devel tree; we now look exclusively in $DEVELDIR if set if ( ereg("/home/sites/\.php/",__FILE__) )# are we *somewhere* in our usual master tree? { $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; } # get the working dir and then I work from my base development tree with a include("/home/sites/.php$DEVELDIR/includestuff.inc");# include our various files require("/home/sites/.php$DEVELDIR/ImageInformation.class.php"); and away I go. I replicate my build directory anywhere under the .php dir and everything else knows where it is and thus where to find the other files in the same version. This may be helpful; good luck! HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg88211/pgp0.pgp Description: PGP signature
[PHP] formating numbers & date
I'm curious how I change the number of decimal places displayed, and also changing the date / time structures before displaying them with an echo command. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searchable archive
http://marc.theaimsgroup.com/?l=php-general is for the general list, other archive locations for other lists can be found at: http://www.php.net/mailing-lists.php Happy Searching! Mohanaraj wrote: Hello, Could anyone please point me to a searcheble archive of this mailing list. Thanks guys. Mohan --Joseph Guhlin http://www.bahwi.cc/ Web Developer / Unix Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searchable archive
At 08:58 04.12.2002, Mohanaraj spoke out and said: [snip] >Hello, > >Could anyone please point me to a searcheble archive of this mailing list. >Thanks guys. [snip] http://marc.theaimsgroup.com/?l=php-general This is listed at the PHP home page, when clicking on "mailing lists", "general/Archive(yes)". -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Searchable archive
Hello, Could anyone please point me to a searcheble archive of this mailing list. Thanks guys. Mohan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagick v0.9.0.1 RELEASED
imagick, the PHP ImageMagick module, has been moved and can be found here: http://pear.php.net/package-info.php?pacid=76 All releases will occur at this location from now on. The site: http://magick.communityconnect.com/ Will continue to point to the above PHP URL. Christian and I released version 0.9.0.1. It contains support for image lists and almost all of the image processing functions - image effects, special effects, etc. Contact either myself or Christian ([EMAIL PROTECTED]) if you have comments, suggestions or to report bugs. Thanks. -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] preg_replace works on normal string but not with a string build from a file
> take a look at the following code > basic problem is, it works with the custom build string in the script but > not if get the code from a file. > I allways used ereg_replace but after installing a newer version of php > (4.2.2) it became very slow, so now I'm trying preg_replace > > please help !!! > kind regards Jeroen olthof, > > $opentag = ''; > $closetag = ''; > > // building the string in this script will give the wanted result > $string = ''; [snip] > $string .= ''; > > // building the string from a text file won't give the wanted result; > // uncomma the next file for testing > // $string = implode(false,@file('./loadlooptest2.html')); > > echo "--result--\n\n\n"; > echo $result = preg_replace("/.*$opentag(.*)$closetag.*/", '\\1',$string); > echo "\n\n\n--modified\n\n\n"; > echo $modified_template = ereg_replace("$opentag.*$closetag", > '{replaced}', > $string); Well, that string and the file aren't exactly the same. The file has newlines in it, the string you're creating does not. So in the string, it's all on the same line, while it's on separate lines in the file. Preg_replace may be looking for that pattern on a single line. The /m modifier may help in this circumstance, I'm not sure though. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to handle "so called" expired sessions??
> Ive just been getting myself deep into using sessions. > Sessions are working as it should except for one condition. > Say I log into the site, and the session is started, and I don't do > anything for the next 30 mins, then go back to the site. > Im temporarily logged out, but because the session cookie is still good, > the next page load logs me back in. > How do the people who use sessions handle this type of scenario?? Whether your logged back in or not is dependant on your program. Once you are gone for over X minutes, your session file is deleted. So, even though the cookie is still good, the session will not have any data. What's usually done is to check for a certain session value, like $_SESSION['logged_in'] and if it's present, then continue, otherwise force the user to log back in again. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql, php, checkbox
It works, but just for the first row selected from the table. I think that the problem is that the checkboxes are declared inside a while loop. If i declare manually all checkboxes it works. Any ideas ? Or maybe I'm doing something wrong? echo ""; echo ""; /* Connecting, selecting database */ $link = mysql_connect("localhost", "root", "adrian") or die("Could not connect"); print "Connected successfully"; mysql_select_db("menagerie") or die("Could not select database"); /* Performing SQL query */ $query = "SELECT * FROM reclamatie"; $result = mysql_query($query) or die("Query failed"); /* Printing results in HTML */ echo ""; echo "IDSubjectOpenClose"; while($row = MySQL_fetch_array($result)) { echo ""; echo "{$row['id']}"; echo "{$row['subject']}"; echo "{$row['open']}"; echo "{$row['close']}"; } echo ""; /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); echo ""; ?> ### //selectare.php (just displays the id's of selected checkboxes) //$useri=$_POST['useri']; $ids=$_POST['ids']; reset($ids); while (list ($key, $value) = each ($ids)) { echo "$value\n"; } ?> # As I said, when I select the first checkbox, I get the id, but when I select any other checkbox, I get the errors PHP Notice: Undefined index: ids in selectare.php PHP Warning: Variable passed to each() is not an array or object in selectare.php - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "'Adrian Partenie'" <[EMAIL PROTECTED]>; "'php'" <[EMAIL PROTECTED]> Sent: Thursday, November 28, 2002 5:54 PM Subject: RE: [PHP] mysql, php, checkbox > > I'm displaying the content of a mysql table with autoincrement index. > I > > want to be able to select the each row from the table using the check > > boxes. In order to do that, i want to assign to each checkbox the > > name=index of selected row. > > I assign to the checkboxes the value of selected id, but I can't > > retreiveit later for further processing. My code looks like this > > > > $query = "SELECT * FROM reclamatie"; > > $result = mysql_query($query) or die("Query failed"); > > > > /* Printing results in HTML */ > > > > echo ""; > > echo > > > "IDSubjectOpenClose >" > > ; > > > > while($row = MySQL_fetch_array($result)) { > > echo " > name=\"{$row['id']}\">"; // ?? > > It looks like your naming it as a number, which won't work for PHP. You > want to name all of your checkboxes the same, with a [] on the name to > make the results an array in PHP. > > ... name="id[]" value="{$row['id']}" > > Then, you'll have $_POST['id'][x] as an array in PHP. Only the > checkboxes that were selected will be in the array, from zero to however > many were checked. The value of $_POST['id'][x] will be whatever was in > the value="..." part of the HTML checkbox... > > ---John Holmes... > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: print to file
Thank you! I feel like an idiot, kept getting it mixed up with perl. :) Bryan On Tue, 3 Dec 2002, Thomas Seifert wrote: | |$fp=fopen("filename","a"); |fputs($fp,"text to the file"); |fclose($fp); | | |Regards, | |Thomas | |On Mon, 2 Dec 2002 15:52:23 -0800 (PST) [EMAIL PROTECTED] (Bryan Koschmann - Gkt) |wrote: | |> Okay, this is probably stupid, but how do you print to a file? |> |> Thanks, |> |> Bryan |> | | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL vars in URL var?
Great thanks! Since I'm doing this from an anchor or in the browser location bar, I just replaced the & in the url var with %26. Works great! -Shawn "Adam Voigt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/function.urlencode.php Pass it through that function (or one of the others) on: http://www.php.net/manual/en/ref.url.php On Tue, 2002-12-03 at 12:01, Shawn McKenzie wrote: I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=something&x=100&y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=val&url=http://www.someothersite.com/i ndex.php?something=something&x=100&y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the & in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Connecting binary & php together
Ok, I will see what --with-embed is going to show me ;) On Tue, 03 Dec 2002 11:41:19 -0500 J Smith <[EMAIL PROTECTED]> wrote: > > Not exactly sure what you mean here. Do you mean you'd like to get a C or > C++ library to work inside PHP, or get PHP to work inside of a C or C++ > app/library? > > If it's the former, then you want to build an extension to PHP. There are > lots of examples in the ext directory. > > If it's the latter, then look at sapi/embed, which lets you cram the PHP > interpreter into any sort of application or library. It's still > experimental, but it's a step in the right direction. > > J > > > Stephan Seidt wrote: > > > Hi > > > > I'm thinking about the best way to connect a c(++) > > binary with the php interpreter. I thought the best > > solution is to use a shared library which has been > > built by php. Is libphp4.so always the same or are > > the libraries for apache / apache2 / roxen / etc > > different ? I think the parameter --with-apxs > > or whatever is just given so that php knows > > what it has to do, right ? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- I won't pay Bill's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL vars in URL var?
http://www.php.net/manual/en/function.urlencode.php Pass it through that function (or one of the others) on: http://www.php.net/manual/en/ref.url.php On Tue, 2002-12-03 at 12:01, Shawn McKenzie wrote: I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=something&x=100&y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=val&url=""> ndex.php?something=something&x=100&y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the & in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] URL vars in URL var?
I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=something&x=100&y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=val&url=http://www.someothersite.com/i ndex.php?something=something&x=100&y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the & in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My first post
Hi Victor, Welcome to the wonderful world of PHP! > I'm new in PHP. Could you point me where can i download a sample script > about how can i paginate some results? PHP essentially exists to output HTML. You cannot paginate in HTML (although there is some fancy CSS that could be employed). Sorry, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Connecting binary & php together
Not exactly sure what you mean here. Do you mean you'd like to get a C or C++ library to work inside PHP, or get PHP to work inside of a C or C++ app/library? If it's the former, then you want to build an extension to PHP. There are lots of examples in the ext directory. If it's the latter, then look at sapi/embed, which lets you cram the PHP interpreter into any sort of application or library. It's still experimental, but it's a step in the right direction. J Stephan Seidt wrote: > Hi > > I'm thinking about the best way to connect a c(++) > binary with the php interpreter. I thought the best > solution is to use a shared library which has been > built by php. Is libphp4.so always the same or are > the libraries for apache / apache2 / roxen / etc > different ? I think the parameter --with-apxs > or whatever is just given so that php knows > what it has to do, right ? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Connecting binary & php together
Hi I'm thinking about the best way to connect a c(++) binary with the php interpreter. I thought the best solution is to use a shared library which has been built by php. Is libphp4.so always the same or are the libraries for apache / apache2 / roxen / etc different ? I think the parameter --with-apxs or whatever is just given so that php knows what it has to do, right ? -- I won't pay Bill's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] There Has to be an easier way (Multidimensional Array_
An important thing to note in general, if you do: On the page your submitting to, you'll end up with: $address[0][address] $address[1][city] $address[2][state] Where as you were expecting to get: $address[0][address] $address[0][city] $address[0][state] This happens because when you use the [] operator to say to PHP "next array position", every time it hits that it increments the row, rather then understanding your trying to say "set this value on this array row", it hears "woah, I just saw a [] so I'm going to up the row". -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] There Has to be an easier way (Multidimensional Array_
Thank you That works great! At 11:56 PM 12/3/2002 +0800, Jason Wong wrote: On Tuesday 03 December 2002 23:45, Dev wrote: > Hello all > > Currently I have a web fom that has 3 field in it that I want writing to a > multidimensional array. > > > > > VALUE="" SIZE="5" MAXLENGTH="5"> > > VALUE=""> I would name them as: NAME="address[][address]" NAME="address[][state]" NAME="address[][zip]" (I'm assuming you have multiple addresses on a single form) Then loop through them by: foreach ($address as $key => $value) { echo "Address: {$value['address']} State: {$value['state']} Zip: {$value['zip']}"; } For a single address use: NAME="address[address]" NAME="address[state]" NAME="address[zip]" And no need to loop, just use the values directly. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The best portion of a good man's life, his little, nameless, unremembered acts of kindness and love. -- Wordsworth */ -- 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] Problem: Only 1 fsockopen() connection for apache at a time.
On Tuesday 03 December 2002 15:46, Roedel, Mark wrote: > > -Original Message- > > From: William Bailey [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, December 03, 2002 6:04 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Problem: Only 1 fsockopen() connection for > > apache at a time. > > > > > > I have a script that uses fsockopen() to connect to a > > remote server/port and from what i am seeing mod_php4 > > with apache only allows 1 fsockopen connection at a time > > and will que the other fsockopen calls and then process > > them when the one before it has closed. Is there a way > > round this? > > Not true here...what operating system are you running? (I know some > versions of Windows in particular have a limit as to how many > simultaneous connections the tcp/ip layer can support...) > Ah ha! Ok. I have found the issue, about a min before your email came in. It was mozilla :( I had the page loaded in two tabs and was refreshing each tab. I tried opening one in mozilla and one in ie and it did work as expected. The server made 2 calls to the other server via its fsockopen connection. > > --- > Mark Roedel | "Blessed is he who has learned to laugh > Systems Programmer| at himself, for he shall never cease > LeTourneau University | to be entertained." > Longview, Texas, USA | -- John Powell -- Regards, William Bailey. Pro-Net Internet Services Ltd. http://www.pro-net.co.uk http://wb.pro-net.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] There Has to be an easier way (Multidimensional Array_
On Tuesday 03 December 2002 23:45, Dev wrote: > Hello all > > Currently I have a web fom that has 3 field in it that I want writing to a > multidimensional array. > > > >VALUE="" SIZE="5" MAXLENGTH="5"> >VALUE=""> I would name them as: NAME="address[][address]" NAME="address[][state]" NAME="address[][zip]" (I'm assuming you have multiple addresses on a single form) Then loop through them by: foreach ($address as $key => $value) { echo "Address: {$value['address']} State: {$value['state']} Zip: {$value['zip']}"; } For a single address use: NAME="address[address]" NAME="address[state]" NAME="address[zip]" And no need to loop, just use the values directly. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The best portion of a good man's life, his little, nameless, unremembered acts of kindness and love. -- Wordsworth */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] does anybody know PHPlib's source site?
--- "Alexander A. Savenkov" <[EMAIL PROTECTED]> wrote: > Hi All. > >does anybody know PHPlib's source site? Google does __ 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] Problem: Only 1 fsockopen() connection for apache at a time.
> -Original Message- > From: William Bailey [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 03, 2002 6:04 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Problem: Only 1 fsockopen() connection for > apache at a time. > > > I have a script that uses fsockopen() to connect to a > remote server/port and from what i am seeing mod_php4 > with apache only allows 1 fsockopen connection at a time > and will que the other fsockopen calls and then process > them when the one before it has closed. Is there a way > round this? Not true here...what operating system are you running? (I know some versions of Windows in particular have a limit as to how many simultaneous connections the tcp/ip layer can support...) --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer| at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] There Has to be an easier way (Multidimensional Array_
Hello all Currently I have a web fom that has 3 field in it that I want writing to a multidimensional array. in my page that processing this I have currently: while(list($key,$value) = each($address)) { if(!is_array($value)){ echo "$value "; } else { while(list($key,$value1) = each($value)) { if(!is_array($value1)){ echo "$value1 "; } else { while(list($key,$value2) = each($value1)) { echo "$value2"; } } } } echo ""; }; To read through it... I know there has to be a simpler way that I am missing. This way will not let me sort very well from what I see either. Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] help needed with crypt()
Hi, Wednesday, December 4, 2002, 1:27:49 AM, you wrote: cyc> Hi cyc>I made some changes to this script but still it is cyc> not working Try using the whole password as the salt like this if(crypt(trim($pass),$arr[1]) == $arr[1]) Or are you still only getting -1 returned ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace works on normal string but not with a string build from a file
hi, take a look at the following code basic problem is, it works with the custom build string in the script but not if get the code from a file. I allways used ereg_replace but after installing a newer version of php (4.2.2) it became very slow, so now I'm trying preg_replace please help !!! kind regards Jeroen olthof, '; $closetag = ''; // building the string in this script will give the wanted result $string = ''; $string .= 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>'; $string .= 'http://www.w3.org/1999/xhtml";>'; $string .= ''; $string .= 'Untitled Document'; $string .= ''; $string .= ''; $string .= ''; $string .= ''; $string .= ''; $string .= ''; $string .= ' '; $string .= 'aaa'; $string .= 'aaa'; $string .= 'aaa'; $string .= 'aaa'; $string .= ' '; $string .= ''; $string .= ''; $string .= ''; $string .= ''; // building the string from a text file won't give the wanted result; // uncomma the next file for testing // $string = implode(false,@file('./loadlooptest2.html')); echo "--result--\n\n\n"; echo $result = preg_replace("/.*$opentag(.*)$closetag.*/", '\\1',$string); echo "\n\n\n--modified\n\n\n"; echo $modified_template = ereg_replace("$opentag.*$closetag", '{replaced}', $string); ?> here is the xhtml file (copy past it in a file called loadlooptest2.html) http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> Untitled Document aaa aaa aaa aaa aaa aaa aaa aaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help needed with crypt()
Hi I made some changes to this script but still it is not working > > cyc>function authenticate($user,$pass) { > cyc> $result = -1; > cyc> $data = file("shadow"); /* permission > every > cyc> one read */ > > cyc> foreach($data as $line ) { > cyc> $arr = explode(":",$line); > cyc> if($arr[0] == $user) { > cyc> /* user name matching */ $salt = substr($arr[1],0,2); > cyc> if(crypt(trim($pass),$salt) == > $arr[1]) > cyc>{ $result = 1; > cyc> break; > cyc> } > cyc> else > cyc>{ > cyc>$result = 0; > cyc> break; > cyc> } > cyc>} /* end of for */ > cyc> return $result ; > > cyc> } > > > cyc> The above programme always returs -1. > > cyc> Any help would be appreciated. > > cyc> regards > cyc> CVR > > > __ 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] MySQL Server
On Tuesday 03 December 2002 23:09, Chase wrote: > I am the first to admit that this question belongs on a MySQL newsgroup > instead of here, but I can't seem to find a newsgroup that will answer > me... www.mysql.com > Here is a newbie question. I am running a Win2K Advanced Server with IIS > 5, PHP4, and MySQLmax 3.23.53. I am by no means experienced in setting > up any of these items, but my simple question is, how do I determine the > name of the MySQL server so I can get PHP to connect to it? If they're all on the same server use 'localhost'. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* My father was a God-fearing man, but he never missed a copy of the New York Times, either. -- E.B. White */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] need advice on template engine
Hi, Smarty is trully fantastic - relatively easy to learn and use and is very powerful. I used to use the phplib template engine which was also impressive but Smarty is much more sophisticated. Some great things about Smarty:- - site pages can be cached (can save masses of time if the server is having to re-create the same database backed pages) - a well written, extensive and thorough manual (a must if you are to use Smarty to its max) - the Smarty 'presentation' code resides with the html and is consequently separated from the php code . This may be said by some to be a bad thing as the point of the such template engines is to separate the html from programming code; however I have found that in the case of phplib templates (and no doubt many other template engines) html was, by necessity, finding its way into the programming code and also the code to manage the generate the templates could become quite bulky. Smarty is practically and conceptually more elegant in that it separates 'all presentation related code' (html and smarty constructs) and logic (ie. your php), what's more, the actual lines of code that I have to write is reduced as a result. Hope that this convinces you to give Smarty a go, David Eisenhart > http://smarty.php.net seems polular > > J > > > on 04/12/02 12:40 AM, Alexander A. Savenkov ([EMAIL PROTECTED]) wrote: > > > Hi PHP. > > > > Suggest me which template engine is more popular? > > I try select engine for me but I alredy become involved in that > > number different version > > > > > > Alexander A. Savenkov > > System Administrator > > mailto:[EMAIL PROTECTED] > > JSC "Terminal GMB" > > http://www.terminalgmb.ru > > > > Justin French > > http://Indent.com.au > Web Development & > Graphic Design > > "Alexander A. Savenkov" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Justin. > > > JF> http://smarty.php.net seems polular > > It seems to me too > but i thick may be I can miss smthng important > > > > Alexander A. Savenkov > System Administrator > mailto:[EMAIL PROTECTED] > JSC "Terminal GMB" > http://www.terminalgmb.ru > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and file uploads/downloads
On Tuesday 03 December 2002 15:02, Beau Hartshorne wrote: > Hi, > > I'm working on a system that allows users to upload and then download > pdf files. Each file is related to a mySQL database entry. To keep > things simple and consistent, I'd like to store the pdf files like this > on the server: > > [PRIMARY_KEY].pdf > > But when a user downloads the file, I'd like them to receive something > like: > > [TITLE].pdf > > Is there a way to get php to rename the file when a user tries to > download it? This is all done via HTTP headers. example: header('Content-type: application/octet-stream'); header(sprintf('Content-disposition: inline; filename=%s', $fileName)); header(sprintf('Content-length: %d', $fileLength)); // Output file now. Hope this helps. > > TIA, > > Beau -- Regards, William Bailey. Pro-Net Internet Services Ltd. http://www.pro-net.co.uk http://wb.pro-net.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Server
I am the first to admit that this question belongs on a MySQL newsgroup instead of here, but I can't seem to find a newsgroup that will answer me... Here is a newbie question. I am running a Win2K Advanced Server with IIS 5, PHP4, and MySQLmax 3.23.53. I am by no means experienced in setting up any of these items, but my simple question is, how do I determine the name of the MySQL server so I can get PHP to connect to it? My PHP is installed and running great, but if I can't hook up to my database it doesn't do me any good. TIA Chase -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help needed with crypt()
Hi, Wednesday, December 4, 2002, 12:45:15 AM, you wrote: cyc> Hi cyc> The script is not working. cyc>function authenticate($user,$pass) { cyc> $result = -1; cyc> $data = file("shadow"); /* permission every cyc> one read */ cyc> foreach($date as $line ) { cyc> $arr = explode(":",$line); cyc> if($arr[0] == $user) { cyc> /* user name matching */ cyc> if(crypt(trim($pass),$salt) == $arr[1]) cyc>{ $result = 1; cyc> break; cyc> } cyc> else cyc>{ cyc>$result = 0; cyc> break; cyc> } cyc>} /* end of for */ cyc> return $result ; cyc> } cyc> The above programme always returs -1. cyc> Any help would be appreciated. cyc> regards cyc> CVR cyc> __ cyc> Do you Yahoo!? cyc> Yahoo! Mail Plus - Powerful. Affordable. Sign up now. cyc> http://mailplus.yahoo.com This line should probably be like foreach($data as $line ) { //currently date and you will have to extract $salt from the password field too -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and file uploads/downloads
Hi, I'm working on a system that allows users to upload and then download pdf files. Each file is related to a mySQL database entry. To keep things simple and consistent, I'd like to store the pdf files like this on the server: [PRIMARY_KEY].pdf But when a user downloads the file, I'd like them to receive something like: [TITLE].pdf Is there a way to get php to rename the file when a user tries to download it? TIA, Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] variable num of function args
> -Original Message- > From: christian haines [mailto:[EMAIL PROTECTED]] > Sent: 03 December 2002 13:32 > > > hi all, > > is it possible to somehow have a function which takes a > variable number > of arguments Yes -- look at the manual pages for func_num_args (http://www.php.net/func-num-args) and func_get_arg (http://www.php.net/func-get-arg). > (with some kind of key association) No. > i am sick of continually having to go back and add empty > parameters to > functions in use. Why don't you just make the extra parameters optional? As in: function test1($test, $this=NULL) { if (isset($this)): echo "\$this was passed with value $this"; else: echo "\$this was not passed"; endif; } > function test2($arr) > { > extract($arr); > print $this; > } > > test2($arr = array( > "test" => 1, > "this" => 2 > )); > // output > 2 > > is there another ... better or cleaner way? If you want "named" parameters, this is pretty much how to go about it -- except that the function call doesn't need the "$arr =", so could be written more cleanly as: test2( array('test'=>1, 'this'=>2) ); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache on w2k
Hi Chris. CE> Anyone having/had stability and performance problems running Apache 1.3 on CE> Windows 2000 Server? You are goint to use apache under win2000 server as regular internet server or use this just for testing something? It's not recomended use apache under win2000 server as public internet server Alexander A. Savenkov System Administrator mailto:[EMAIL PROTECTED] JSC "Terminal GMB" http://www.terminalgmb.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] My first post
Hi. I'm new in PHP. Could you point me where can i download a sample script about how can i paginate some results? TIA -- == Victor J. Espina S. Gerente de Desarrollo / Software Development Manager Software de Venezuela, S.A. Caracas, Venezuela Email: [EMAIL PROTECTED] Personal site: http://victorespina.coolfreepages.com MSN: [EMAIL PROTECTED] == (Elimine 'nospam' en las direcciones email) (Remove 'nospam' in email and MSN address) == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail with CC and BCC
Hello, On 12/03/2002 10:09 AM, Alain Romero wrote: PHP server = Win 2000 SP2/php 4.1.2 SMTP server = Netscape Messenger 4.15 (declare on php.ini) Why CC and BCC never receive mail ? The mail() function has its set of flaws, especially under Windows. The header 'TO' is correct : see CC and BCC ! The header : "From : . CC: [EMAIL PROTECTED] BCC: [EMAIL PROTECTED]" I try severals classes I have found (PHP Classes), no good result ! You can use this class function $email_message->SetHeader("Cc:" or "Bcc:", "[EMAIL PROTECTED], [EMAIL PROTECTED]"); http://www.phpclasses.org/mimemessage If the mail() function is really not working, you may need to use also the smtp_message sub-class along with this other class for sending: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache on w2k
Anyone having/had stability and performance problems running Apache 1.3 on Windows 2000 Server? -- Chris Edwards Web Application Developer Outer Banks Internet, Inc. 252-441-6698 [EMAIL PROTECTED] http://www.OuterBanksInternet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help needed with crypt()
Hi The script is not working. function authenticate($user,$pass) { $result = -1; $data = file("shadow"); /* permission every one read */ foreach($date as $line ) { $arr = explode(":",$line); if($arr[0] == $user) { /* user name matching */ if(crypt(trim($pass),$salt) == $arr[1]) { $result = 1; break; } else { $result = 0; break; } } /* end of for */ return $result ; } The above programme always returs -1. Any help would be appreciated. regards CVR __ 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] Date problem
At 19:32 03/12/2002 +0800, Jason Wong wrote: Assuming the column holding the the birthday is called 'birthday': [snip] Many thanks! > * give me actors whose birthdays fall between two dates (ie: Aries) This one is easy, use the BETWEEN clause in your SELECT statement. Consult manual for details. Ignoring the year, obviously, to get my Aries. :-) James. -- -- [EMAIL PROTECTED] - http://www.affection.net/~jamesc/ - [+33] 6 79 02 08 99 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php