[PHP] Is there any alternative to FuseBox?
I was reading FuseBox's beginners' guide but I didn't completely understood the way that framework works. How do you process the data obtained from forms? Is it the same script that displays the form? -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there any alternative to FuseBox?
[EMAIL PROTECTED] (Jason Wong) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: Hi, sorry that I didn't make it clear. I'm looking for an alternative to php-fusebox. So I was asking how do you process the data from forms and so. > On Saturday 14 December 2002 12:25, Javier wrote: >> I was reading FuseBox's beginners' guide but I didn't completely >> understood the way that framework works. >> >> How do you process the data obtained from forms? Is it the same >> script that displays the form? > > Doesn't fusebox have it's own mailing list where you can ask > questions? If so wouldn't that be a better place to do so? > > In answer to the question in your subject: > > http://marc.theaimsgroup.com/?l=php-general&m=103964196113392&w=2 > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Querying two tables
[EMAIL PROTECTED] (Cesar Aracena) wrote in news:005801c2a3c6$8ac4f190 $4200a8c0@NOTEBOOK: And the subcategories are related to categories with the Relationships table? If that's the case: SELECT * FROM Relationships WHERE CatId = '1' And if you want the names. SELECT * FROM Subcategories as sc, Relationships as r WHERE r.CatId = 'minumber' and r.SubCatId = sc.subcatid > Hi all, > > I have several tables from which I have to fetch certain products & > categories based on customer selection. The tables are as follows: > > Table 1 - Categories > catid (autonum) > catname > > Table 2 - Sub categories > subcatid (autonum) > subcatname > > Table 3 - Products > prodid (autonum) > prodname > > Table 4 - Relationships > Catid > Subcatid > Prodid > > Now, the question is how to fetch all the sub-categories let's say that > are related to category 0001. I know it's as simple as relating two > tables in one query, but I don't remember how. Any help appreciated. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: select * From ????
[EMAIL PROTECTED] (Bruce Levick) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: If you want to access the data in an array try $row['field'] > I am connecting to mysql and all works well there. I query a table > "Illustrations" ($query = "SELECT * FROM Illustrations";), and want to > print the values of two columns ("titletext" & "img")within each row > as the request loops. > > Print "$row[titletext]"; > Print "$row[img]"; > I am sorry if this is hard to understand and also a silly Q, I am two > days into learning this stuff. All I want to do is to return these two > values from within the table. "titletext" and "img". They are both > text fields. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Insert Record (php.ini)
There are single quotes missing before %s -> '%s' > $insertSQL = sprintf("INSERT INTO stories (firstName, lastName, > address1, > address2, city, `state`, country, postCode, telephone, email, title, > story) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", >GetSQLValueString($HTTP_POST_VARS['firstName'], -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UltraTemplate's documentation
Hi! Has anybody got documentation for UltraTemplate? I read the examples on their website but I didn't understand it very well. Any doc. would be apreciated. :) -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php app frameworks?
The only one I know is FuseBox www.fusebox.org. [EMAIL PROTECTED] (Jeff D. Hamann) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: > What application frameworks are avail for php? > > Jeff. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php app frameworks?
[EMAIL PROTECTED] (Jason Sheets) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: Have you got any documentation of it to share? > If you go to www.hotscripts.com they have several PHP application > frameworks listed. > > I've investigated PHPLIB, and horde (http://www.horde.org) but wound > up creating my own framework because I have not yet found a well > documented framework that does what I need it to do. > > Jason > > On Fri, 2002-12-27 at 13:51, Jeff D. Hamann wrote: >> What application frameworks are avail for php? >> >> Jeff. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to store a file into MSSQL?
Hi everybody, I've trying to store a into a MSSQL Server (7 or 2k) using an example I found on the web (www.php.net). Is it possible that PHP (4.3.2) just store 4k of data? Because after inserting a test image with: $oDatos is an object that handles queries. // storing a file $datastring = join('',file("logo2.jpg")); $data = unpack("H*hex", $datastring); $oDatos->query( "insert into temp_test (test) values ( 0x" . $data['hex'] .")" ); A select will return a 4K file. Is it possible? $row = $oDatos->getData("select test from temp_test"); //file://$row = mssql_fetch_assoc($result); $fp = fopen('copy.jpg','w'); So... is there anyway to store a file that it is larger than 4K? Or am I missing something? :) Thanks. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to store a file into MSSQL?
[EMAIL PROTECTED] (Baroiller Pierre-Emmanuel) wrote in news:[EMAIL PROTECTED]: The field test is defined in SQL Server as "image". > How is defined your temp_test table ? > PHP don't truncate content... > you only need to define a binary blob field and store data into it.. > > regard, > P.E. Baroiller -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to store a file into MSSQL?
[EMAIL PROTECTED] (John Manko) wrote in news:[EMAIL PROTECTED]: Does it apply also to MSSQL = Microsoft SQL Server? > Look here > http://www.mysql.com/doc/en/BLOB.html > > Actually, if you don't care if the images can be view from outside the > DB, you can do what I do. > I simplely put the name of the file in a varchar field, then let the > browser do the work for you. > This is good for files that are referenced from multiple entries (ie, > individual products each referencing the same series image) > but, blob can work fine. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail()
Hi, I need to send a reminder to all the users in my website. To minimize bandwidth I would like to send just an email to a domain and then all the remaining users in the BCC. What would be the $to field in mail() since I send all the destinations in $headers? Thanks. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php weirdness
Hi, I'm running PHP 4.3.2 (cgi-fcgi) (win32). Everytime I run a script from the command line: php -q myscript.php The processor jumps to 100%, on the task manager I see that SERVICES in consuming 50% and PHP.exe the rest. I don't know why this happens, the script connects to a sql server I does a query. I think if it were a sql problem the SQLSERVER would be using the processor not php not services. Any ideas? Thanks. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail()
[EMAIL PROTECTED] (Joshua Groboski) wrote in news:[EMAIL PROTECTED]: but I will get a relaying is denied because the target domain isn't the same domain I am connected to for eg. yahoo.com > Why don't you send it to [EMAIL PROTECTED] I think as long as > the $to address doesn't fail, you'll be alright. > > Josh > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail()
[EMAIL PROTECTED] (Chris Shiflett) wrote in news:[EMAIL PROTECTED]: For eg: If I've got 20 users that have a yahoo email. I just want to connect one time to send all the 20 messages not a connection for every email. > --- Javier <[EMAIL PROTECTED]> wrote: >> I would like to send just an email to a domain and then all the >> remaining users in the BCC. > > I'm not sure if that was a typo or not, but just in case, you want to > send email to an email address, not a domain. > >> What would be the $to field in mail() since I send all the >> destinations in $headers? -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail()
[EMAIL PROTECTED] (James Rodenkirch) wrote in news:[EMAIL PROTECTED] net.com: And what about the To? Is it possible to send an email without the To? > in the headers section of the mail() function have a line of text like > this - you would obviously need to build the list of email address. > > $headers = "Bcc: [EMAIL PROTECTED],[EMAIL PROTECTED] .\n" > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail()
[EMAIL PROTECTED] (Curt Zirzow) wrote in news:20030722165644.GK67309 @bagend.shire: Ehh you're right, I'll let the mail server to handle that problem. :) > Why are you connection to yahoo to send this mail? sendmail should > handle who to connect to. > > > > Curt -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail()
[EMAIL PROTECTED] (Chris Hayes) wrote in news:[EMAIL PROTECTED]: > Is your script on a yahoo.com PHP-enabled website? > > If not: most servers deny access to the mailer because mailers (often > SMTP servers) with public access have been widely abused in the past, > especially by spammers. If this is the case you need to set PHP up to > use a SMTP server that is available from where your script is. > If you don't know how: what sort of server is your PHP script on? It would be on website and using the hosting's mail server I think. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mssql error after upgrading to 4.3.2
Hi, yesterday I upgraded to php 4.3.2 from 4.3.1 with the freebsd ports. There were any problems on the process, but many of the pages I had running with mssql, now doesn't work. These are the errors I get: Warning: mssql_num_rows(): supplied argument is not a valid Sybase result resource in xxx.php Warning: mssql_free_result(): supplied argument is not a valid Sybase result resource in xxx.php Javier. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error in php after uprading
Hi, I've upgraded to the latest version of php last week. Suddenly parts of code that was working now displays error. The errors I've found until now are related to Sybase (I use MSSQL 2k as DB server) Here is an example: Warning: mssql_num_rows(): supplied argument is not a valid Sybase result resource in /usr/local/www/local-www/ppp.php on line 349 Warning: mssql_free_result(): supplied argument is not a valid Sybase result resource in /usr/local/www/local-www/ppp.php on line 352 I didn't find any changes related to those functions in CHANGES. Any ideas? Thanks! -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error in php after uprading
[EMAIL PROTECTED] (John W. Holmes) wrote in news:[EMAIL PROTECTED]: > > Your query failed. Add some error reporting around mssql_query() to > find out why. > Thanks I'll check that. -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error in php after uprading
[EMAIL PROTECTED] (John W. Holmes) wrote in news:[EMAIL PROTECTED]: >> > > Your query failed. Add some error reporting around mssql_query() to > find out why. > Hi, I recompiled an older version of php with freetds 0.60 instead of 0.61 and everything start to work again. Maybe there is something different in the way the new version of freetds does things. :) Bye! -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with phpPgAdmin
Hi, I've just installed phpPgAdmin. When it comes to configuration it seems that everything is ok *but* the program doesn't work. I read some files and I found this: if (file_exists("config.inc.php")) { include("config.inc.php"); } else { echo "Configuration Error: You must rename/copy config.inc.php-dist to config.inc.php and set your appropriate settings"; exit; } The file exists but I don't know why the function file_exists returns false. I also tried with another file in another dir. like index.php and I got the same result. -- *** javier - public key: (http://leeloo.mine.nu/jcyber.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating local vars from HTTP Post Array
I'm re-coding a fairly large multi step form which was written with PHP's register globals turned on. Since upgrading PHP this form has stopped working and needs editting. Rather than manually changing each var - $foo to$_POST['foo'] (there are simply too many) i'd like to do something like this - while(list($key, $val) = each($_POST)) eval("\$.$key = stripslashes($value)"); using a loop to create local variables for each variable in the HTTP Post array. I'm having trouble getting this to work. Anyone help? Cheers, Javier _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wich Database abstration layer?
Can anybody recomend me a "nice" DB abstraction layer that is not included in phplib? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which Database abstration layer?
Can anybody recomend me a "nice" DB abstraction layer that is not included in phplib? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session Registering
I think you have to populate the data in your pages not to wait the browser to do the job. Cause sometimes work and some time not. Craig Donnelly wrote: > Im using session in my form, there are 6 pages to the form, It all works > fine, until You work your way back through the form, to ammend the filled in > details. > > e.g - If I go to page 1, and fill out my name, and post to the next page, > heres the code Im using: > > > > PHP: > > > > > > > > > > Its registered on the top of page2 with the following code: > > > PHP: > > session_start(); > $_SESSION['firstname']=$_POST['firstname']; > > > > > > That works fine, I have a link on all my pages that links back to the > previous page e.g Go Back > > If I go back to the first page, from the second page the fields are > populated fine, but If i continue onto page3.php then go back page1.php is > no longer populated!! > > Any Ideas why this is happening?? and If so a remedy, Is it a code issue or > a conf Issue?? > > Thanks > C > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: getting session data
To access session variables you need to use session_start() first. Deval Parikh wrote: > hi, > IF I am using this code in one script... > > a.php > - > > $userip = $REMOTE_ADDR; > session_name("sessiontest"); > session_register("userip"); > > ?> > > so how can i use above session data in another > script...like this way..??? > > b.php > - > session_start(); > echo $userip; > ?> > > I can not got the result..please correct me. > > > __ > Do You Yahoo!? > Yahoo! Games - play chess, backgammon, pool and more > http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_register() twice?
What happens if I call session_start() twice? Does it creates another session? Cause something odd is going on with this simple script. if(!SesionActiva()){ -It checkes wether there an active session SesionCrear(); - It creates the session } /*SesionActivar();*/ echo "" . session_id().""; MostrarPaginaPrincipal(); --Showing the main page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_register() twice?
I've got the index.php page that checks if there's a session created. If it is not, it creates a new one. I print the session_id; Then I go through a link to a login.php page there I print the session_id and its a different one. What could be the problem? Sascha Schumann wrote: > On Fri, 26 Apr 2002, Javier wrote: > > >>What happens if I call session_start() twice? >>Does it creates another session? > > > It does nothing. > > if (PS(session_status) != php_session_none) > return; > > - Sascha Experience IRCG > http://schumann.cx/http://schumann.cx/ircg > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] avoiding creation of multiple sessions
How can I do to avoid creating a session when reload/refresh button is clicked? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] avoiding creation of multiple sessions
How can I do to avoid creating a session when reload/refresh button is clicked? every time reload button is clicked a new file in /tmp is created. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions and reload/refresh
Is it possible that everytime un click the refresh button a new session is created? Here's my index.php Every time refresh this page a new session is created. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: lookin for a Menuing System...
There are many Javascript menu editors. I think that's what you need. Dan wrote: > I could do this myself but I don't want to waist time writing something that > I could have just asked for.. > > what I need is a menuing system.. > > When link is clicked the sub-topics appear under the topic you just clicked > on.. > > e.g. if you where to click on Contact. > > Contact > --becomes: > > Contact >Enquires >Account / Billing >Media Enquiries > > Much like this JavaScript one... except I need it in PHP... > http://www.dynamicdrive.com/dynamicindex1/navigate1.htm > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question for you guys on best tools for a job
Why don't you use javascript to refresh the page from time to time. Michael Champagne wrote: > I'm not even sure this is possible without doing a client side java applet of > some sort. > > We are considering porting a standard client/server application to the web > which updates itself dynamically in real time based on values in a database. > > For instance, a field on the screen will change in real time between > 'Pending', 'Working', 'Cancelled', etc. etc. based on a flag in the database. > What would be the best tools for the job for an application of this sort? > I've used PHP extensively and don't really see how it could be used in this > case. Any ideas? > > Thanks in advance for any responses. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Emails sent out twice
What php are you using? Jean-Louis Letortorec wrote: > Hello all: > > I have a script that looks like: > > > ... > $name="Project #1"; > ... > $title="NEW PROJECT: ".$name; > $a=mail("[EMAIL PROTECTED], [EMAIL PROTECTED]",$title,$body, "From:[EMAIL PROTECTED]"); > ... > > > > When I execute this code (there is no loop anywhere), ALL the recipients > receive 2 emails: > - the first one with the subject "NEW PROJECT:" > - the second with the subject "NEW PROJECT: Project #1" > > I cannot figure out why the first one is sent, and why with a partial > subject. > > Any idea? > > > Thanks. > > Jean-Louis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP is making errors for no apparents reason..?
How have you declared name? > $zquery = "SELECT name from users WHERE handle like '$row[handle]'; > $zres = mysql_query($zquery); > $zrow = mysql_fetch_array($zres); > $user = $zrow[name]; > $query = "INSERT into husers values (\'$row[handle]\' , \'$user\')"; > mysql_query($query); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Very Large MySQL Query String
Hi, I think if you encode the file with base64 and store it in the database the size of the document will be more than 1MB sure. David Bouw wrote: > Dear Kirk (and Julio) > > Thanks for the response.. > > I don't want to use a link to the images because backing up my data and > porting it to another machine is much easier. (Replicating is also very > easy.) When storing the file separately this gets more complex, especially > when you want to get this data from another machine... > > The stored data isn't retrieved very often, so speed isn't really an issue. > (Till now speed really never was an isse. When adding the right indexes > MySql + PHP does incredible things!!.) > > I do though use the suggested 'linking' method for an website where the > images are needed on the website.. In the current situation though I store > PDF images of invoices which are basically only needed to look something up > if there is a problem... > > Kirk, I already tried changing the properties of the column in which I > store the images.. (Currently it is an longtext, but before this I always > used an Longblob...) > > I can't remember the exact sizes of MySQL, but I believe that an Mediumblob > can handle 16 Megabyte.. (I know have little more than a 1 MB..) > > I will try some things tomorrow, but I can't find out what the problem is.. > (Column size, PHP-Mysql string length limitation or maybe something I am > overlooking..) > > I can though echo the query to screen and see that the uploaded file is > encoded to a very nice (large) text-string.. > > Any other suggestions are greatly appreciated. > > With kind regards, > David Bouw > > > > > >>If I use the link to the file, i.e. >> >> file//C:\filedir\file.pdf or .txt or whatever >> >>how do I insert/update/delete the file since MySQL is holding only the >>link? >> >>BTW David, what are the properties of the field you are inserting to? >>Could that be the problem? >> >>-Kirk >> >>"Julio Nobrega Trabalhando" <[EMAIL PROTECTED]> wrote in message >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> >>> Instead of uploading to Mysql, why don't you store the file at a >> >>directory >> >>>and on Mysql only the path to it? >>> >>> Retrieving files from the hard drive is much faster than doing the >>> same >> >>on >> >>>Mysql, and also access to manipulation (insert, update, delete, >>>etc...) >>> >>>-- >>> >>>Julio Nobrega. >>> >>>Um dia eu chego lá: >>>http://sourceforge.net/projects/toca >>> >>>Ajudei? Salvei? Que tal um presentinho? >>>http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 >>> >>> >>>"David Bouw" <[EMAIL PROTECTED]> wrote in message >>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >>> I can't seem to figure out the following. I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table.. Normally these files are small (<250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works >>> >>great!!!) >> When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text).. This is the source code.. if (!($userfile_size == 0)) {$fd = fopen ($userfile, "r"); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo "Eerste RAW: ".strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace(" ", "", "$userfile_name"); echo strlen($encodes_data)." - Displays text size "; //Works >>> >>>right! >>> mysql ($databasename_boekhoud, "insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')"); >>> >>>// >>> mysql_error(); //No error given..? } Any suggestions are very much appreciated... With kind regards, David Bouw >>> >>> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Apache is not rendering php pages. Config problem?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What version of php and apache do you use? Andy wrote: | leider funktioniert das nicht. nach ausfuehren von configtest bekomme ich | dann: | | Syntax error on line 953 of /usr/local/apache/conf/httpd.conf: | Cannot load /usr/local/apache/libexec/libphp4.so into server: | /usr/local/apache/libexec/libphp4.so: cannot open shared object file: No | such file or directory | | die datei libphp4.so befindet sich auch definitiv nicht auf der maschine. | Hab ich da was bei der compillierung falsch gemacht? | | Gruss Andy | | | "Sven Herrmann" <[EMAIL PROTECTED]> schrieb im Newsbeitrag | [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... | |>>There is no phpmodule in there, so I cant activate it. I did include |> |>some |> |>>lines from my old config: |>> |>>AddType application/x-httpd-php .php4 .php3 .php |>>AddType application/x-httpd-php-source .phps |>> |> |>if you're using Apache 1.x you need to add: |>LoadModule php4_modulelibexec/libphp4.so |> |>or if you're using Apache 2.x |>LoadModule php4_modulemodules/libphp4.so |> |> |>Sven |> |> | | | -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjzcTU4ACgkQNcG5oyVditsjtwCdH5LLJ+mPJz27xiuZXDrESbeR gf4An3f37WvVJMcXuNPQmUIYyoHDbh/1 =MLof -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mcrypt: Blowfish or Twofish or no fish?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What about MD5? Jimmy Lantz wrote: | Hi, | started playing with Mcrypt and just wanted to ask which encryption | method makes the stronger encryption? | (I can supply the necesary keylength). | Should I go for MCRYPT_BLOWFISH or MCRYPT_TWOFISH? Or no fish at all :) | | So what do I need it for? I'm going to use it encrypting files, sizes | varies between some 100 k's and 4-5 mb's. | / Jim | | Paranoia + A system w/o users = Safe system :) -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjzqsWUACgkQNcG5oyVditt1ZgCdHrRHjk/Pvb8xfJFZyXBa2/SR rGUAn3+5uV6YdDDWGmtz4ZxEYlYJV/57 =c0Rt -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mcrypt: Blowfish or Twofish or no fish?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I missed the part that talked about encrypting files. I thought it was just for a password. Sorry. Thalis A. Kalfigopoulos wrote: | On Tue, 21 May 2002, Ray Hunter wrote: | | |>MD5 is not that secure compared to blowfish or twofish or the other |>types of encryption available with mcrypt... |> |>Thanks, |> |>Ray Hunter | | | How does MD5 relate to encrypting the file? It's just used as a hash function. | | --thalis | | |> |> |>-----Original Message- |>From: Javier [mailto:[EMAIL PROTECTED]] |>Sent: Tuesday, May 21, 2002 2:43 PM |>To: [EMAIL PROTECTED] |>Subject: [PHP] Re: Mcrypt: Blowfish or Twofish or no fish? |> |> |>-BEGIN PGP SIGNED MESSAGE- |>Hash: SHA1 |> |>What about MD5? |> |>Jimmy Lantz wrote: |>| Hi, |>| started playing with Mcrypt and just wanted to ask which encryption |>| method makes the stronger encryption? (I can supply the necesary |>| keylength). Should I go for MCRYPT_BLOWFISH or MCRYPT_TWOFISH? Or no |>| fish at all :) |>| |>| So what do I need it for? I'm going to use it encrypting files, sizes |>| varies between some 100 k's and 4-5 mb's. / Jim |>| |>| Paranoia + A system w/o users = Safe system :) |> |> |>-BEGIN PGP SIGNATURE- |>Version: GnuPG v1.0.6 (MingW32) |>Comment: For info see http://www.gnupg.org |> |>iEYEARECAAYFAjzqsWUACgkQNcG5oyVditt1ZgCdHrRHjk/Pvb8xfJFZyXBa2/SR |>rGUAn3+5uV6YdDDWGmtz4ZxEYlYJV/57 |>=c0Rt |>-END PGP SIGNATURE- |> |> |>-- |>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 |> | | -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjzqtBcACgkQNcG5oyVdittlCACfc0q91tND2IRnQMmbQv68KZMu WbcAoJ3F0qiB8txUzKTHmG/l0z7A7vTP =Gjh3 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] User validation and Session management
Hi, I'm new to the newsgroup. I would like to know how can I do with php to keep user track and let him or not access to specified pages. I thought about validating (u/p) first and then giving a session variable. And then on each script I would check sessionID with a permissions table. Is there any tutorial that talk about above? Thanks. Bye! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Another Session Question
Have you got the url? John Fishworld wrote: > I've seen various tutorials on sessions where they specify the session id > instead of just using one > generated by php ! > > Why ? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] templates with php
Has anybody uses other engine besides Smart or php-templates (@freebsd ports) I trying to get into the subject but I don't know which to start with. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting data from a field
To do that is it necesary to loop the $result variable and assign each array($name => $value) ? > Alternately, you can load all of the unsorted results into an associative > array, and use PHP's native sorting functions (such as ksort() ) to sort the > results. > > > Darren Gamble > Planner, Regional Services > Shaw Cablesystems GP > 630 - 3rd Avenue SW > Calgary, Alberta, Canada > T2P 4L4 > (403) 781-4948 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] require or include ?
When should I use require or include? I read that include copies the content from the file to the script that is calling it. And require is like #include in C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require or include ?
If I include for ex. common.php in a script and this script also calls common.php what should I use require or include? On Thu, Mar 28, 2002 at 04:44:04PM -0600, Rick Emery wrote: > require() is used when you want the file included regardless of whether any > information is used from it. include() may be conditional. > > -Original Message----- > From: javier [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 28, 2002 4:44 PM > To: [EMAIL PROTECTED] > Subject: [PHP] require or include ? > > > When should I use require or include? > I read that include copies the content from the file to the script that > is calling it. > And require is like #include in C. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with e-mail...
Have you got access to your host machine? You can send messages to your local user a then see if they reach destination. Chuck "Pup" Payne wrote: > I have just install a program called Web Calendar. It suppose to be able to > send reminders via e-mail but I am not sure if PHP is set up to send e-mail > or what is happening. I have turned on debugging and it is showing that > there are remembers but it not sending anything. > > Is there a simple test I can to to test php is talking to sendmail? > > > Thanks, > > > - > | Chuck Payne | > | Magi Design and Support | > | www.magidesign.com| > | [EMAIL PROTECTED]| > - > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php+myslq+IDE
Is there any free app. for php coding? I tried komodo but I can't get it to work in debug mode. Also tried Zend's Studio but it expires. :( Is there any free choice? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php+java on freebsd
Ivan Voras wrote: > Can anyone tell me how to get java support for php working? I compiled > apache with -pthread option, I properly configured php.ini > (phpinfo() agrees), but I cannot overcome this: > > (the message appears as a PHP error when trying to create any java objects) > > Fatal error: Unable to load Java Library > /usr/local/jdk1.1.8/lib/i386/green_threads/libjava.so, error: > /usr/local/jdk1.1.8/lib/i386/green_threads/libjava.so: Undefined symbol > "fmod" in /usr/home/ivoras/public_html/jver.php on line 4 Maybe you're trying to create some objects that are not supported in that version of java. There's a native version of java for FreeBSD. You can get it from the ports /usr/ports/java > > apparently, libjava.so links to a symbol 'fmod', which is in libm.so, but > libjava.so is > not linked to use libm.so. (?) (all jdk1.1.8 binaries are actually using > compat3x libraries) > > (I have no preference for a JDK, I just need the stuff working.) > > -- > -- > Ashes to ashes, DOS to DOS > ivoras @ fer.hr > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+myslq+IDE
Please send it to me. Since php coder became maguma I think they shut down the former site. Eric Coleman wrote: > Try PHP Coder (not Maguma's Version, becuase PHP Coder kicks it's ass) > > I can email you the installed, as there site seems to be down now.. > > Eric > > - Original Message - > From: "javier" <[EMAIL PROTECTED]> > To: <> > Sent: Wednesday, April 03, 2002 4:40 PM > Subject: [PHP] php+myslq+IDE > > > >>Is there any free app. for php coding? I tried komodo but I can't get it >>to work in debug mode. Also tried Zend's Studio but it expires. :( >>Is there any free choice? >> >> >>-- >>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] references a functions
I trying to code a kind of DB wrapper. So when is dbQuery turn I run into trouble. I read in php manual that refrences are not like C pointers. They just point to the same content. I want to return the result from a mysql_query but if I do something like this: function bdConsultar($strCon) { $idRes = @mysql_query($strCon); return $idRes; } Should be called like this? $myID = &bdConsultar("Select * from users"); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] references a functions
I thought that apart from returning an id the result set was created within the scope of the function so when the function finishes the resulted was deleted; But since is just an id an the result is stored somewhere else I wouldn't need any reference. btw where can I read about references besides php manual? Rasmus Lerdorf wrote: > Note that you rarely change a result set, so there is very little point in > returning a reference to it given PHP's shallow copy implementation. And > in your case you are just returning a resource id which you definitely > aren't going to change. > > But if for some reason you feel it is important (please explain why) then > this is the syntax: > > function & bdConsultar($strCon) { > $idRes = @mysql_query($strCon); > return $idRes; > } > > $myID = & bdConsultar("Select * from users"); > > But again, I don't think you are quite understanding references. > > -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] references a functions
Opossed to my thoughts worked fine. Rick Emery wrote: > What happened when you tried? > > -Original Message- > From: javier [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 1:01 PM > To: [EMAIL PROTECTED] > Subject: [PHP] references a functions > > > I trying to code a kind of DB wrapper. > So when is dbQuery turn I run into trouble. > I read in php manual that refrences are not like C pointers. They just > point to the same content. > > I want to return the result from a mysql_query > but if I do something like this: > > function bdConsultar($strCon) { > $idRes = @mysql_query($strCon); > return $idRes; > } > > Should be called like this? > > $myID = &bdConsultar("Select * from users"); > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mod_php4
Will be any changes to mod_php4 since the release of apache 2.0.35? I wanted to compile it (freebsd ports) with a apache 2.0.33 and I had problems while compiling. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] templates and listbox
Does templates (eg php-templates or Smarty) fill automatically listboxes? Or do I need to code it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] templates and listbox
Does templates (eg php-templates or Smarty) fill automatically listboxes? Or do I need to code it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] templates and listbox
But does it use templates? I want to use templates not functions that generates html. Analysis & Solutions wrote: > On Wed, Apr 10, 2002 at 06:32:18PM -0300, Javier wrote: > >>Does templates (eg php-templates or Smarty) fill automatically listboxes? >>Or do I need to code it? > > > If your list boxes are coming from data in a MySQL or ODBC database, > check out my SQL Solution: http://www.sqlsolution.info/. One of the > things it does is generate form elements (ie text, checkbox, radio and > option lists) automatically from your query results. > > --Dan > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache htpasswd
Hi I ve a little script to validate a user using an Apache htpasswd file. I want to know how could/should I generate a crypted hash (with crypt or md5) with the entered password to match the password in the htpasswd file. I know how to use md5 or crypt functions but passing them entered password as a parameter, returned result dont match with the one in htpasswd file. Thanks in advance J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Apache htpasswd
On 05/07/2005 at 14:04 sylikc wrote: > > >For MD5 passwords though, it's a little different and not documented >as thoroughly... > >1) First check your constant CRYPT_MD5... if you don't have it in your >PHP, this won't work... >if (CRYPT_MD5 == 1) { echo 'PHP supports MD5-crypt'; } > >2) Assuming it works out, do steps #2,#3,#4 above, so you now have >your $username, $password, $crypthash >(for ex: $crypthash='$apr1$jZ1.$1Md.1a88zkKIPCY0b42Cw/') > >3) Extract crypt salt from the $crypthash >$cryptsalt = '$'.substr($crypthash,4,11); > >4) Verify the password: >if (crypt($password, $cryptsalt) == $crypthash) { echo 'GOOD!'; } > >In step #4 you'll have to see the output from your crypt() function >that supports MD5. I don't have my built with it just yet and can't >verify this, but use the steps as a guide to building your >implementation. > >Post some code if you're still having trouble, Hi Thanks for your help. I checked my PHP support CRYPT_MD5, then I did the following: I've generated a user javier with password javier in my htpasswd file and got this: Automatically using MD5 format. javier:$apr1$nO/.$x0j4FfqCIQqgtqPckVUkO1 Then I did the following code: - -- And the output was: password: javier cryptsalt: $1$nO/.$ crypthash: $apr1$nO/.$x0j4FfqCIQqgtqPckVUkO1 crypted by me: $apr$1$nO/.$0cKBXpoO.Q/jpA6sUUafq0 Something didnt worked because as you can see I couldnt generate the same crypted hash for my password as apache htpasswd did. Any idea ? Thanks in advance J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Apache htpasswd
On 07/07/2005 at 14:23 Richard Lynch wrote: > >Aha! > >Since your output has an extra '$' after the $apr and before the >1$n0/. I'm gonna go out on a limb and suggest you probably shouldn't >add the '$' to the front of your salt. > >You're adding it, and crypt() is adding it, and you've got too much money >in your salt. :-) > >Change step 3 to: >$cryptsalt = substr($crypthash,4,11); > >Basically, do whatever it takes to get the front half of the crypted >outputs to match up, and I suspect that the random parts at the end will >magically sort themselves out. :-) As far as I've read, crypt needs $1 as the satart of salt to know that it should be crypted with md5. Then the code it's ok in that way. Nevertheless, I've tried what you said but it didn't work because crypt made an encryption with something that is not md5 and the result is: $apr1$LsJY6m0XL/I Any idea ? Thanks in advance J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] object method overloading
can you do method overloading in php as you can in java? Javier _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Controlling Access
You can play with a $_SESSION var, .. Imagine that you have the file a.php with .. And you want b.php that can only be executed after a.php: And so ... -Mensaje original- De: Doug Wolfgram [mailto:[EMAIL PROTECTED] Enviado el: martes, 26 de agosto de 2003 17:45 Para: [EMAIL PROTECTED] Asunto: [PHP] Controlling Access I have an application that consists of some 30 php modules. Each one links to another, as you can imagine. How can I create a security mechanism that only allows the modules in my system to be called from one-another? I do nto want any of the modules to be called by typing them on the address bar. Of course, sessions takes care of folks who have not logged into the system, btu I don;t want registered users hacking around either. I though of using HTTP_REFERER as a handshake restrictor, but it seems to be unstable and unreliable. Any suggestions? D 'Marketing that Listens" Doug Wolfgram CEO - GRAFX Group, Inc. www.gfx.com www.aimprojects.com 949.433.3641 -- 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] Php.ini doesn't exit
Hi all, Where does PHP get its settings if php.ini file doesn't exist? BTW- I want to enable sockets that are not enabled. Could I do that without creating a php.ini file? Regards, Javi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Login / Authentication Class
I've been developing a simple (protecting nuclear secrets it aint) login / authentication class library. This code is designed to - 1. check unname & password are completed 2. check uname & password contain only permitted chars (a-z,1-9) 3. match user against dbase user table 4. generate a unique session token 5. store session token in dbase 6. set client side session cookie I've attached the code here in the hope that it may be of use to some of you. I also welcome any feedback regarding problems / security shortcomings or ways it can be improved. Happy Coding... Notes - -- dbase is postgres (dbase stuff should probably should be abstracted to make the code platform independant) -- password encyrption is done using CRYPT_STD_DES rather than md5 because of legacy data (passwords in current dbase are crypted like this) Here's the code... begin index.html >> end index.html begin doLogin.inc >> uname = $uname; $this->pass = $pass; $this->cookieName = "cookieName"; $this->authUser(); } // validate & authenticate function authUser(){ // check that both uname & password are complete $this->loginDataComplete(); // check uname & pass contain only valid chars $this->validateLogin(); // create dbase object $db = new db(); // encrypt password $cryptedpass = crypt($this->pass,"CRYPT_STD_DES"); // select user & password from dbase $userQuery = pg_exec($db->db, "select oid, adminuser from user where username = '$this->uname' and pass = '$cryptedpass'"); if (pg_NumRows($userQuery) != 1) { $this->halt(); } else { $user_oid = pg_Result($userQuery, 0, "oid"); $this->adminUsr = pg_Result($userQuery, 0, "adminuser"); // generate unique md5 crypted session token $this->createSessionID(); // write session token 2 user table $resultSessid = pg_Exec($db->db, "update user set sessid = '$this->session_id' where oid = $user_oid"); // set session cookie $this->setSessionCookie(); // authentication complete // redirect 2 welcome page here } } // check uname & password are not empty function loginDataComplete(){ if ((!isset($uname)) || (!isset($pass))) { $this->halt; } else { return; } } // do login char validation function validateLogin() { if ( (!$isValidUname = $this->validateChars($this->uname)) || (!$isValidPass = $this->validateChars($this->pass)) ) { //$this->halt(); } else { return; } } // validates login against permitted chars function validateChars($what){ $isValid = (ereg("^([A-Za-z0-9_]*)$", $what)) ? true : false; return $isValid; } // create unique md5 encrypted session token function createSessionID() { srand((double)microtime()*100); $this->session_id = md5(uniqid(rand())); return; } // set cookie with encrypted session token function setSessionCookie(){ $issetCookie = setcookie($this->cookieName, $this->session_id, time()+7200); /* expire in 1 hour */ if (!$issetCookie == 1) { $this->halt(); } else { return; } } // record logon attempt 2 in log function recordLogin(){ $log = new log; $log->record(); } // halt && display errors function halt() { // authentication failed display login form displayLogin(); // write login attempt to log here // call 2 optional error msg handler here } } // end authentication class --- // login presentation template function displayLogin() { ?> Please enter your Username & Password username password
[PHP] re: OO Programming - get practical
For a really good overview of the OO programming read "Thinking in Java" by Bruce Eckel. What you learn can then easily be applied to your coding practices in PHP. The author has made the book available for free from his site www.mindview.com _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] control structure question
is there a more programmatically elegant way of saying... $isError = ""; function main() { doStep1(); if (!$isError) { doStep2(); } if (!$isError) { doStep3(); } // etc. etc. } function doStep1() { if ($something) { $isError = 1; } } function doStep2() { if ($something) { $isError = 1; } } _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] control structure question
So refering back, i re-wrote the original example using the switch syntax... switch (true) { case doStep1(): case doStep2(): case doStep3(): error(); break; default: valid(); } Each case expressions is evaluated, until one of them evaluates to a value equal (==) to the switch expression (in this case a boolean error flag). The error() code will only be called if one of the doStep() evaluates to false. And the valid() code will only be evaluated if the switch reached the default, which means that none of the above check returned false I think for this example the switch syntax is more elegant than using a series of if() statements. Thanks, Javier >For steps and sequences, I always use switches. Most commonly associated >with the "action" variable, it would look like this: > >switch($action) { >default: > // what to show if no variable exists, or is set to a value > // that is not acceptable below >break; >case "add_file": > // what to do in the even that a file needs to be added > // to the database. >break; >case "remove_file": > // what to do in the even that a file need sto be removed > // from the database. >break; >} > >Basically, whatever the value of $action, that is what section of code will >execute. Hope that helps! > >Martin Clifford >Homepage: http://www.completesource.net >Developer's Forums: http://www.completesource.net/forums/ > > > >>> "Javier Montserat" <[EMAIL PROTECTED]> 07/23/02 10:03AM >>> >is there a more programmatically elegant way of saying... > >$isError = ""; > >function main() { > > doStep1(); > > if (!$isError) { > doStep2(); > } > > if (!$isError) { > doStep3(); > } > // etc. etc. >} > >function doStep1() { > if ($something) { > $isError = 1; > } >} > >function doStep2() { > if ($something) { > $isError = 1; > } >} > >_ >Join the world's largest e-mail service with MSN Hotmail. >http://www.hotmail.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec / mkdir question
i'm using the following code to create a directory :- $temp = exec("mkdir $path"); it doesn't work... i've validated the $path var which is correct. i suspect it is a permissions issue. what should i look for to resolve this? thanks, javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] insert query fails w/ postgres database
Hello PHP people... I'm trying to insert a filename (string) into a postgres database field but the insert query is failing - Warning: pg_exec() query failed: ERROR: oidin: error in "abc_abcde012_010_mpeg1.mpeg": can't parse "abc_abcde012_010_mpeg1.mpeg" in /usr/local/apache/htdocs/filename.php on line 835 Here's the query - $addFileResult = pg_exec($db->db, "INSERT INTO files(filename,type,size,uploaded) VALUES ('$this->uploadedFileName','$this->uploadedFileType','$this->uploadedFileSize','now'::datetime)"); Table looks like this - CREATE TABLE "files" ( "filename" oid, "type" varchar(30), "size" int, "uploaded" datetime ); Any Ideas? Saludos, Javier _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] oops - solved re: insert fails w/ postgres database
the filename field is of type 'oid' rather than 'character varying'... yep, inserting a string into an oid feild will make the db baarrrfff... Saludos Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] setcookie IE6 problem
I'm setting a session cookie with the following code - function setSessionCookie(){ $expires = time()+$this->session_expires; $issetCookie = setcookie("$this->cookiename", "$this->sess_id", "$expires", "/", "" ); } Occasionally setcookie seems to fail in IE6, or perhaps when I subsequently retrieve the cookie as a part of the authentication code on each page IE6 fails to pick up the cookie - either way I get logged out. Other browsers (NS4, IE5, IE5.5) seem okay. Any Ideas? Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setcookie IE6 problem
Thanks for the reply, a little more info below... Speaking of cookies, any general thoughts on the relative merits of using php's setcookie function vs. setting a cookie with a header() call? Are both methods equal? Will do more research later and post anything interesting on the IE6 issue... . . . . . php manual - setcookie notes [EMAIL PROTECTED] wrote - MSIE 6 has a inaccurate definition of third party cookies. If your domain is hosted on one server and your PHP stuff is on another, the IE6 p3p implementation considers any cookies sent from the second machine "third party". Third party cookies will be blocked automatically in most privacy settings if not accompanied by what MS considers "an appropriate Compact Policy". In order to make this new piece of tweakable garbage happy I'd suggest you'd par exemple send header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); before sending your cookie from your second machine. This header enables your cookie to survive any privacysetting. >MS has introduced p3p policy in IE6 which has impacted on cookies etc. If >the site or host does not have a machine generated xml privacy statement, >then stability with regards >to cookies is not guaranteed. Do a search and read up about it. Check out >w3c's site. > >- Original Message - >From: "Javier Montserat" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, August 29, 2002 1:39 PM >Subject: [PHP] setcookie IE6 problem > > > > I'm setting a session cookie with the following code - > > > > function setSessionCookie(){ > >$expires = time()+$this->session_expires; > >$issetCookie = setcookie("$this->cookiename", > > "$this->sess_id", > > "$expires", > > "/", > > "" > >); > > } > > > > Occasionally setcookie seems to fail in IE6, or perhaps when I >subsequently > > retrieve the cookie as a part of the authentication code on each page >IE6 > > fails to pick up the cookie - either way I get logged out. > > > > Other browsers (NS4, IE5, IE5.5) seem okay. > > > > Any Ideas? > > > > Javier > > > > > > _ > > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cannot get data from form.
Turning off register globals and referencing variables through the new array syntax certainly gives a greater degree of control over the origin of data; ie: a variable referenced $_POST['foo'] has (most likely) been received as a result of http post and it's reasonably safe to assume $_COOKIE['foo'] is a value from a cookie etc. In this example with globals=on $foo could have come from anywhere... The only thing i've found a bit annoying is when a value can be passed variously by a form (method=post) or as a query string value appended to a link uri. Writing... if (isset($_GET['foo'])) { $foo = $_GET['foo'] } elseif (isset($_POST['foo'])) { $foo = $_POST['foo'] } when I want to use $foo is a bit annoying, but i haven't figured out a more elegant way of saying this yet. Javier >> That's the way it works in the newer PHP for security reasons. I had to rewrite all my code about a week ago because my client was using php 4.2 and I had 4.0. It has to do with the Globals are set to being turned off in the php.ini file. You should be able to change the php.ini file to globals on, but people will argue that it's a security problem and you should just change all your global varieables to the new way. It's your call. Hope this helps. Brian Le Van Thanh wrote: >- I have installed PHP4.2.2 with Apache 1.3.26 on Solaris7. >And now I have problems with getting data from form. >I have 2 pages test.html and welcome.php as following: > >test.html > > Enter your Name: > > > >--welcome.html- > >?php > print $name ; >?> > >=== > >Then I cannot get the value of input name. >But if I write " print $_POST['name'];" or " print >$HTTP_POST_VARS['name'];", it's ok. > >Is there something wrong when I install PHP? >Thanks a lot. -- Brian Windsor Giant Studios Senior Technical Director of Motion Capture [EMAIL PROTECTED] (404)367-1999 _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how do I send information to a php page from a menu list
different approach using JavaScript... // drop down redirect function doRedirect(value) { if ((value != "") || (value != "0")) { self.location=value; } else { alert('Please Make a Selection'); return false; } } //--> < make a selection > Bueno, Javier --=_NextPart_000_0055_01C252D0.ADA4A940 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, how do I send information to a php page from a menu list? When a user selects an item from the list I would like to be able to = send "selcategoryid" to faqbycat.php without the use of a submit button. Is it done by using the onChange event? if so how may this be done? The code I am using presently is below Select a = Category $faqcats"; }//while = ($myrowadmintitles=3DMySQL_fetch_array($admintilteresult)) ?>=20 =20 Thanks for your answer, Ivan --=_NextPart_000_0055_01C252D0.ADA4A940-- _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting array question
i have the following code which reads a list of files from a directory - $listcmd = "ls " .$dirPath; $temp = exec($listcmd, $listoffiles, $status); if($status == 0) { for ($i =0; $i < sizeof($listoffiles); $i++) { $this->fileName[$i] = $listoffiles[$i]; $this->sizeofFile[$i] = sprintf("%01.2f", (filesize($dirPath."/".$listoffiles[$i])/1024)/1024); $this->fileDate[$i] = date("d-M-y H:i", filemtime($dirPath."/".$listoffiles[$i])); } $this->displayFiles(); What I want to do is display the files sorted by date. Okay, so I've just realised that the really easy way to do this is by adding -St (sort by time) to the ls command... $listcmd = "ls -St " .$dirPath; But how could this be achieved by sorting the three arrays? What if I alternately wanted to sort the files by name, size or date without re-reading the directory each time? Would an associative array structure be better suited to this type of operation? Thanks for your insight, Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] greeting based on time
really simple one - does someone have a bit of code that will variously display 'good morning', 'good afternoon', 'good evening' based on the current time? good morning from london, Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class operator :: Problem
i think because you assign a method to the variable rather than a data member you need to include parenthsis... a::test() >> I have problems to make a dynamic call, please help me returns: Fatal error: Call to undefined function: a::test() in /usr/local/share/version2.mypsi.de/index.html on line 10 --- Christian Unger IT-Consultant PSI Infrastruktur Services GmbH Dircksenstr. 42-44 10178 Berlin Tel: 030 / 2801 - 2536 Fax: 030 / 2801 - 297 2536 e-Mail: [EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: Refering to an object from within an array variable in another class
Hi, Syntax B doesnt seem to work exactly because as you say "it doesn't directly access the 'bars' variable..."; here... $reference_to_bar = $this->GetBar($id) ; it seems that a copy of the bar object is being created, which is a new object. This new bar object is not related to the bar object which is a part of the $bars array property of the foo object. When you set the marklar property to the new value ... $reference_to_bar->SetMarklar($value) ; the value is changed for the new copy of the bar object you have just created. Because this value is assigned to the new object it doesn't appear when you print the contents of foo. This is illustrated by the lines i've added below. Maybe after setting the new property value you could reassigned this object to the $bars array of object foo. I'm no expert but it's always fun to play with code... Hope this helps in some way, Javier /* But this syntax doesn't: and this would be prefered, as it doesn't directly access the 'bars' variable... */ $reference_to_bar = $this->GetBar($id) ; echo $reference_to_bar->marklar; $reference_to_bar->SetMarklar($value) ; echo $reference_to_bar->marklar; print_r($reference_to_bar); _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: Refering to an object from within an array variable in another class
I believe the following discussion from Web Application Development with PHP 4.0 (available online at http://safari.oreilly.com) may shed some light on your question... >> Whenever PHP encounters a statement for which write access to a variable is needed, it evaluates and calculates the data that will be written into the variable, copies it, and assigns the result to the target space in memory. (This description is a little bit simplified, but you get the idea.) $some_var = 2; $my_var = $some_var * 3; $new_var = $some_var + $my_var; Looking at this script, PHP will Create space for $some_var and write 2 into it. Create space for $my_var, retrieve the value of $some_var, multiply it by 3, and assign it to the newly allocated memory. Create space for $new_var, retrieve the values of $some_var and $my_var, total them, and write them back to the new place in memory. Well, this sounds nice and logicalbut these are simple types and you've worked with them many times already. Things are very different (and illogical) when PHP is handling classes: class my_class { var $var1, $var2, $var3; } $my_object = new my_class; $my_object->var1 = 1; $my_object->var2 = 2; $my_object->var3 = 3; $new_object = $my_object; $new_object->var1 = 3; $new_object->var2 = 2; $new_object->var3 = 1; print("My object goes $my_object->var1, $my_object->var2, $my_object->var3 !"); print("New object goes $new_object->var1, $new_object->var2, $new_object->var3 !"); What do you think this will produce as output? The script first declares a class, creates one instance of it, and assigns values to its three properties. After having done this, it creates a new reference to this object, reassigns its properties, and then just prints out each property by using both references. Remember, one instance. Figure 2.7 shows the result. Figure 2.7. PHP creating a copy instead of a reference. If you're not surprised now, you either know PHP very well already or haven't thought enough about objects yet. PHP has created a copy, a new instance of my_class instead of just a new reference! This is not the desired behavior, since the new operator is supposed to create an instance of my_class in memory, returning a reference to it. Thus, when assigning this reference to another variable, only the reference should be copied, leaving the original data untouchedsimilar to a file system link, which allows access to the same data through different locations on the file system. This behavior of PHPcreating copies of referenced data rather than just the reference itselfmay not sound important enough to focus on; however, you'll see in a moment that it actually does make a difference. Note: At the time of this writing, both PHP 3.0 and PHP 4.0 are using copy syntax. A chat with someone closely involved in the core development revealed that the plan is to change the default behavior to use a reference syntax, but this change would cause a loss of backward compatibility. A possible change is planned with version 4.1if this happens, information contained here will be invalid for all future versions. Web Application Development with PHP 4.0 Tobias Ratschiller Till Gerken Zeev Suraski Andi Gutmans Publisher: New Riders Publishing First Edition July 12, 2000 ISBN: 0-7357-0997-1, 416 pages _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML vs Everything Else
>Spend some time learning about xml and you won't regret it Could you (or anyone else on the list) recommend some good resources (Books / Websites) for learning XML and XSLT? Thanks, Javier _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] formatting a filename
i want to format the filename of an uploaded file as follows :- -- replace blankspace with "_" -- remove any illegal characters. Which string functions should I use to do this? Thanks, Javier _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: formatting a filename
$filename = strtolower (eregi_replace ("[^A-Za-z0-9_.]", "_", $filename)); seems to be what I want. thanks to everyone for the help Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] setting .htaccess authentication with PHP
Hello Everyone, I've developed a feature which allows clients to upload files to a dir on the server. I want to allow clients to email a url to the file as follows :- http://www.mysite.com/clientX/file01.jpg I want to setup challenge / response authentication on the client folder so that when someone clicks the link they are prompted for a username / password. I'm thinking that apache .htaccess permissions are the best way to do this. The server is running Linux. My question is, can I write a PHP / shell script to automatically set folder access permissions and how would this be done? Thanks, Javier _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quotes in text strings
Hi Single quote's in strings entered via a text input field are subsequently appearing with what appears to be an escape character - comm\'ents how can i correct this? I've tried htmlspecialchars($string, ENT_QUOTES); and htmlentities($string, ENT_QUOTES); but these don't seem to work (maybe its me). Thanks Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] weird IE cookie problem
Hi I've successfully been using the following code to set cookies in IE / NS / Mozilla. I've just bought a new laptop and in IE 5.5 and 6 the cookies are not being set by my site. Other sites (msn etc) set cookies fine. I've installed Mozilla and this accepts cookies fine. WTF is wrong with IE on this new machine...??? Has anyone encountered anything like this...??? Here's the code - $cookiename = "test"; $value = "testvalue"; $expires = time()+3600; $domain = "mydomain.com"; $path = "/"; $COOKIE = "Set-Cookie: $cookiename=$value"; if (isset($expires) && ($expires > 0)) { $COOKIE .= "; EXPIRES=". gmdate("D, d M Y H:i:s",$expires) . " GMT";} if (isset($domain)) { $COOKIE .= "; DOMAIN=$domain"; } if (isset($path)) { $COOKIE .= "; PATH=$path"; } if (isset($secure) && $secure>0) { $COOKIE .= "; SECURE"; } header($COOKIE,false); // this doesn't work either ... setcookie ( $cookiename , $value, $expires, $path, $domain); _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird IE cookie problem
ahhh. a combination of incorrect timezone on my new laptop and the server time being slightly out was causing my head a lot of pain... thanks for the pointer, Jav >From: Marco Tabini <[EMAIL PROTECTED]> >To: Javier Montserat <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: [PHP] weird IE cookie problem >Date: 14 Oct 2002 13:44:25 -0400 > >Is the time set properly on your machine? Double check both the time AND >the timezone. I went nuts trying to fix a similar problem once just to >find out that someone had changed the timezone on the PC for a test and >then forgot to put it back. > > >On Mon, 2002-10-14 at 13:25, Javier Montserat wrote: > > Hi > > > > I've successfully been using the following code to set cookies in IE / >NS / > > Mozilla. I've just bought a new laptop and in IE 5.5 and 6 the cookies >are > > not being set by my site. Other sites (msn etc) set cookies fine. I've > > installed Mozilla and this accepts cookies fine. WTF is wrong with IE >on > > this new machine...??? > > > > Has anyone encountered anything like this...??? > > > > Here's the code - > > > > $cookiename = "test"; > > $value = "testvalue"; > > $expires = time()+3600; > > $domain = "mydomain.com"; > > $path = "/"; > > > > $COOKIE = "Set-Cookie: $cookiename=$value"; > > > > if (isset($expires) && ($expires > 0)) { > > $COOKIE .= "; EXPIRES=". > > gmdate("D, d M Y H:i:s",$expires) . > > " GMT";} > > if (isset($domain)) { $COOKIE .= "; DOMAIN=$domain"; } > > if (isset($path)) { $COOKIE .= "; PATH=$path"; } > > if (isset($secure) && $secure>0) { $COOKIE .= "; > > SECURE"; } > > header($COOKIE,false); > > > > // this doesn't work either ... > > setcookie ( $cookiename , $value, $expires, $path, $domain); > > > > > > _ > > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] left click downloads
I want to make it easier for people to download files from my website by having the download start when the visitor clicks a link (as opposed to right click / save target as). How can I achieve this with PHP? Do I include the file in a header() call ? Thanks, javier _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] left click downloads
here is a simple function I have created to do single click downloads in php - function sendFile($filepath) { $filename = basename($filepath); $mimeType = mime_content_type($filepath) header("Content-type: $mimeType"); header("Content-Disposition: attachment; filename=$filename"); readfile($filepath); } In Unix can anyone post a method of obtaining mimeType using the file command which could be compatible with this function? I guess this is possible... my understanding is that mime_content_type() is based on unix file commands method of pattern matching 'magic bytes' of known file formats. hope this is useful to some of you... javier From: "David Russell" <[EMAIL PROTECTED]> To: "'Javier Montserat'" <[EMAIL PROTECTED]> Subject: RE: [PHP] left click downloads Date: Tue, 12 Nov 2002 13:46:58 +0200 Hi Javier, Nope, this is not a php thing at all. You could probably get it right with Javascript or something similar. HTH David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Javier Montserat [mailto:codareef@;hotmail.com] Sent: 12 November 2002 01:24 PM To: [EMAIL PROTECTED] Subject: [PHP] left click downloads I want to make it easier for people to download files from my website by having the download start when the visitor clicks a link (as opposed to right click / save target as). How can I achieve this with PHP? Do I include the file in a header() call ? Thanks, javier _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php << smime.p7s >> _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Works in html, not when echoed in PHP
rather than using echo why not just do this - ?> onresize="window.location.reload(false)" topmargin="1" bottommargin="0" leftmargin="0" rightmargin="0"> ?> this way you don't have to worry about getting the quotes right... Hello, "Aaron Merrick" <[EMAIL PROTECTED]> wrote: Folks, Can't see an answer anywhere in the archives, so here goes. This works fine in plain html: When I put it in PHP thus: echo ""; When the page loads, I get an "Error: 'menuObj' is null or not an object" The onoff() function is what contains the menuObj, so I suspect the single quotes around the parameters mainmenu and on, but have tried everyway I can think of and can't get rid of the Error. The function is thus: _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP download problem IE5 on mac
I'm using this code to various files for download via a http header - $filename = basename($filepath); header("Content-type: unknown/unknown"); header("Content-Disposition: attachment; filename=$filename"); readfile($filepath); works fine in most cases - the save dialogue appears. However - IE on a MAC loads the file inline rather than throwing the save prompt. Any ideas? Javier _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple file upload
Is it posible to do multiple file upload without selecting each file manual in multiple form fields? Yes. I have recently implemented an upload mechanism based on hotmails add attachment mechanism. haven't got time for a detailed explanation but here is the basic idea - on your html page - // a file selector field // add remove files buttons // files in the upload list field $FooObj->displayFileUploadList(); ?> file upload list is a database varchar field with each file id seperated with a pipe character - fileID1|fileID2 add / remove event handlers write / remove entries from this list. displayFileUploadList writes tags for each file in the list finally a doUpload function retrieves the file upload list and copies the files from the upload staging area to their final destination. Incidentally the same mechanism works for lots of other stuff like sending email to multiple recipients etc. Have Fun, javier _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple file upload
here's a couple of the more tricky code snippets which should make it easy for folks to see how a multiple file upload select can work - the rest is basically a lot of interaction with the database - storing / retrieving the upload list. Its a bit tricky but worth it though - the users responcible for uploads via the system I built have been saying it makes their lives a lot easier. If i get time i'll try and generalise the whole thing into an absract class that folks can use... // remove a file from upload target list function removeFileFromUploadList() { $this->getFileUploadList(); // get the upload list from the database $selectedFileList = $_POST['selectedFileList']; // an array of selected values from the multiple select box // diff the arrays, store the new list if ((sizeof($this->uploadFileList) >= 1) && ($selectedFileList != "")) { $this->uploadFileList = array_values(array_diff($this->uploadFileList,$selectedFileList)); // subtract remove items $this->storeFileUploadList(); } } // add pipe encoding to an array (file upload list) and return a string for storage in db function addPipeEncoding($array) { for ($i = 0; $i < sizeof($array); $i++) { $addPipe = ((sizeof($array) == 1) || ($i == sizeof($array)-1)) ? "" : "|"; $returnValue .= $array[$i].$addPipe; } return $returnValue; } // remove pipe encoding from string function removePipeEncoding($encodedString) { $split = explode("|",$encodedString); for ($i = 0; $i < sizeof($split); $i++) { if ($split[$i] != "") { $returnArray[] = $split[$i]; } } return $returnArray; } _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php 4.3 and php_pgsql.dll
hello people, i seem to have a little problem here. I hope someone could help. i have a machine running apache on linux and another one with apache on winxp. i've downloaded and installed the php-4.3-alpha version s for linux and windows. mysteriously, the php_pgsql.dll is not included in the windows zip file. so, i used the one that came with php-4.2 for windows. i used php as a sapi module in apache. apache displays an error message that says it fails to load the php_pgsql.dll extension. could it be of the version conflict? or what? please help!!! = __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Interview questions
Yes, I gree with all. To test their mySql level, you can show them two tables, and the results from a join between the two tables, so you ask them for what is the SELECT statement to get that results. Example .. Table1: ++-+-+--+ | id | name| surname | departmentId | ++-+-+--+ | 1 | John| Doe |1 | | 2 | Scott | Johnson |2 | | 3 | Mikael | Martin |2 | | 4 | Nicolas | Survey |3 | ++-+-+--+ Table2: +++ | id | departmentName | +++ | 1 | Production | | 2 | Sales | | 3 | Marketing | +++ Question: What's the select statement to show this results: +-+-++ | name| surname | departmentName | +-+-++ | John| Doe | Production | | Mikael | Martin | Sales | | Nicolas | Survey | Marketing | | Scott | Johnson | Sales | +-+-++ Answer: select name,surname, departmentName from table1 left join table2 on table1.departmentId=table2.id order by name asc; This example is very very easy, don't put it into your exam :) Look for other examples searching in google or any searcher .. -Mensaje original- De: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Enviado el: martes, 26 de agosto de 2003 18:03 Para: Micheal Harris; [EMAIL PROTECTED] Asunto: Re: [PHP] PHP Interview questions From: "Micheal Harris" <[EMAIL PROTECTED]> > I am in the process of hiring someone that needs to have extensive PHP and > MySQL experience. Does anyone have any suggestions for interview questions? > I have no PHP or MySQL experience, and come from a non-technical background. > I want the questions to be technical, but I am unsusre as to how specific I > should get with the questionning! How are you going to grade it, though, if you don't know PHP or MySQL? I say you should send them to the list and let us grill them!! We'll sort out the riff-raff.. :) Seriously, look at their portfolio, call their references, and MAKE them write code. TASK: Create a PHP application that will insert names and dates of birth into a MySQL database. CONDITIONS: Given the PHP Manual, MySQL Manual, Notepad (or similar text editor), and database host, user, and password information. STANDARD: The application will run without errors when complete. The application will accept a first name, last name, and date of birth (in DDMMMYY format) through an HTML form and store the information in a MySQL database. The application will list all current entries in the database in an HTML table after a new row is inserted. Things to look for: 1. Do they program for register_globals ON or OFF? 2. Do they check the setting of magic_quote_gpc? 3. Do they include error checking of form data and queries? 4. Is their program open to cross site scripting or SQL injection attacks? 5. Do they use a DATE type column or VARCHAR column for dates? 6. Do they write valid HTML? 7. How many files do they use to accomplish the task? 8. Do they try to add extra "fluff" instead of just accomplishing the task? Hopefully others will pipe up with their comments, also. :) ---John Holmes... -- 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] speed of mail() on two servers
I think that may be 'problem' from sendmail .. mail() function under linux only interacts with sendmail, it doesn't contact to the remote SMTP to leave the mail. Do you have the same sendmail version in two machines? You should compare both sendmail configuration and try to check the speed from a bash script for example. -Mensaje original- De: David T-G [mailto:[EMAIL PROTECTED] Enviado el: miercoles, 27 de agosto de 2003 0:40 Para: PHP General list Asunto: [PHP] speed of mail() on two servers Hi, all -- I'm working up a [cli] script to send a personalized (ugh) email to some [often large] number of web site subscribers. Unfortunately, I'm getting lousy performance, running about 0.54 sec per email. My partner has a mail script implemented on another machine and he's running somewhere down around 0.10 sec per email, which is better but still not very good for sending to 60k users. The box (dual Xeon 2.2G with mirrored fast SCSI and 1G RAM) has plenty of horsepower, and it certainly shouldn't need more. It's running RH 7.3 (Valhalla) with 2.4.20 on ext3 and has qmail installed as its MTA. It seems to be the mail() call itself, because I can make a system call (system, exec, passthru) to just echo the current data and it rips through my list in nothin' flat. So how do I tune mail() to make it faster? Or do I need to give up and call qmail-inject directly? TIA & 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://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] speed of mail() on two servers
May be the machine of your friend has a better network output than your machine :) -Mensaje original- De: David T-G [mailto:[EMAIL PROTECTED] Enviado el: miercoles, 27 de agosto de 2003 11:59 Para: PHP General list CC: Javier Tacon Asunto: Re: [PHP] speed of mail() on two servers Javier, et al -- ...and then Javier Tacon said... % % I think that may be 'problem' from sendmail .. mail() function under % linux only interacts with sendmail, it doesn't contact to the remote Right. Only it doesn't make much sense, because qmail is FAST. % SMTP to leave the mail. Do you have the same sendmail version in two % machines? You should compare both sendmail configuration and try to % check the speed from a bash script for example. Unfortunately, I can't get to his other server, and he doesn't really know anything about its guts (he's a great php coder and a great art designer, but he's entirely a windoze guy). I don't even know if he's running qmail there. Thanks & 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://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Looping through a list - Newbie question
There are a lot of methods. The most common is using an array: $_SESSION['sv_CampusList'] = Array ("1","2","3","4","5"); foreach($_SESSION['sv_CampusList'] as $id) { echo $id; } If you want to use sv_CampusList as string: $_SESSION['sv_CampusList'] = "1,2,4,5"; $tmpArr = explode(",",$_SESSION['sv_CampusList']); foreach($tmpArr as $id) { echo $id; } -Mensaje original- De: James Johnson [mailto:[EMAIL PROTECTED] Enviado el: miércoles, 27 de agosto de 2003 4:45 Para: [EMAIL PROTECTED] Asunto: [PHP] Looping through a list - Newbie question Hi, I have a list contained in a session var. I want to loop through the list, getting the value of the current item, then do a query based on that value. Is there an easy way to do this, or do I need to convert the list to an array first? In the code below, $id isn't being set. Here's my code (this is just testing stuff, sv_CampusList is set somewhere else): Thanks, James -- 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] Urgent help required for using Cron
For example, you want execute a script every day at 09:00 am: $ crontab -e And put this line: 0 9 * * * /path/to/your/php/binary /path/to/your/script.php Crontab only can say if the cron was executed correctly or not, but it doesn't say if your script in php has sent the mail correctly or not. For debug if the mail was successfully sent, develope the debug into your script. You can use a some mail classes that they have debug options (for example I use phpmailer v1.65). -Mensaje original- De: Safal Solutions [mailto:[EMAIL PROTECTED] Enviado el: jueves, 28 de agosto de 2003 13:32 Para: PHP General Asunto: [PHP] Urgent help required for using Cron Hi friends, I have to send mail to people automatically at specified time . Our environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a program in php to send the mail if some Condition is met. I want to activate this program at specified time using cron facility. So, How can we do that? Can any one help me?. I have another problem also. We want Cron to indicate ( through a message or a mail) to us that a given task is completed or not. In the present case Cron does a task of sending a mail to a user. After sending the mail we want Cron to indicate to us that the mail was successfully sent or not sent. This we want to know through a program because we want to use this as a part of automation of sending mails. Thanking you, Siva -- 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] reboot pc with PHP
You can write a little script with expect (man expect) and execute it from php with exec(). Other solution its to write a .procmailrc in root that executes the reboot when coming a mail with some text in subject or boyd, so, from php you only need to send a mail. -Mensaje original- De: Petre Agenbag [mailto:[EMAIL PROTECTED] Enviado el: jueves, 28 de agosto de 2003 14:48 Para: [EMAIL PROTECTED] Asunto: [PHP] reboot pc with PHP Hi List I've gone through the list for previous questions and the only one that seems to be a solution is to use sudo, however, I cannot seem to get it right. Just as background: I want to make a small "admin" utill for an intranet machine, so the security risks don't bother me at all. Instead of myself having to ssh into the box to reboot or do other "routine" commands, I'd like to make a simple password protected webpage that would have simple links on them like "reboot", "redial" etc, so that someone with some sort of responsibility can do it themselves. Obviously these command(s) need to be run as root, so I looked at the /etc/sudoers and added apache , BUT, in the error log it prompts for a password. I tried to add the option NOPASSWD: ALL to the file, but it says there's a syntax error. What am I missing? Any other ways of doing this? PS, I don't even want to consider Webmin, it's way too complicated, I just want a handfull of predefined commands to be run, nothing else) Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php