[PHP] Creating PDF from a Image
Hi All, To create fdf with text info is very simple but I am wondering how to convert a PNG image into pdf file? Any suggestion? Regards, Manoj
Re: [PHP] Re: Template style question
Torgny Bjers wrote: Petr Smith wrote: Smarty sucks. Mixing presentation and logic is never good idea. I know Smarty is very popular, but big popularity doesn't always mean quality. Back to original question: If you decided to reinvent the wheel, please don't reinvent square wheel without tire. Mixing presentation and logic is bad. You should have no sqls, loops, ifs or any other logic things in templates. Templates should be editable by any stupid guy, anyone who knows just css/html. No sql, no php, no other language. Back to original idea to parse table. Do not copy bad ideas from other templating engines. Again - reinvent a better wheel or use some from 1000s of existing libraries. Download some existing libraries, think about good and bad things, make it better, make it different! Otherwise we will end with 1000+1 stupid, same, useless templating libraries. You don't need to mix presentation and logic with Smarty. If you create your custom tags with Smarty and use these instead of having the inline Smarty PHP code, you'll have separated them just fine. Then if the end user wants to use PHP inline, fine, either let them, or don't. Either way, Smarty is about the fastest and most versatile engine in the PEAR library, as far as I know. I'd rather use that, than build something custom from scratch. And, in combination with Tidy and Cache_Lite, you'll get a very fast and precise rendering engine... Just my $0.02. I agree with Petr!! Smarty is very good and the designer has to learn a few smarty tags and Walla! you've got your templates working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating PDF from a Image
There doesn't seem to be any function to add an image to an FDF document, but since an FDF is just a PDF file, you might be able to create a hack using a PDF generation library. I've used FPDF for generating PDF's in the past. http://www.fpdf.org Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Hi All, To create fdf with text info is very simple but I am wondering how to convert a PNG image into pdf file? Any suggestion? Regards, Manoj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: italic, bold and underline with GD ?
David wrote: Can we use some function with GD to make text italic, bold and/or underline? http://php.net/imagettftext I see we can change size and font, but not style it's not possible in PHP? Thanks in advance David I'm not familiar with GD, but as every good font has different versions for bold, italic and so on, you might use those versions with separate font files. And since underlining is just a simple line (don't know how this works in GD, I've done this in FPDF) I would just draw a line from the beginning of the word to the end ... if it is possible in GD to get the current cursor position before and after inserting text. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Making functions available from another script
Richard Leclair wrote: Hi PHP-ers, Here's an easy one: Q: How can I make a function available from within another php script? Eg. B.php contains: ?php include .../fns.php ? Which has a function fn($x); Later on, I want to include this function in B.php somewhere. In short: B.php wants to use fn($x) found in A.php. Regards, Richie ! I'm not quite sure if I did get your question right, but you answered the question yourself. include(anyfile.php); does nothing more then copy the code of anyfile.php to the file, in which it is called. anyfile.php is interpreted as HTML, so you should have your ?php brackets around the document. A.php--- function foo($bar) { //do sth } B.php--- include[_once](A.php); $x = anything you like; $whatever = foo($x); this works if A and B are in exactly the same directory, otherwise you should change the path for the include call. Did I get your question right? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating PDF from a Image
Dear Pranav, Thanks! I would like to do something like this: ABC.PNG -- (CONVERT USING ANY PHP LIBRARY)-ABC.PDF abc.pdf should be Press optimized pdf. Press optimized is the somewhat high level of pdf format. Your suggestions are hightly appreciated. Thanks Regards, Manoj - Original Message - From: Pranav Negandhi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 1:55 PM Subject: Re: [PHP] Creating PDF from a Image There doesn't seem to be any function to add an image to an FDF document, but since an FDF is just a PDF file, you might be able to create a hack using a PDF generation library. I've used FPDF for generating PDF's in the past. http://www.fpdf.org Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Hi All, To create fdf with text info is very simple but I am wondering how to convert a PNG image into pdf file? Any suggestion? Regards, Manoj -- 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] Creating PDF from a Image
You're sure to find a working example on the fpdf site, that uses images. Check here http://www.fpdf.org/en/tutorial/index.php If you have the resources, PDFLib is a commercial component that makes your work a lot easier. http://www.pdflib.com/ Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Dear Pranav, Thanks! I would like to do something like this: ABC.PNG -- (CONVERT USING ANY PHP LIBRARY)-ABC.PDF abc.pdf should be Press optimized pdf. Press optimized is the somewhat high level of pdf format. Your suggestions are hightly appreciated. Thanks Regards, Manoj - Original Message - From: Pranav Negandhi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 1:55 PM Subject: Re: [PHP] Creating PDF from a Image There doesn't seem to be any function to add an image to an FDF document, but since an FDF is just a PDF file, you might be able to create a hack using a PDF generation library. I've used FPDF for generating PDF's in the past. http://www.fpdf.org Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Hi All, To create fdf with text info is very simple but I am wondering how to convert a PNG image into pdf file? Any suggestion? Regards, Manoj -- 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: Making functions available from another script
Hi Norbert, Thanks for your reply. Yeah, you were almost there - it wasn't quite what I had in mind. I probably should have elaborated on this one. I'm looking at building up a library of handy functions that can be included in a current script. Only problem is: (let's just say for clarity that lib.php == A.php; same).. If I declare the functions in lib.php, then B.php can include lib.php but cannot execute any functions within B.php (that were declared in lib.php). it keeps coming up as function undeclared. Any more ideas/thoughts? Or have I not gone about this correctly? Regards, Richie ! -Original Message- From: Norbert Wenzel [mailto:[EMAIL PROTECTED] Sent: Monday, 7 November 2005 5:13 pm To: php-general@lists.php.net; Richard Leclair Cc: php-general@lists.php.net Subject: [PHP] Re: Making functions available from another script Richard Leclair wrote: Hi PHP-ers, Here's an easy one: Q: How can I make a function available from within another php script? Eg. B.php contains: ?php include .../fns.php ? Which has a function fn($x); Later on, I want to include this function in B.php somewhere. In short: B.php wants to use fn($x) found in A.php. Regards, Richie ! I'm not quite sure if I did get your question right, but you answered the question yourself. include(anyfile.php); does nothing more then copy the code of anyfile.php to the file, in which it is called. anyfile.php is interpreted as HTML, so you should have your ?php brackets around the document. A.php--- function foo($bar) { //do sth } B.php--- include[_once](A.php); $x = anything you like; $whatever = foo($x); this works if A and B are in exactly the same directory, otherwise you should change the path for the include call. Did I get your question right? -- 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: Making functions available from another script
Richard Leclair wrote: Hi Norbert, Thanks for your reply. Yeah, you were almost there - it wasn't quite what I had in mind. I probably should have elaborated on this one. I'm looking at building up a library of handy functions that can be included in a current script. Only problem is: (let's just say for clarity that lib.php == A.php; same).. If I declare the functions in lib.php, then B.php can include lib.php but cannot execute any functions within B.php (that were declared in lib.php). it keeps coming up as function undeclared. Any more ideas/thoughts? Or have I not gone about this correctly? Maybe post your lib.php and B.php, but from your description I have no idea what might cause this problem. For testing maybe change your lib.php to sth like this ---lib.php codeincluded lib.php/code ?php echo('lib.php works'); //let your code follow here ? Norbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Making functions available from another script
If it was working properly the function would be callable. Your include is probably not working - change it to require and see if you get an error. Using include doesn't give you an error if the include file is not found. Arno DotContent Professional Content Management Solutions www.dotcontent.net -Original Message- From: Richard Leclair [mailto:[EMAIL PROTECTED] Sent: 07 November 2005 11:33 To: 'Norbert Wenzel' Cc: php-general@lists.php.net Subject: RE: [PHP] Re: Making functions available from another script Hi Norbert, Thanks for your reply. Yeah, you were almost there - it wasn't quite what I had in mind. I probably should have elaborated on this one. I'm looking at building up a library of handy functions that can be included in a current script. Only problem is: (let's just say for clarity that lib.php == A.php; same).. If I declare the functions in lib.php, then B.php can include lib.php but cannot execute any functions within B.php (that were declared in lib.php). it keeps coming up as function undeclared. Any more ideas/thoughts? Or have I not gone about this correctly? Regards, Richie ! -Original Message- From: Norbert Wenzel [mailto:[EMAIL PROTECTED] Sent: Monday, 7 November 2005 5:13 pm To: php-general@lists.php.net; Richard Leclair Cc: php-general@lists.php.net Subject: [PHP] Re: Making functions available from another script Richard Leclair wrote: Hi PHP-ers, Here's an easy one: Q: How can I make a function available from within another php script? Eg. B.php contains: ?php include .../fns.php ? Which has a function fn($x); Later on, I want to include this function in B.php somewhere. In short: B.php wants to use fn($x) found in A.php. Regards, Richie ! I'm not quite sure if I did get your question right, but you answered the question yourself. include(anyfile.php); does nothing more then copy the code of anyfile.php to the file, in which it is called. anyfile.php is interpreted as HTML, so you should have your ?php brackets around the document. A.php--- function foo($bar) { //do sth } B.php--- include[_once](A.php); $x = anything you like; $whatever = foo($x); this works if A and B are in exactly the same directory, otherwise you should change the path for the include call. Did I get your question right? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating PDF from a Image
Hi Pranav, Thanks for reply and it really helped me a lot. Now I have one more issue: - PNG doesn't support CMYK color scheme and that is supported by JPEG so I need to convert it to JPEG and then JPEG back to Press optimized pdf. I 've only PNG as input. Is there any method that can help me to convert PNG to JPEG and then create PDF to that. Thanks.. Regards, Manoj - Original Message - From: Pranav Negandhi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 2:48 PM Subject: Re: [PHP] Creating PDF from a Image You're sure to find a working example on the fpdf site, that uses images. Check here http://www.fpdf.org/en/tutorial/index.php If you have the resources, PDFLib is a commercial component that makes your work a lot easier. http://www.pdflib.com/ Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Dear Pranav, Thanks! I would like to do something like this: ABC.PNG -- (CONVERT USING ANY PHP LIBRARY)-ABC.PDF abc.pdf should be Press optimized pdf. Press optimized is the somewhat high level of pdf format. Your suggestions are hightly appreciated. Thanks Regards, Manoj - Original Message - From: Pranav Negandhi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 1:55 PM Subject: Re: [PHP] Creating PDF from a Image There doesn't seem to be any function to add an image to an FDF document, but since an FDF is just a PDF file, you might be able to create a hack using a PDF generation library. I've used FPDF for generating PDF's in the past. http://www.fpdf.org Regards, Pranav www.concept-i.co.in Manoj Kr. Sheoran wrote: Hi All, To create fdf with text info is very simple but I am wondering how to convert a PNG image into pdf file? Any suggestion? Regards, Manoj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Catch the WMV first frame picture in PHP script?
Hello: I'm try to design WMV movie upload system im my school. when teachers upload the wmv movie to the web , I hope I can grab the first frame picture of wmv and save it to a jpeg file. Dose any one do that before ? Is is difficult to implement in PHP ? (I'm in the Linux with Apache PHP MySQL) Thanks for any helps. --- Fongming from Taiwan. ___ 郔陔唳 Yahoo!✽藻撈�r籵�� 7.0 betaㄛ轎愐鋒繚¦斕湖ㄐ http://messenger.yahoo.com.tw/beta.html
Re: [PHP] Mcrypt 3DES encrypt/decrypt Help
I've never used the mcrypt functions, but from a quick read of the documentation I think you are using a 384 bit key!... Each letter in your key string is a 8bit ASCII character, and since you have 48 chars, you have 8*48 bits. The documentation says: Key is the key with which the data will be encrypted. If it's smaller that the required keysize, it is padded with '\0'. It is better not to use ASCII strings for keys. It is recommended to use the mhash functions to create a key from a string. and gives the example: $key = This is a very secret key; In that example the key is 25 bytes long, therefore 200 bits long, and then padded with \0s. If you want your key to represent the hex of the key then I believe you must use pack(), or one of the user comments on the bin2hex() help page (namely the hexbin() function). Hope this helps Andrew - Original Message - From: [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 4:56 AM Subject: [PHP] Mcrypt 3DES encrypt/decrypt Help Hi all: I wan't to use php_mcrpyt to encrypt data,but have a problem in it ! Hint: Warning: mcrypt_encrypt(): Size of key is too large for this algorithm Algorithm : 3DES Key: 48bit ?php // Designate string to be encrypted $string =3D Applied Cryptography, by Bruce Schneier, is a wonderful cryptography reference.; // Encryption/decryption key $key =3D C770634F437346D7FC8FA22F9287849E741A33438EEDEAAD; // Encryption Algorithm $cipher_alg =3D MCRYPT_3DES; // Create the initialization vector for added security. $iv =3D mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND); // Output original string print Original string: $string ; // Encrypt $string $encrypted_string =3D mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_CBC, $iv); // Convert to hexadecimal and output to browser print Encrypted string: .bin2hex($encrypted_string). ; $decrypted_string =3D mcrypt_decrypt($cipher_alg, $key, $encrypted_string, MCRYPT_MODE_CBC, $iv); print Decrypted string: $decrypted_string; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Making functions available from another script
DOH!! Okay, I've sorted out the [my] problem... Instead of just doing the include relatively, I tried including it via the full URL, ie. ?php include(http://$_SERVER[HTTP_HOST]/lib.php;); ? I guess it just includes output of the result of this typical HTTP parse. By just doing ?php include(./lib.php); ?, everything works fine. (Providing of course that the two files exist in the same directory.) --- If you're interested, this is what I used to test it with: lib.php: ?php function doit($s) { return done: $s\n; } function listem($s) { print 1 $s, 2 . $s. s, lots of .$s.s.\n; } ? A.php: -- ?php include http://$_SERVER[HTTP_HOST]/lib.php; ? HTML BODY H1Something basic/H1 H2Let's do stuff:/H2 ?php $todo = doit(put out the garbage.); $todo .= doit(pay the mower guy.); $todo .= doit(finish that letter.); $todo .= doit(take a break.); print PRE\n$todo/PRE\n; ? /BODY /HTML --- Original included produced an undefined call to function doit(). Regards, Richie ! -Original Message- From: Arno Kuhl [mailto:[EMAIL PROTECTED] Sent: Monday, 7 November 2005 5:58 pm To: php-general@lists.php.net Subject: RE: [PHP] Re: Making functions available from another script If it was working properly the function would be callable. Your include is probably not working - change it to require and see if you get an error. Using include doesn't give you an error if the include file is not found. Arno DotContent Professional Content Management Solutions www.dotcontent.net -Original Message- From: Richard Leclair [mailto:[EMAIL PROTECTED] Sent: 07 November 2005 11:33 To: 'Norbert Wenzel' Cc: php-general@lists.php.net Subject: RE: [PHP] Re: Making functions available from another script Hi Norbert, Thanks for your reply. Yeah, you were almost there - it wasn't quite what I had in mind. I probably should have elaborated on this one. I'm looking at building up a library of handy functions that can be included in a current script. Only problem is: (let's just say for clarity that lib.php == A.php; same).. If I declare the functions in lib.php, then B.php can include lib.php but cannot execute any functions within B.php (that were declared in lib.php). it keeps coming up as function undeclared. Any more ideas/thoughts? Or have I not gone about this correctly? Regards, Richie ! -Original Message- From: Norbert Wenzel [mailto:[EMAIL PROTECTED] Sent: Monday, 7 November 2005 5:13 pm To: php-general@lists.php.net; Richard Leclair Cc: php-general@lists.php.net Subject: [PHP] Re: Making functions available from another script Richard Leclair wrote: Hi PHP-ers, Here's an easy one: Q: How can I make a function available from within another php script? Eg. B.php contains: ?php include .../fns.php ? Which has a function fn($x); Later on, I want to include this function in B.php somewhere. In short: B.php wants to use fn($x) found in A.php. Regards, Richie ! I'm not quite sure if I did get your question right, but you answered the question yourself. include(anyfile.php); does nothing more then copy the code of anyfile.php to the file, in which it is called. anyfile.php is interpreted as HTML, so you should have your ?php brackets around the document. A.php--- function foo($bar) { //do sth } B.php--- include[_once](A.php); $x = anything you like; $whatever = foo($x); this works if A and B are in exactly the same directory, otherwise you should change the path for the include call. Did I get your question right? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: No forums?
Wow, go away for a few days and holy war breaks out...cool! Why not one system that supports both without extra work? The model I'm thinking of is Google or Yahoo groups(*). You can access any 'forum' via a web browser, search, post, reply, etc AND/OR you can subscribe to any forum and get messages sent to you via email (individual or digest format). At work, I sit behind a firewall and web access involves a multi-stop PITA process so listerservers work well for me there. At home, forum access is easier since I can go to the forum site, decide what I want to read and/or respond to without cluttering up my email client. Doug (*) - I am NOT suggesting this forum be configured like Yahoo, the search function absolutely sucks and I'm not a real fan of the layout, but the concept of a forum that's a list that's a forum...is what I like. For what it's worth, Yahoo has not PHP groups I can find but there are 33 over at Google with 100 - 1000 members. ___ This e-mail message has been sent by Kollsman, Inc. and is for the use of the intended recipients only. The message may contain privileged or confidential information. If you are not the intended recipient you are hereby notified that any use, distribution or copying of this communication is strictly prohibited, and you are requested to delete the e-mail and any attachments and notify the sender immediately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating PDF from a Image
Manoj Kr. Sheoran schrieb: I 've only PNG as input. Is there any method that can help me to convert PNG to JPEG and then create PDF to that. PNG and press-ready PDF isn't anything that fits together very well from the view of a prepress professional, but your way would be ImageMagick (http://www.imagemagick.org), which should be able to convert from PNG to PDF (with the help of Ghostscript). Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
[snip] Currently, the universe is the way it is and, many believe, it works just fine. Why should we do anything at all? [/snip] Because we have no control over the existance and operation of the universe. If we did we would have changed it already. Our profound lack of understanding of the operation of the universe, even with leaders such as Bohr, Einstein, Feynman, and others prevent us from being able to exert any control. There are several PHP forums out there, just none on php.net. Bandwidth might be a consideration. Administrative workload might be another (you have noticed that there really isn't a list mod here -- although I was nominated for the position last week) and the workload for a forum could be several orders of magnitude higher, which I know from past experience. The thing that offended some, Roman, was your attitude in the post, as if you did not know that already. There are several good PHP based boards out there and the lack of one on php.net does not indicate any distaste for forums, and from the absence of a forum we cannot deduce anything at all (proper logic applied) any more than we can deduce something from your not owning a television set. The possibilities are too open ended. Furthermore, if you knew all of the potential replies (which you did not, even though you claimed to) why even open your e-mail editor (which you did) which, based on the discourse, we could assume that you have a distaste for? This thread is useless at this point to PHP and helping people solve their PHP issues. May we end it here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 5.1 release ?
On 07 November 2005 00:51, Dan Rossi wrote: Hi there just wondering when there may be a php 5.1 release ? I just went into the downloads on the php site and the link to RC1 has been removed ?? Current Release candidate is 5.1.0RC4,so I guess RC1 was removed as too out of date. Last I saw, target release date was end of this week. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating PDF from a Image
Hi, Jens! Thanks!. PNG doen't support CMYK color scheme that's why I want to convert it in JPG first and then I want to create pdf file from that PJG file. I created pdf file from PJG using fpdf but no idea that how to I convert PNG to jpg file (not using any third part tool only uing php). Secondly, My motive is to create Press optimized pdf file rather than simple pdf file. Thanks for help and looking for suggestion. Regards, Manoj - Original Message - From: Jens Schulze [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, November 07, 2005 8:14 PM Subject: Re: [PHP] Creating PDF from a Image Manoj Kr. Sheoran schrieb: I 've only PNG as input. Is there any method that can help me to convert PNG to JPEG and then create PDF to that. PNG and press-ready PDF isn't anything that fits together very well from the view of a prepress professional, but your way would be ImageMagick (http://www.imagemagick.org), which should be able to convert from PNG to PDF (with the help of Ghostscript). Jens -- 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] off
sorry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OFF, do not open
OFf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form question??
hi... a while ago, i saw an app that allowed the user to create a form, based on various fields, and to setup/create the database schema to create the form. the app provided the user with predefined fields, as well as allowed the user to define their own fields in order to create the form. unfortunately, i can't seem to find this app, or any other app that would allow me to do this. can anybody point me towards an app that could/would do this? thanks -bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form question??
I wrote a xsl stylesheet to do this. takes the xml and whips it up, into a standard layout. Don't believe I mentioned this but I might have at some point. Register example: formData formTitle=Register action=/ method=post captionThank you for Registering!/caption fields field type=hidden var=register default=yes/ field type=text title=Login name var=name required=yes len=50 maxlength=50/ field type=password title=Password var=passwd required=yes len=50/ field type=text title=E-Mail var=email required=no len=50/ field type=checkbox title=Show Email var=Show Email required=no default=yes/ field type=submit title=Register / /fields /formData On Monday 07 November 2005 12:24 pm, bruce wrote: hi... a while ago, i saw an app that allowed the user to create a form, based on various fields, and to setup/create the database schema to create the form. the app provided the user with predefined fields, as well as allowed the user to define their own fields in order to create the form. unfortunately, i can't seem to find this app, or any other app that would allow me to do this. can anybody point me towards an app that could/would do this? thanks -bruce [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FileExists?
Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
Gustav Wiberg wrote: Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) what errors are you getting? what is $x? ??? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FileExists?
[snip] File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) [/snip] What version of PHP are you using. With anything less than PHP5 you cannot use file_exists on anything other than the file system PHP is local to. All versions of PHP. Explicitly using file:// since PHP 4.3.0 /path/to/file.ext relative/path/to/file.ext fileInCwd.ext C:/path/to/winfile.ext C:\path\to\winfile.ext \\smbserver\share\path\to\winfile.ext file:///path/to/file.ext file:// is the default wrapper used with PHP and represents the local filesystem. When a relative path is specified (a path which does not begin with /, \, \\, or a windows drive letter) the path provided will be applied against the current working directory. In many cases this is the directory in which the script resides unless it has been changed. Using the CLI sapi, this defaults to the directory from which the script was called. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
- Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Gustav Wiberg' [EMAIL PROTECTED]; PHP General php-general@lists.php.net Sent: Monday, November 07, 2005 9:02 PM Subject: RE: [PHP] FileExists? [snip] File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) [/snip] What version of PHP are you using. With anything less than PHP5 you cannot use file_exists on anything other than the file system PHP is local to. All versions of PHP. Explicitly using file:// since PHP 4.3.0 /path/to/file.ext relative/path/to/file.ext fileInCwd.ext C:/path/to/winfile.ext C:\path\to\winfile.ext \\smbserver\share\path\to\winfile.ext file:///path/to/file.ext file:// is the default wrapper used with PHP and represents the local filesystem. When a relative path is specified (a path which does not begin with /, \, \\, or a windows drive letter) the path provided will be applied against the current working directory. In many cases this is the directory in which the script resides unless it has been changed. Using the CLI sapi, this defaults to the directory from which the script was called. Hi I'm using PHP 4.3.0. Thanx! :-) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
On Mon, 2005-11-07 at 20:45 +0100, Gustav Wiberg wrote: Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) You are trying to check if a file pointer exists. You want to check if the file exists. Try: if( file_exists( http://www.stammis.com/getstart.php; ) ) -- Jasper Bryant-Greene General Manager Album Limited e: [EMAIL PROTECTED] w: http://www.album.co.nz/ b: http://jbg.name/ p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303 a: PO Box 579, Christchurch 8015, New Zealand -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
Gustav Wiberg wrote: $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) That wouldn't work on a normal file either. You should always try to reduce your problem to the simplest case. :-) http://php.net/file_exists The argument is a filename. Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: FileExists?
Read the manual, it clearly states the following:- Tip: As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix M for a listing of which wrappers support stat() family of functionality. Gustav Wiberg wrote: Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using the echo tag...
I'm relatively new at coding PHP but I was hoping someone can help me with this. I'm trying to write the following code into my program but each time it runs, I get an error message. Can anyone help? print EOF !-INSERT HTML HEADER HERE -- $_SERVER['PHP_SELF'] EOF; Say that was a part of a HTML Form action tag, everytime I try to run it, I get an error message am I doing something wrong or do I have to break out of the here document to use this syntax?
Re: [PHP] FileExists?
Gustav Wiberg wrote: Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) file_exists() takes filename as parameter, not file pointer. besides, spare the one http request and use @fopen() (@ will suppress eventual warning), it will speed up your script. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form question??
On Monday 07 November 2005 10:24, the author bruce contributed to the dialogue on- [PHP] form question??: hi... a while ago, i saw an app that allowed the user to create a form, based on various fields, and to setup/create the database schema to create the form. the app provided the user with predefined fields, as well as allowed the user to define their own fields in order to create the form. unfortunately, i can't seem to find this app, or any other app that would allow me to do this. can anybody point me towards an app that could/would do this? If you want something comprehensive and you happen to use Dreamweaver you can do what you need and you might also take a look at some of the extensions such as MX Kollection http://www.interaktonline.com or Web Assist www.webassist.com or many other extensions which would five you all you are likely to need. david -- 40 yrs navigating and computing in blue waters. English Owner Captain of British Registered 60' bluewater Ketch S/V Taurus. Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after completing engineroom refit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange pg_escape_string behavior
While using pg_escape_string to clean data being placed in a query sent to me by the user i get the following error after submitting the query with pg_execute: pg_exec(): Query failed: ERROR: invalid regular expression: invalid escape \ sequence . It seems to happen when using just a \ or text ending with a \ but not if a \ is in the middle of a string of text. Why doesn't pg_escape_string catch this? To restate it maybe a little more clearly, the error occurs when i do something like: (Pretend $_POST['user_item'] has the value car\ in it ) ?PHP $user_item = pg_escape_string($_POST['user_item']); $dbconn = pg_connect('some connection string that works'); $query = SELECT * FROM some_table WHERE some_col = '$user_item' ; $result = pg_execute($dbconn,$query); ? I'm running PHP Version 4.3.4, and Apache 1.3.29. -k. __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Creating PDF from a Image
Am Monday, November 7, 2005, 4:20:25 PM beglückte uns Manoj ([EMAIL PROTECTED]) mit folgendem Kommentar: PNG doen't support CMYK color scheme that's why I want to convert it in JPG first and then I want to create pdf file from that PJG file. I created pdf file from PJG using fpdf but no idea that how to I convert PNG to jpg file (not using any third part tool only uing php). If you don't want to use the formidable imagemagick package (where the conversion would be a one line bash command), you are out of look, I think, because the gdlib often packaged with php doesn't support cmyk jpeg files. External tool or nothing... ;-) Secondly, My motive is to create Press optimized pdf file rather than simple pdf file. As I said before, from my typesetting experience, PNG file format and press optimized PDF is something that don't fit together, a cmyk image isn't something that make a PDF press optimized, you have also look at the resolution of the images. If I create a file with a layout tool like Adobe InDesign with 72 dpi images and export it as press optimized PDF, even when the file is labeled press optimized, it's a pile of low quality crap from the prepress view of things. Maybe you should review your workflow. Jens -- This mail was scanned by AntiVir Milter. This product is licensed for non-commercial use. See www.antivir.de for details. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using the echo tag...
[snip] I'm relatively new at coding PHP but I was hoping someone can help me with this. I'm trying to write the following code into my program but each time it runs, I get an error message. Can anyone help? print EOF !-INSERT HTML HEADER HERE -- $_SERVER['PHP_SELF'] EOF; Say that was a part of a HTML Form action tag, everytime I try to run it, I get an error message am I doing something wrong or do I have to break out of the here document to use this syntax? [/snip] What's the error message you're getting? That will be most helpful in trying to diagnose the problem. Likely, though, is the fact that you're trying to output $_SERVER['PHP_SELF'] within your heredoc syntax, without wrapping it in curly braces. It should be: {$_SERVER['PHP_SELF']} See http://www.php.net/manual/en/language.types.string.php#language.types.st ring.syntax.heredoc for more info. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Security Issues - Where to look?
[snip] I've heard that php is not particularly secure, making it problematic if you intend to create a web site with commerce, etc. Is there a particular news group that addresses security issues? I'm looking for some guidlines on ensuring that my site is secure from malicious hackers. [/snip] It's not so much that PHP is not particularly secure, but rather that some of the people who use it don't know how to make it work in a secure manner. Configured and coded properly a PHP application can be very, very secure. However, without careful configuration and good coding it's also possible to create very, very insecure applications using PHP. Or .NET. Or Java. Or Cold Fusion. Or JSP. It's not the technology that's insecure, but the method by which it's implemented. Why not check out these links: http://www.google.ca/search?q=php+security http://www.devshed.com/c/a/PHP/PHP-Security-Mistakes/ http://phpsec.org/ Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security Issues - Where to look?
Hi Richard, Monday, November 7, 2005, 9:50:59 PM, you wrote: I've heard that php is not particularly secure, making it problematic if you intend to create a web site with commerce, etc. Is there a particular news group that addresses security issues? I'm looking for some guidlines on ensuring that my site is secure from malicious hackers. The security of the application will be ultimately down to two factors: you, and your hosting environment. Server security is beyond the scope of this mailing list, and is a multi-faceted and complex area. Shoring up your OS, Apache and the likes can take years of skill. Or of course, your sys admin / web host does this all for you. Even so, it's an area not to be ignored. You can write the most secure application in the world, but if you've gone and chmod 777'd your directories on a shared box, you're anyones target. The security of your application is down to you however. There is a PHP security mailing list, but it's more for announcements than discussion. As for guidelines there are many free on-line resources, and you'd do worse than to start here: http://phpsec.org/library/ The majority of those documents are aimed at experienced PHP developers however. And the majority of blatant security holes come from the inexperienced who weren't aware of what they were doing wrong in the first place. There are several books available on the subject now, any (or all) of them would give you the grounding you need to know BEFORE you start coding: Pro PHP Security by Snyder Southwell (Apress) php architect's Guide to PHP Security by Ilia Alshanetsky (Nanobooks) Essential PHP Security by Chris Shiflett (O'Reilly) Also some on-line talks: http://brainbulb.com/talks php architect magazine has a security column each month as well (www.phparch.com) There's a lot of reading material out there. Just make sure you read it _before_ you start building, it'll save you days, if not weeks, of code changes. Cheers, Rich -- Zend Certified Engineer PHP Development Services http://www.corephp.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using the echo tag...
* Paul Williams [EMAIL PROTECTED] [2005-11-07 12:31:17 -0500]: I'm trying to write the following code into my program but each time it runs, I get an error message. Can anyone help? print EOF !-INSERT HTML HEADER HERE -- $_SERVER['PHP_SELF'] EOF; You might want to read up on the heredoc syntax: http://php.net/heredoc Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
Gustav Wiberg wrote: - Original Message - From: M [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Monday, November 07, 2005 11:12 PM Subject: Re: [PHP] FileExists? Gustav Wiberg wrote: Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) file_exists() takes filename as parameter, not file pointer. besides, spare the one http request and use @fopen() (@ will suppress eventual warning), it will speed up your script. I tested to use @fopen instead of fopen and it took 1 second longer... I meant using: if(($x = @fopen('http://www.stammis.com/getstart.php')) !== false) { } instead of: if(file_exists('http://www.stammis.com/getstart.php')) { $x = fopen('http://www.stammis.com/getstart.php'); } And you need to check the speed more than once. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange pg_escape_string behavior
* -k. wrote: ... pg_exec(): Query failed: ERROR: invalid regular expression: invalid escape \ sequence . It seems to happen when using just a \ or text ending with a \ but not if a \ is in the middle of a string of text. I would guess you have magic_quote_gpc on, you can check this: var_dump(get_magic_quotes_gpc()); ... $user_item = pg_escape_string($_POST['user_item']); $dbconn = pg_connect('some connection string that works'); $query = SELECT * FROM some_table WHERE some_col = '$user_item' ; Try an: echo htmlentities($query); And you'll see the problem with the query. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using the echo tag...
you only need 3 On 11/7/05, Curt Zirzow [EMAIL PROTECTED] wrote: * Paul Williams [EMAIL PROTECTED] [2005-11-07 12:31:17 -0500]: I'm trying to write the following code into my program but each time it runs, I get an error message. Can anyone help? print EOF !-INSERT HTML HEADER HERE -- $_SERVER['PHP_SELF'] EOF; You might want to read up on the heredoc syntax: http://php.net/heredoc Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using the echo tag...
On Mon, Nov 07, 2005 at 09:40:23PM -0500, Unknown Unknown wrote: you only need 3 Indeed, as well as Pablo's guess of escaping an array within a heredoc, and i would guess as well that that space between his ' EOF' is invalid as well. Btw, you do realize your name is 'Unknown Unknown'? Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5 XML/XSL problem
Hi I've been using PHP 4 for the last year to do XSL transformations in one of my applications. It worked like a charm, we never had any problems. While I was investigating the feasability of moving to PHP 5, I discovered that for some reason, the exact same XML/XSL fails to transform properly. The relevant bit of XSL is below: xsl:param name=pageContext select=UNDEFINED / xsl:variable name=sections select=document('../xml/sections.xml') / xsl:variable name=targetID select=//[EMAIL PROTECTED] = $pageContext]/@id / xsl:variable name=targetFileSrc select=$sections/sections/[EMAIL PROTECTED] = $targetID] / xsl:variable name=targetFile xsl:choose xsl:when test=($targetFileSrc/sectionContentSrc = 'none') or (string-length($targetFileSrc/sectionContentSrc) = 0) xsl:copy-of select=document('../xml/default.xml') / /xsl:when xsl:otherwise xsl:copy-of select=document(concat('../xml/', $targetFileSrc/sectionContentSrc)) / /xsl:otherwise /xsl:choose /xsl:variable xsl:variable name=cornerImage select=$targetFile/content/headerContent/headerCornerImage / xsl:variable name=shadowImage select=$targetFile/content/headerContent/headerShadowImage / -- with some sample XML as follows: -- content headerContent headerCornerImagehome_nav_middle.gif/headerCornerImage headerShadowImagehome_nav_bottom.gif/headerShadowImage /headerContent /content I've checked and confirmed that pageContext gets properly initialised, that all the referenced documents exist and are well-formed, and that they contain the expected nodes. The error I get is evaluating variable 'cornerImage' failed, yet I cannot understand how this can be so. Apart from the fact that it worked perfectly fine in PHP 4, all the XML and XSL conforms to spec. Anyone have an idea? I'm using the PHP 5 DOM and XSL libraries to handle everything in my upgraded version of the code; the PHP 4 version used DOMXML and Sablotron. -- Pleochism: a moment of perfect beauty, between the before and the after. Mr Daniel Lowes Techteam Department of Computer Science Information Technology Building, 4-30 University of Pretoria http://www.cs.up.ac.za/ This message and attachments are subject to a disclaimer. Please refer to www.it.up.ac.za/documentation/governance/disclaimer/ for full details. Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule onderhewig. Volledige besonderhede is by www.it.up.ac.za/documentation/governance/disclaimer/ beskikbaar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php