Re: [PHP] Cleaning up my messy code
Here is what I would do (this advice and a buck will buy you a cup of coffee): First, I'd take my existing code, look over it and ask, Where am I doing the same thing over and over? Code that is repetitive is a prime candidate for using functions or objects. Objects are easier to maintain for me. So if your making code on each page to access a MySql database, you can then decide to make a class to access your database or take a look at some of the existing classes like PEAR:DB or ADODB that do this for you. Then I'd look at a template system or use XSLT and CSS (my preference - ultimate flexibility - WML, RSS,etc...). So I made a class to return an xml string from a database query (recordfieldnamefieldvalue/fieldname/record). Then each page of the site becomes a matter of reading an xslt file into a variable, sending a query and returning an xml string and transforming the xml into html The advantage is each page of the site has code that looks like this: ?php // includes require('../includes/clsmakexml.php'); require('../includes/clsReadFile.php'); // sql query $sql .= SELECT CS.FirstName, CS.LastName, CS.Firm, CS.CustomerID, CS.Bio, ; $sql .= CI.City, CI.State, CI.ZipCode, CI.PhoneNum, CI.FaxNum, Ci.email, CI.url ; $sql .= \rFROM Customer CS ; $sql .= INNER JOIN ContactInfo CI ON CS.CustomerID = CI.CustomerID ; $sql .= \rWHERE CS.CustomerID = . $_GET['CustomerID']; // convert query to xml string via makexml class $xmldoc = new makexml(mssql); $xmldoc-xmlstart('attys'); $xmldoc-xmlmaker($sql); $xmldoc-xmlEnd(); // read xsl template file via readFile clss $fileR = new readFile(); $fileR-processFile(../includes/header.inc); $fileR-processFile(bio.xsl); $fileR-processFile(../includes/footer.inc); // prepare xsl transformation $xmldoc-xslstr = $fileR-contents; $xmldoc-xslresult = 'result.xml'; $arguments = array('/_xml' = $xmldoc-xmlstr,'/_xsl' = $xmldoc-xslstr); // transform the xml into html $xh = xslt_create(); $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); if ($result) { print $result; } else { print Sorry, the xml could not be transformed by the xsl into; print the \$result variable the reason is that . xslt_error($xh) . print and the error code is . xslt_errno($xh); } xslt_free($xh); ? This isn't bulletproof but makes code easy to read and maintain for me. If I need to add a new feature, I just add a new function, method, or class. If I need something different at the presentation level I just change the XSLT or , more likely, the CSS. On Monday, September 29, 2003, at 02:22 PM, Chris wrote: I am working on a fairly large scale (for myself anyway) project using PHP and MySQL. I am victim of teaching myself to program, not separating presentation from my code-- all the things that lead to masses of spaghetti code so atrocious even I can't figure out what I was doing an hour ago. I'm not looking for an IDE or code generator so much as some practical advice for organization and framework when developing a larger app. I know of PHP Fusebox, having programmed with Cold Fusion fusebox for a while, but it seems like that might be too much. Maybe I just need a sensical, practical approach to application layout. What do you all do? How can I learn to be a better PHP programmer in this regard? 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
Re: [PHP] Re: Sorting parsed XML
You don't need to do client-side transformation (although you could check user agent and do it client-side if the browser supports it). You can use Php's XSLT functions see the manual for more info. I was just suggesting this as a potential option. It may not be appropriate in this situation. I don't really know enough about the programming challenge we are looking at to say for sure @ Edwin wrote: Geoff Hankerson [EMAIL PROTECTED] wrote: This seems to me to be more easily handled by XSLT. (Not the only option but a good one). XSLT lets you select only the nodes you want and also sort them as well. Perhaps... but not all browsers support it. Anyway, you can also select the nodes in PHP and you can sort them as well. And you can do more than that... ;) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sorting parsed XML
This seems to me to be more easily handled by XSLT. (Not the only option but a good one). XSLT lets you select only the nodes you want and also sort them as well. @ Edwin wrote: Hello, Chris [EMAIL PROTECTED] wrote: I'm trying to write PHP code that will not only parse the XML but also allow me to sort the parsed information by the values parsed. I'm not sure if I really understand but let me try... ...[snip code]... Adding echo 'table border=1'; before this and $xml_parser = xml_parser_create(); ...[snip code]... after this xml_parser_free($xml_parser); echo '/table'; shows a good view that you have a table with two columns. If you'd like to sort these, then I think you might be able to do something like this: 1. Instead of printf()'ing your td's or tr's inside the class/function, why don't you try putting it inside an array? (Maybe with array_push() or something.) Then, 2. If you already have an array, perhaps you can use one of the functions here for sorting: http://www.php.net/manual/en/ref.array.php HTH, - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] *.PHP save-as dialog
Did you try getting rid of the IfDefine HAVE_PHP4 stuff? Lee Philip Reilly wrote: Hi there, I posted this message yesterday: -- I recently upgraded from PHP version 4.0-ish to 4.2.3 on my Linux/Apache machine. AFAIK, Apache is setup correctly (it serves HTML) and PHP works, but only from the command line. If I type php -q php.php test.html the output of phpinfo() is stored in test.html. When I try and look at test.html running on localhost it displays fine, but when I try and view php.php, as save as window pops up. I am not too familiar with Linux. If it was a Windows installation then I would make sure the Action application (path to php.exe) line was correct, but I can't find this in the Linux httpd.conf. Does this issue sound familiar to anyone. Could anyone point me in the right direction? - I am still having the same problem. It is obviously a problem with my httpd.conf file. PHP is installed as a CGI, and the AddHandler application/x-httpd-php .php is present. Can anyone offer any other suggestions? Below is my httpd.conf file. My apologies for inserting so many lines, but this is an extremely niggling problem, and I... just... can't... figure... it... out /shatner. If anyone could have a quick look to try and identify the problem, I would really appreciate it! Thanks. - Best regards, Lee Reilly -- ## httpd.conf - configuration for the Apache web server # # Generated automatically... if you edit manually, the changes will be lost # the next time you run apacheconfig. # # What we listen to # ServerType StandAlone ServerRoot /etc/httpd/ # We don't handle this yet... # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Please read the file README.DSO in the Apache 1.3 distribution for more # details about the DSO mechanism and run `httpd -l' for the list of already # built-in (statically linked and thus always available) modules in your httpd # binary. # # Note: The order is which modules are loaded is important. Don't change # the order below without expert advice. # # Example: # LoadModule foo_module modules/mod_foo.so #LoadModule mmap_static_module modules/mod_mmap_static.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule env_module modules/mod_env.so LoadModule config_log_module modules/mod_log_config.so LoadModule agent_log_module modules/mod_log_agent.so LoadModule referer_log_module modules/mod_log_referer.so #LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule mime_modulemodules/mod_mime.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule status_module modules/mod_status.so LoadModule info_modulemodules/mod_info.so LoadModule includes_modulemodules/mod_include.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule dir_module modules/mod_dir.so LoadModule cgi_module modules/mod_cgi.so LoadModule asis_modulemodules/mod_asis.so LoadModule imap_modulemodules/mod_imap.so LoadModule action_module modules/mod_actions.so #LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule access_module modules/mod_access.so LoadModule auth_modulemodules/mod_auth.so LoadModule anon_auth_module modules/mod_auth_anon.so LoadModule db_auth_module modules/mod_auth_db.so #LoadModule digest_module modules/mod_digest.so #LoadModule proxy_module modules/libproxy.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule example_module modules/mod_example.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_modulemodules/mod_setenvif.so #LoadModule bandwidth_module modules/mod_bandwidth.so #LoadModule put_modulemodules/mod_put.so IfDefine HAVE_PERL LoadModule perl_modulemodules/libperl.so /IfDefine IfDefine HAVE_PHP LoadModule php_module modules/mod_php.so /IfDefine IfDefine HAVE_PHP3 LoadModule php3_modulemodules/libphp3.so /IfDefine IfDefine HAVE_PHP4 LoadModule php4_modulemodules/libphp4.so /IfDefine IfDefine HAVE_DAV LoadModule dav_module modules/libdav.so /IfDefine IfDefine HAVE_ROAMING LoadModule roaming_module modules/mod_roaming.so /IfDefine IfDefine HAVE_SSL LoadModule ssl_module modules/libssl.so /IfDefine # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. #
Re: [PHP] XML and XLS Sablotron
Basically SAX and DOM are for parsing xml and xslt is for transforming xml into html, svg, wml, pdf and the like. So it sounds like you want to use xslt. Daniele Baroncelli wrote: Dear all, I am just approaching to XML and I would need some explanation, which most of you will probably consider very trivial. I have read about the XLS Sablotron functions, which are able to apply XLS stylesheets to an XML document. My question is: if my aim is to apply to an XML document an XLS stylesheet server-side (being able in this way to avoid browsers incompatibilies) with PHP, which could it be my need to use SAX or DOM parsers? Could XLS Sablotron be seen as an alternative to SAX or DOM, or does in some ways rely on these technologies? Really thanks to whom will be able to clarify me on this. Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xml parsing
Change xml into a different type of xml sounds like a job for the xslt functions. Works like a charm Michael Ransburg wrote: Hi! I understand that it's easily possible to parse xml documents with php. But what about changing them? With other xml parsers, I have the xml document in a structure (usually a tree or an array) and when I change something in the structure I can later write out the structure again into a xml file and get a changed xml file that way. Is this possible easily with PHP too? Thanks Mike --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 03.10.2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP XML
Ultimately it's about flexibility and seperating content from presentation.Even if you don't have sites that need to be output into multiple formats you will almost cetainly need to redesign some or all of the presentation at some point even if it is only in html. Have you ever had your boss/client say I want to give the Website a new look. If you have content mixed in with presentation you will need to do a lot of work to mix your content into a new presentation layer. It's also about writing code that is easy to maintain. You can make a class to convert db content to xml and another to convert xml to html via xslt. Your pages suddenly become very easy to write (an have fewer lines of code) , they only differ in the sql statment and the name of the xsl file. I am going to do all my sites like this now. I'm tired of the old way. it's too much work. Joshua Alexander wrote: I still wouldn't use XML for this. I mean, all the articles are in the database, and I'm already using PHP to pull them out and format them into html, right? I can just as easily use PHP to put them into all those other formats. So again, why waste time with XML unless I need to feed these articles to others, like in a newsfeed situation? But if I were ever I would definitely invest the effort that is required, but until then I will save myself from the extra work. Let's imagine you create a website of an online magazine, this magazine publishes in HTML, PDF, TXT, PS, etc, etc, etc. How would you do it? I would use XML to write the articles and then stylesheets to transform the articles to the formats I want. Write once, publish anywhare ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
A few ideas: 1. I have been setting up a system to do almost exactly what you are doing (database -- xml -- xslt--html via a custom class) and have not noticed any significant performance hit, but this is not in production so your mileage may vary, but my gut feeling is the performance hit is very small (real scientific - not). 2. Does all this data from your database have to be converted on the fly? In other words does it have to be completely dynamic? If some of the content is updated fairly infrequently then you could have a cron-job type process convert from database to xml files at a given interval (hourly, weekly, montly etc..). Or even think about whether your data needs to live in a database. Can it just live in an xml file? 3. Modern browsers can convert using xslt themselves so you could check the user agent and have the browser transform the xml if it is capable (IE5-6, Netscape 6-7, mozilla etc...) I am going to do all the transformation on the server and live with the slight performance hit. I think the benefits are worth it. Making and maintaining a site become so easy once you have this set up. The code on each page is compact and almost exactly the same, the only variance is the sql statement and the name of the xsl file. Go ahead and email me off list if you want to discuss this off list Chris Boget wrote: Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. First I have to query and pull the records from the database. Then, I need to send those records to a function (or functions) to convert it to XML. Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. How much experience have any of you had with doing that? Does it take significantly longer to serve the pages; is there a noticible performance hit? Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is php even right for this design?
3)Reporting. I think I can get by with HTML reports for the most part. however checks and tax forms require precisely positioned reporting abilities. I think that I will be better off using an external reporting application (crystal,access,FoxPro etc) to generate these reports. But if I do that then I'm sure I'll have to duplicate some of my coding efforts, since there is no way to achieve interop between these languages. Is there anyway to minimize the need to duplicate code? Perhaps expose your report data as xml or even an xml service then your report writer can parse it or just use an xslt stylesheet to present the xml data. Just an idea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php nuke problem
I think you need change permissions the file that holds configurations settings for php-nuke. Read the install instructions it's in there chmod 665 config.ini or whatever the name of the file is Ryan A wrote: Hey guys, I just setup php nuke (damn,thats a big package) but the problem is that i cannot create a super user ,go the admin, or do anything when i go to index.php it tells me to create a super user by clicking the link,after i click that link i go to admin.php and when i fill that form,it just displays the same form over and over again...the super user/ admin user does not get created... on the left of the page i have a list of modules when i click on any of the modules i get this... Sorry, you can't access this file directly... Whats the problem? Please help, Cheers, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Windows Authoring Tools
jEdit is nice www.jedit.org Seán Dillon wrote: As an fan of Homesite for many years I'm a little annoyed I can no-longer purchase the product seperately, so am going to be stuck with v5.0 as I don't fancy the idea of forking out for Dreamweaver MX. I'm looking for (hopefully) a GNU/GPL Open source product that supports PHP syntax (and preferably with support for additional languages with ad-ins or plugins). Currently I'm looking at HTML-Kit (http://www.chami.com/html-kit/) which seems to come with a vast array of add-ins and seems very 'extensible'. In the past I've been using TextPad and UltraEdit but really want something that picks up on PHP syntax and function spelling (eg Homesite would 'bold' a function word if it was splt correctly). I'd be interested to hear what others are using so I can take a look at them before I change my main authoring product. Seán -- 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] XML doubt
I am not sure, but my best guess is if you are using Apache and Php as a module is that each request will be handled by a seperate child process of Apache. Perhaps someone can correct me if I am wrong. Rodrigo Dominguez wrote: Ok, thank you just one more doubt Is it threading safe? For example: At 13:30:10 [Proccess 1] cliente request index.php At 13:30:11 [Proccess 1] index.php is putting the content of the querey into index.xml At 13:30:12 [Proccess 2]a new client request index.php At 13:30:13 [Proccess 2]a new instance of index.php is invoked and it starts to put the content of the query into index.xml, but [Proccess 1] is still working with index.xml What happends? Geoff Hankerson [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Forgot a step: (1C) make an xslt stylesheet which is basically just a beefed-up html page. Check out devshed.cm xml.com and w3c.org for info on xslt stlyesheets Geoff Hankerson wrote: Rodrigo Dominguez wrote: I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects. I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP. Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it? Thank you. 1. Convert sql queries into xml (I'm glad to send a copy of my class if you'd like) basically its: A. Loop over query as you normally would B. Loop through each column in a record for a query and make an xml compatible string like: record fieldname value /fieldname /record 2. Then just follow the xslt section of the php manual it's pretty straight forward Give it a shot, if you have trouble send specific questions to the list I and quite a few other will be glad to help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sort dinamic generated table
Rodrigo Peres wrote: Hi, I have a resume system that put a rank in it resume at runtime. example: If you do a serach for each match that it finds it atribute 1 point, now I need to sort the generated list based in this rank, how can i do this, since this rank is dinamic and isn't in database?? Thank's Did you try putting it all in into an array and sorting the array? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML vs Everything Else
Rodrigo Dominguez wrote: I'm writting an application, a control panel for a web site, and it will be great if I can separe data from presentation, I know that I have to work with XML and XSL but I didn't understand how it works. Can you give me a simple example? Let guess that a client request index.php, and I have index.xml for the data, index.xsl for the data transformation and index.php, how it works? From the php manaul: ?php // Allocate a new XSLT processor $xh = xslt_create(); // Process the document if (xslt_process($xh, 'sample.xml', 'sample.xsl', 'result.xml')) { print SUCCESS, sample.xml was transformed by sample.xsl into result.xml; print , result.xml has the following contents\nbr\n; print pre\n; readfile('result.xml'); print /pre\n; } else { print Sorry, sample.xml could not be transformed by sample.xsl into; print result.xml the reason is that . xslt_error($xh) . and the ; print error code is . xslt_errno($xh); } xslt_free($xh); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML vs Everything Else
Javier Montserat wrote: 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 http://www.devshed.com/Server_Side/XML http://www.xml.com (look for the essentials articles on the left) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML doubt
Rodrigo Dominguez wrote: I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects. I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP. Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it? Thank you. 1. Convert sql queries into xml (I'm glad to send a copy of my class if you'd like) basically its: A. Loop over query as you normally would B. Loop through each column in a record for a query and make an xml compatible string like: record fieldname value /fieldname /record 2. Then just follow the xslt section of the php manual it's pretty straight forward Give it a shot, if you have trouble send specific questions to the list I and quite a few other will be glad to help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML doubt
Forgot a step: (1C) make an xslt stylesheet which is basically just a beefed-up html page. Check out devshed.cm xml.com and w3c.org for info on xslt stlyesheets Geoff Hankerson wrote: Rodrigo Dominguez wrote: I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects. I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP. Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it? Thank you. 1. Convert sql queries into xml (I'm glad to send a copy of my class if you'd like) basically its: A. Loop over query as you normally would B. Loop through each column in a record for a query and make an xml compatible string like: record fieldname value /fieldname /record 2. Then just follow the xslt section of the php manual it's pretty straight forward Give it a shot, if you have trouble send specific questions to the list I and quite a few other will be glad to help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Dan Ostrowski wrote: I develop mostly in a Linux environment anymore, but I have a problem with Netscape and PHP. Well, not so much with PHP but developing it with Netscape. Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? regards, dan Netscape 4xx is in many respects a difficult browser because it is not standards compliant and is bug-ridden. Many developers wish people would stop using it. Use Mozilla instead during development and check and just use Netscape 4xx as one of the browsers you test your site with -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML vs Everything Else
Can anyone direct me to a page with xml in use? Something that can help me grasp what its all about. I didn't understand xml at all until I started using it . I asked pretty much the same question as you (what is it good for?). Now I will almost always use xml in any app I work on. One application that is simply wonderful is xsl transformations. This allows you to take xml and transform it into html, wml, pdf, rtf , etc... What this ultimately means to me is seperation of presentation from logic and data which makes for a very flexible and easy to maintain application. I have made a php class to make a database query into xml in the form of: recordfieldname value /fieldname/record Now stuff I used to do that took a whole page to code nows uses about 5 lines. This is a real world benefit for me. Spend some time learning about xml and you won't regret it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forms into database and visa versa
depending on your needs you could just create a .csv file (comma seperated text) that excel can read easily - Original Message - From: Dennis Gearon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 17, 2002 11:13 AM Subject: [PHP] forms into database and visa versa ***_PLEASE CC me as I am on digest_*** Anyone have a link or links to how to definitively make safe inserts to databases with form information? I'm thinking this has to do with add/remove slashes. BUT, I also think that it might be a good idea to write a function that adds slashes to all SQL words, (and make its converse function as well) Maybe a pointer to all the possible exploits would be a way to learn what to do to avoid them? :-) -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ -- 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] Q:Anybody using PHP directly on Mac-OSX???
This will just start Apache if I remember correctly. You still have to alter the httpd.conf file. Details for MacOSX php setup are here: http://www.macdevcenter.com/pub/ct/49 php is covered in part III - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: Marcus James Christian [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, May 17, 2002 1:13 PM Subject: Re: [PHP] Q:Anybody using PHP directly on Mac-OSX??? On Fri, 17 May 2002, Marcus James Christian wrote: I love PHP but I haven't gotten deep into it because of the issue of needed to upload it to my hosts server to test it. I'd love to get REALLY good with PHP, advanced shopping cart stuff, DB etc. but I just know the way my mind works and unless its a simple one click to test it on my desktop, well you know. So, anybody out there have PHP installed on their local home desktop Mac OSX box able to test by a quick preview in browser from say an app like BBedit? It comes ready-to-go. Just go to System Preferences, turn on Web Sharing (under Sharing), and you're running. Stick the pages in your Sites folder. miguel -- 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] Add FTP user via PHP?
Could you write the user info to a file and have a cron job parse the file and add them as a user? - Original Message - From: Shane McBride [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 9:43 AM Subject: [PHP] Add FTP user via PHP? Is there a way to add an ftp user and assign them to a directory when the host server does not and will not load the ftp module? Shane McBride RDI Technologies www.rditech.net Office: 410-575-6326 Fax:410-575-6327 -- 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] MSSQL help w/ auto_increment
I believe the auto increment field has to be set as the primary key as well. - Original Message - From: David Orn Johannsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 10:04 AM Subject: [PHP] MSSQL help w/ auto_increment I'm having a problem wiht creating a db in MSSQL, I've only used Mysql be for so I tryed the syntax just the same way. I'm trying to execute this code: create table test ( news_id int not null auto_increment , title varchar(50) not null , ndate varchar(50) not null , headline varchar(150) not null , fullarticle text not null , lang varchar(50) not null , PRIMARY KEY(news_id)) But it gives me an error on the auto_increment, which I assume is wrong for MSSQL, I've been searching the web for any results regarding to this problem of mine without any luck so I hope you can find it in your heart to help me if you can :) Thaks for your time http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php/Pdf application
I am wondering if one or more of you can point me in the right direction on this one. Our company has intellectual property (legal forms) that is in the form of a pdf. We want to sell this over the Web but a regular pdf is not secure and it would allow users to make unlimited copies and have unlimited use. I know Adobe gives you the ability to assign a password to a PDF so it cannot be altered but I don't think this will suffice. We need to either: 1. Let the user print the PDF from the browser without displaying it to the screen (not sure this is feasible) or 2. Do a server side mail-merge without using Acrobat form fields. Just looking for a pointer in the right direction. Thanks in advance for any and all help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP to access an AS 400 database
Any way to use ODBC?? Just a thought - Original Message - From: Rance Hall [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 01, 2002 8:37 AM Subject: [PHP] Using PHP to access an AS 400 database I'd like to find a way to get my PHP driven web site to connect to an AS 400 database The machine that is running php does have client access to the AS 400. I'm trying to port some old MS Excel spreadsheets over to our intranet.. any thoughts much appreciated. Rance Rance Hall 308.238.2455 Internal Office Extensions: 2455 or 6655 PC Programmer, The Buckle, Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Temporary MySQL Tables
Couldn't you just use substr_replace and the html endcoding for a double quote (#34;) ? ?php echo input type=\hidden\ name=\name\ value=\ . substr_replace($name, '/', #34;). \; ? - Original Message - From: Georgie Casey [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, March 21, 2002 2:09 PM Subject: [PHP] Temporary MySQL Tables Hi, On my site now, there's a lengthy register process where the user has to fill in 5 forms, one after the another. I get the PHP script to echo the values from the previous into the next form by using ?php echo input type=\hidden\ name=\name\ value=\ . $name . \; ? for example. Then I keep carrying the information over to each extra form until the user reaches the last page and I insert all the info into a table called tempmembers with an extra timestamp field which I use to verify email addresses. The user gets an email saying click here to verify your membership with the username and timestamp in the URL. The users clicks it, and I run a SQL command that copies the row from tempmembers into the members table. This process worked well for a while until I discovered if users enter a single or double quote into any of the fields, it fecks everything up. So I added an addslashes command but it's all getting a bit hairy so I was looking for some advice on MySQL temporary tables for either using after every form or at the end of all the forms. Or does anyone have any other method I could use??? Thanks for any help you might have. -- 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] Mac Classic and PHP...
I would worry about the hard drive failing on an old Mac. (This just happened to me on an old 7300/180 and a bondi iMac at work). The older macs use scsi hard drves that are hard to find and next to impossible to find new. At least with a 7300 it has 3 pci slots and you can put an IDE controller in one of the slots which will let you pick up a cheap IDE drive as a replacement. That might be tough to do on a 5400. - Original Message - From: Erik Price [EMAIL PROTECTED] To: Chuck PUP Payne [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 8:21 AM Subject: Re: [PHP] Mac Classic and PHP... On Monday, March 18, 2002, at 06:01 PM, Chuck PUP Payne wrote: The guy paid $6000 for this Mac, and the guy doesn't want to even hear new hardware. So it doesn't matter I am talk to a wall. ... I am dealing with just cheap people. So again thanks for all the comments and info. Good luck, then. The fact of the matter is that computers sometimes do eventually need to be replaced, and yes this means more money. Like cars. If they don't want to put Linux on the computer they already have, which is like recycling a Ford Festiva into a Land Rover Defender, then the $150 offer you made them seems like the best thing they could do. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Classic and PHP...
Also remember you can pick up a brand new Dell 1.6 ghz P4 w/ 17 inch monitor for under $700. Then you can run php/apache on Windows if you want (check out the easy installer at www.nusphere.com) or any number of Linux or BSD variants. If your set on a Mac you can pick up a new previous generation iMac (G3) for about $700 as well and run all this on MacOSX. iMacs can make a decent server in the right situation because of the integrated monitor. - Original Message - From: Erik Price [EMAIL PROTECTED] To: Chuck PUP Payne [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 8:21 AM Subject: Re: [PHP] Mac Classic and PHP... On Monday, March 18, 2002, at 06:01 PM, Chuck PUP Payne wrote: The guy paid $6000 for this Mac, and the guy doesn't want to even hear new hardware. So it doesn't matter I am talk to a wall. ... I am dealing with just cheap people. So again thanks for all the comments and info. Good luck, then. The fact of the matter is that computers sometimes do eventually need to be replaced, and yes this means more money. Like cars. If they don't want to put Linux on the computer they already have, which is like recycling a Ford Festiva into a Land Rover Defender, then the $150 offer you made them seems like the best thing they could do. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Classic and PHP...
Well would you be so kind as to share your knowledge of where to pick up scsi drives. Remember these are old Mac compatible scsi drives 50 pin or something like that. - Original Message - From: Alnisa Allgood [EMAIL PROTECTED] To: Geoff Hankerson [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 9:22 AM Subject: Re: [PHP] Mac Classic and PHP... At 8:48 AM -0600 3/19/02, Geoff Hankerson wrote: I would worry about the hard drive failing on an old Mac. (This just happened to me on an old 7300/180 and a bondi iMac at work). The older macs use scsi hard drves that are hard to find and next to impossible to find new. At least with a 7300 it has 3 pci slots and you can put an IDE controller in one of the slots which will let you pick up a cheap IDE drive as a replacement. That might be tough to do on a 5400. Wow, you find SCSI hard to find? I find it as easy as IDE to find, it's just more expensive. A -- . Alnisa Allgood Executive Director Nonprofit Tech (ph) 415.337.7412 (fx) 415.337.7927 (url) http://www.nonprofit-techworld.org (url) http://www.nonprofit-tech.org (url) http://www.tech-library.org . Nonprofit Tech E-Update mailto:[EMAIL PROTECTED] . transforming nonprofits through technology . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare.
Here is an easy one click install you can download for free http://www.nusphere.com/ (click download -- you have to register first) It puts Apache, MySQL, php and perl all in the right places for you. - Original Message - From: Chuck PUP Payne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 1:12 PM Subject: [PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare. Ok, I am back. My client has gone bought Wintel box, running XP. I have downloaded and install Apache, Mysql, and PHP 4. But because 4 is a zip, I have read the install.txt and have set up the httpd.conf but when I got to check if php is working, I can see the inside of the file ? PHPINFO(); ? I have look on a couple site I have everything set. Is there an easy way, my God Linux and Mac is simpler than this. Chuck Payne Magi Design and Support. -- 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] Return the column names of MySQL table?
I believe it is: describe tablename; - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 4:43 PM Subject: [PHP] Return the column names of MySQL table? Forgive me for the off topic question. This is a MySQL question.. has nothing to do with PHP directly. However I was not able to find an answer in the MySQL documentation, on Usenet, or the MySQL mailing list archives. Also MySQL.com's mail manager is on the fritz so I can't even subscribe to the MySQL email list. Anyway since many of you are familiar with SQL this is as good a place to ask this question as any. I simply need to return a list of column names of a MySQL table. What's the syntax to do that? Thanks, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php