Re: [PHP] Resampling images -- need lock ?
yeh. if u want it to be on server side that is a good approach. but i feel it'll be very easy to do it with javascript... but what i did not understand is: what should happen if the user clicks ROTATE second time(when the script completed rotating say 5 images)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resampling images -- need lock ?
then u'll b needing a lock (a shared resource like a SESSION var will do) even if u do it by javascript -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help me debug this
i find var_dump useful in these situations, and for error reporting try trigger error. http://php.net/manual/en/function.trigger-error.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unable to send mail from PHP to AT&T e-mail address
of u are sure that the mail was not received as spam... check the log files of the mail server on the server to be sure that the mail actually reached the mail server from the http server -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: checkboxes
yeh an onclick event handler is required to achieve this. but as Shawn has suggested radio buttons are better in this case. but then again if u want to disable/greyout the other input(like textboxes, other than the radio button itself) u'll hav to use onclick event handler for the radio buttons -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAIL Error
seems u r company mail server is adding this to all outgoing mails. if that is the case only option is to change configuration settings in the mail server. you can ask the anchorites to do that (i m not optimistic bout that, though). dont use this mail server to send mails to mailing lists Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: checkboxes
i find var_dump, trigger_error really useful in situations like these. just do var_dump($_POST); var_dump($_GET); in the action{.php} script and u'll find a good deal of useful information -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [php] embedding excel chart/graph
y specifically an excel chart ? see http://teethgrinder.co.uk/open-flash-chart/ Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [php] graph with two or more input display
http://pchart.sourceforge.net/documentation.php?topic=exemple8 but may be a 2-D graph will be more simpler to understand http://teethgrinder.co.uk/open-flash-chart/gallery-bar-4.php Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP mail server
if u cant change the configuration settings of php.ini use http://pear.php.net/package/Mail alternatively u can also hav ini_set on top of every page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP mail server
ini_set("SMTP", "mail.host.com"); ini_set("smtp_port", 25); http://ca2.php.net/manual/en/mail.configuration.php http://ca2.php.net/manual/en/function.ini-set.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Formating Numbers
pl post the desired result, the functions if u r trying to get $ 34,567.25 i dont understand y this is not working for u... http://php.net/manual/en/function.number-format.php#88486 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] inexplicable behaviour
if $Count1 is never referenced after this, then certainly this assignment operation is redundent. but assignment is not the ONLY operation of this statement. if u hav not noticed a post increment operator has been used which will affect the value of $Count as well, and this operation is required for the script to work. the script should work even if u replace $Count1 = $Count++; with $Count++; Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I detect an exception without using try/catch?
a POSSIBLE work round. see if u can use http://in2.php.net/manual/en/function.error-get-last.php or http://in2.php.net/manual/en/reserved.variables.phperrormsg.php but they are not working as expected with xdebug. use them in the __destruct function to check for an uncaught exception alternatively.. this approach is NOT RECOMMENDED. use it only if u run out of options keep the destructor empty. catch the exception and call a function to perform destruction and then unset the object. at the end of script, check if the object is set, call the function to perform destruction. (php dosent destroy the object if the exception is caught) Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] intval
Hi, var_dump($_POST['month'], intval($_POST['month']), $_POST['month'] == ((int)($_POST['month'])); var_dump($_POST['month'], intval($_POST['month']), $_POST['month'] == (intval($_POST['month']))); is giving me string(3) "Jan" int(0) bool(true) but i m expecting string(3) "Jan" int(0) bool(false) ny ideas y this is happening?? Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intval
thanks for the reply... just happened to see http://php.net/ternary which explains the above result i want to explicitly type cast all the numbers passed via post (by default they are strings) is_numeric() is a option, but it will not be possible to differentiate between int and float. $_POST['month'] !== (string)(int)$_POST['month'] this is exactly what i want... but wont this take up memory when used with array_walk_recursive() ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intval
k i ended up with this code its giving me array(5) { [0]=> int(1) [1]=> int(100) [2]=> float(100.1) [3]=> float(100.123) [4]=> &string(1) "a" } what does &string mean ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intval
if that is the case & should appear before all the other variables as well and. is giving me array(5) { [0]=> int(1) [1]=> int(100) [2]=> float(100.1) [3]=> float(100.123) [4]=> string(1) "a" } ny idea y this difference arises? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with PHP processing form checkboxes needed :-(
1. every time the form is submitted.. generate the list of all the check boxes which are checked and overwrite the previous value in the database. 2. get the list of all entries from the database see if the corresponding check box is checked.. if so leave it as it is, if not remove it... this depends much on the database implementation. obviously this is a one to many relationship. if i use a single field with coma separated values i prefer the former if i use a different table to store the relationships(one relation per row) i prefer the later. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reference variables
i have this script i am expecting Array ( [0] => 3 [1] => 2 ) Array ( [0] => 3 [1] => 2 ) while i m getting Array ( [0] => 1 [1] => 2 ) Array ( [0] => 3 [1] => 2 ) any ideas why this is happening?? or am i missing something..? the same is the case when i replace $a2[0] = 3; with $a1[0] = 3; $x = 3; Kranthi.
Re: [PHP] Re: reference variables
thank you for the reply. i had a small misunderstanding regarding variable reference...now its clear but.. the output of is array(1) { [0]=> &int(1) } while for it is int(1) can u tell me what & signifies here??
Re: [PHP] session.auto_start
1. If you do turn on session.auto_start then you cannot put objects into your sessions since the class definition has to be loaded before starting the session in order to recreate the objects in your session. but the official php manual suggests a workaround... http://in2.php.net/manual/en/intro.session.php 2. if u use session.auto_start u'll not be able to use named sessions. but since you have access to php.ini i dont think that will be much of a problem. 3. url may look messy if the client does not support cookies -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE
not related to SQl but u may want to look at http://php-ids.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM Source of Selection
http://www.jonasjohn.de/lab/htmlsql.htm ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fgets function for very large files
i accept the fact that PMA is full of security holes, and it should not be used on production server. but it does not mean that we can never use it on a development server probably you may have a bit of trouble while moving from development server to production server. but u can always export your database to an .sql file and import it into production server... but if u dont have access to mysql command line(which is the case in nearly all of the projects i worked on), PMA will probably be the only option...(unless u want to rewrite the entire PMA code.) and certainly http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/ is best option for file with > 5000 lines..(but you may hav to prefer PMA if mysql is not in your PATH env var) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] conditional classes
is this a bad practice? i want to create a database class, with a particular definition when server supports PDO and a different definition if the server does not comments please. Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] conditional classes
thanks for the comments, what i m planning to do is function _autoload($class) { if($class == 'Database') { if(class_exis('PDO') { include_once('Database_PDO.php'); } else { include_once('Database.php'); } } where in Database_PDO.php contains class Database extends PDO { } Database.php contains class Database { } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] General Web Development Editor/IDE
one of the most frequently asked question... assuming your platform is windows.. my recommendation is a combo of phpDesigner and CS4. phpDesigner is best IDE i hav seen till date (for PHP), but its not suited do ny CSS/HTML coding Notepad++ will be helpful to debug HTML errors(like closing tags and stuff) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fgets function for very large files
1. open that in a text editor 2. copy a few lines 3. create a new text file 4. paste the copied lines 5. save with the extension .csv but i doubt this process works i faced exactly same problem few months back and i found http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/ to be the best solution -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] conditional classes
ohh. sorry. what i intend to write is __autoload function... http://in.php.net/autoload moreover __autoload function is highly useful(especially when i hav one class per file) and i use it nearly every time i use a class. i dont think the scope of class definition 'included' within a function is limited to that function itself... PS: just tested - even if i hav the entire class definition inside the function, scope of class definition is not limited(the only condition being i should call the function before creating the object) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] templating engine options
i use smarty (a templating engine) for two important reasons... 1. in most of my projects, templates are designed by a third party and i dont want them to access all my php variables. 2. smarty is meant to do html coding and in many cases i can get the job done in single sentence, while it takes 3-4 lines for PHP. why smarty? i dnt find a different template engine with compiling, catching, debugging features, and a vast plugin repository(and i can write one whenever required) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] change server time
what do you mean by "..does not change the server time permanently..." as far as i can understand you want your wamp server to take the time specified by your operating sys. as a mater of fact it is doing that. but it is not taking the timezone specified by your operating system. http://us2.php.net/date_default_timezone_get to set the env variable globally 1. right click on my computer 2. go to properties. 3. go to advanced tab. 4. click on environment variables button but i believe date.timezone php ini option is best for you PS: i dont use windows any more(not since an year) and the above is from my memory. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Background Process
popen will allow you to read/write data to a file but not execute the php code. i am assuming that you want to execute the php script like include/require does.. if that is the case system() will serve your purposebut this requires php to be installed as a CLI but as Nathan suggested it would be best for you if you considered alternative options. for example you can make an AJAX request to the second file. Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html and password management
seems more of a firefox question than a PHP question... just replace with https://developer.mozilla.org/en/How_to_Turn_Off_form_Autocompletion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why does PHP have such a pain in the a$$ configuration file?
phpinfo() will help you to find the differences in the configuration... i do this every time i move to a new host(before uploading any other files to the server, of course i delete it afterward) and change my pages accordingly. most of the configuration settings in php.ini can be overridden by ini_set().
Re: [PHP] Re: Displaying images
I suggest you use firebug https://addons.mozilla.org/en-US/firefox/addon/1843 coming back to your case.. 1. use the inspect function of firebug to check if the is displaying correctly. 2 then use the net tab of firebug to see if the image is actually downloaded from the server. 3. open the link in new tab to see image is actually displayed. if you are struck at case 1: some problem in the echo statement of your main php case 2: firebug actually tells you what is the mistake you did case 3: i suggest one more firefox addon: live http headers see if the content-type and content-length header are being sent This page isn't working and if I try to browse this page it wants to open it with an editor, it won't view in the browser. i assume that the address in the URL bar of your browser starts with file:// rather than http:// ? simply put are you double clicking the file or clicking open with firefox ?
Re: [PHP] Create multipart email
i have been using PEAR Mail. major reason being nearly all of my web hosts have this supported (pre-installed) Kranthi. On Thu, May 28, 2009 at 17:29, Phpster wrote: > > Use phpmailer, makes it simple > > Bastien > > Sent from my iPod > > On May 28, 2009, at 4:47, "Guus Ellenkamp" wrote: > >> I'm trying to attach an uploaded file to an e-mail which I receive in >> Outlook. Neither the first part, nor the second part displays properly. The >> header looks ok when displayed on the screen. What am I missing? >> >> See code below. >> function xmail($mailto, $from_mail, $from_name, $replyto, $subject, >> $message, $origname, $tempfile, $filetype) { >> >> $file = $tempfile; >> >> $file_size = filesize($file); >> >> $handle = fopen($file, "r"); >> >> $content = fread($handle, $file_size); >> >> fclose($handle); >> >> $content = chunk_split(base64_encode($content)); >> >> $uid = md5(uniqid(time())); >> >> $name = basename($origname); >> >> $header = "From: ".$from_name." <".$from_mail.">\r\n"; >> >> $header .= "Reply-To: ".$replyto."\r\n"; >> >> $header .= "MIME-Version: 1.0\r\n"; >> >> $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"; >> >> $header .= "This is a multi-part message in MIME format.\r\n"; >> >> $header .= "--".$uid."\r\n"; >> >> $header .= "Content-type:text/plain; charset=iso-8859-1\r\n"; >> >> $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; >> >> $header .= $message."\r\n\r\n"; >> >> $header .= "--".$uid."\r\n"; >> >> $header .= "Content-Type: ".$filetype."; name=\"".$name."\"\r\n"; // use >> diff. tyoes here >> >> $header .= "Content-Transfer-Encoding: base64\r\n"; >> >> $header .= "Content-Disposition: attachment; file=\"".$name."\"\r\n\r\n"; >> >> $header .= $content."\r\n\r\n"; >> >> $header .= "--".$uid."--"; >> >> echo $header; >> >> if (mail($mailto, $subject, "test", $header)) { >> >> echo "mail send ... OK"; // or use booleans here >> >> } else { >> >> echo "mail send ... ERROR!"; >> >> } >> >> } >> >> // how to use >> >> $my_name = "Guus"; >> >> $my_mail = "g...@activediscovery.net"; >> >> $my_replyto = "g...@activediscovery.net"; >> >> $my_subject = "This is a mail with attachment."; >> >> $my_message = "Hallo,\r\ndo you like this script? I hope it will >> help.\r\n\r\ngr. Olaf"; >> >> xmail("g...@activediscovery.net", $my_mail, $my_name, $my_replyto, >> $my_subject, $my_message,$fileName, $fileTempName, $fileType); >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP, OOP and AJAX
i never faced such a problem and i can assure you that it will never happen. try... main.php second.php test call main.php via AJAX and see the responseText. many things can go wrong in your coding. dont come to the conclusion that this particular thing is not working. i recommend you firebug firefox adddon (just go to the net tab and you can see all the details of the communication between client and server) and i find it helpful to use a standard javascript(jQuery in my case) library instead of highly limited plain javascript language and for you case its difficult to comment without seeing your actual code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create multipart email
ohh.. what i meant is most of my web hosts hav it pre-installed (copy of that file in their include dir) so that i'll not hav to upload it again and thereby save some web space -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Google Calendar Integration
and you have a complete set of documentation at http://code.google.com/apis/calendar/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to extract fields from associative array into different variables
you dont have an alternative. you will have to loop because mysql_fetch_* functions fetch only one row at a time. you can use variable variables to achieve the above result (you will not require this if u use list() or extract() functions) http://us.php.net/manual/en/language.variables.variable.php and if you cant do the job with arrays, and u need separate variables list would be an useful function as suggested earlier. you may also consider using http://in.php.net/manual/en/function.extract.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
the above post points to a 404 page any ways as suggested above in_array() will do the trick for you. i prefer using a template engine like smarty.. http://www.smarty.net/manual/en/language.function.html.options.php One line of code and you are done -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] supplied argument errors
the code works? the above warnings suggest that ter is a mysql syntax error. moreover the documentation of mysql_affected_rows suggests that u should supply a valid recource identifier but not a mysql result resource. i.e., the above should be mysql_affected_rows($db)
Re: [PHP] Progressbar
you can give this a try http://www.uploadify.com/ a jquery plugin.
Re: [PHP] open source event calendar
that depends upon your need.embedding google calendar is best for starters
Re: [PHP] HTTP headers and include()
a single line break after the closing ?> will not cause this problem. PHP interpreter will neglect a single line break after ?> a good debugger like xdebug will be helpful in this case. u can also see the source code of the file to locate the output. any thing before php warning is the output before session_start()
Re: [PHP] Re: SESSION variables: How much is too much?
I prefer to reduce SESSION usage as much as possible. but I dont hesitate to use them if need arises. Points to note - Execution time: Only session_id is stored on the client's computer, and the actual data is stored on the server. so it will take nearly same time to process 100 session vars and 1 session var. - Security: While passing data trough hidden form fields, it is easy for the user to be change it. but its impossible (the user can change the session_id though) for the user to change the data stored in a session. - register_globals: i always set this off. but my host turned this on. had to spend 2 full days to find out what the problem was. coming back to you issue: IMHO storing stuff like" MaxDisplayRecords, DefaultDisplayRecords, etc.," in a SESSION var is the best solution. alternatives being - Hidden fields: this will add to unnecessary network traffic. - Use separate file: Why use a separate file if PHP does the job for you? - Use the database: If you have an existing connection this is OK. But this will become a bottle neck if u dont have an existing connection
Re: [PHP] mysterious " f " character appearing. Why??
I faced the same problem many times. The reason turned out to be an additional character outside tags. HTML formating software like Dreamweaver, HTML Tidy, Notepad++ will be helpful in these cases. Above all use HTML Validatior extension for firefox. Any ways this question has got nothing to do with PHP. Regarding firebug, it shows the "generated" code, or the code seen by the browser, but not the source code.
Re: [PHP] Need Help.
Hi Girish, 1. You cannot modify the browser Back button (any thing on the client's computer for that matter). 2. I strongly oppose the use of Cookies for tracking the user login, due to security reasons. Cookies are saved on the client's computer and he/she can easily modify the information present. But that is impossible with sessions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parallel execution
Code: passthru('firefox &'); echo '1'; I am expecting 1 to be echoed while firefox is running. but that is not the case. ny ideas how i can make this work ? Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?
i never used x-mapp-php5, but most of a forums say it is specific to 1and1 hosting service. php recommends application/x-httpd-php http://us2.php.net/manual/en/install.unix.apache2.php try adding AddType application/x-httpd-php .html in your root htaccess if that dosent help you'll have to add that to your htpd.conf file > You do realize that PHP does not parse HTML files, right? The web server > does that. In fact, the web server also parses PHP files, using a > different library. Kindly elaborate If you are saying that PHP cant parse files with extension .html http://us2.php.net/manual/en/security.hiding.php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] scandir() permissions
code: http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Formatting plain text file
\n"; } wont this do ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] clean url problem .htaccess
mod_rewrite is the best solution available to your case. more over if you are sure that your host supports .htaccess, there is very little chance that they will block mod rewrite alone. you can confirm that by phpinfo. look in apache2handler-> Loaded Modules section (this does not tell you if .htaccess is enabled/disabled) but in the worst case try using $_SERVER['REQUEST_URI'] instead of $_SERVER['PHP_SELF']. in either case you cannot do this with .htaccess disabled. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Radio buttons problem
you will have to manually maintain the number in the bracket. but you can try using a template engine like smarty, and use a for loop to take care of the numbers in the brackets -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying user data and picture
not a good place to discuss the merits and demerits of binary blobs. is it ? now coming back to the question. Firebug firefox addon, and http live headers firefox addon will be of help to you in this case. You have tag(or something similar) i suppose... try opening that src link in a new browser window. For the application to work, you should see the picture of the user in the new window if there are any php errors in that file, correct them before you proceed. if you see some arbitrary data(without any php warnings or notices) but not the image that means you did not set header("Content-type:..') in display_img.php >> however with a .png extention to get the browser displaying the picture. thats not required as long as you have correct Content-type header Kranthi. On Fri, Aug 7, 2009 at 05:38, Michael A. Peters wrote: > Ben Dunlap wrote: >>> >>> I don't have any data blobs in my database - which makes incremental >>> backups easier - I use rsync for files and do a nightly mysql dump. >>> Except for the first of the month, the diff of that nights backup >>> compared to first of month is saved to flat file for rsync. Binary blobs >>> in the database would likely mean I have to change my backup protocol, >>> but if it really is advantageous, I'd do it. >> >> This is just an aside but are you aware of the '--hex-blob' argument to >> mysqldump? It causes binary data to be dumped as a hexadecimal string: >> >> >> http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_hex-blob >> >> It's space-greedy (every byte in your original data requires two bytes in >> the >> dump file) but it seems like it would be compatible with your >> mysqldump/diff >> approach. >> >> Ben >> > > No I wasn't aware of it. > I'll keep it in mind if I ever do start keeping binary blobs. > > -- > 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] Radio buttons problem
you dont seem to understand how radio buttons work. they treat name="sex[][]" as a single group. and you can select only one element in that group. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is there a better way to know from which php file the request comes from ??
HTTP_REFERRER is transparent, but if can be messed with very easily. I prefer use of $_SESSION vars if security is needed in my application (epically when a page is shown after a POST request) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] to a css file requires .css ???
A browser will always parse tag regard less of the extension. the only condition is that the file should provide a mine type 'text/css' for css files. https://developer.mozilla.org/en/Incorrect_MIME_Type_for_CSS_Files -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another date exercise
dont you think http://in3.php.net/strtotime is a solution to your problem ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
see if can run the same php file via CLI. does script.sh run without any problems ? then, probably something linke SELinux is preventing httpd from running scripts. you have to contact your system administrator to get this fixed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
Did you check SELinux options ?? I have a similar problem. For some unknown reason scan_dir() is not able to read /home/user when run as Apache module. but the CLI is giving expected results. I did not find any work around, but had to read /var/www which is the home directory of 'apache' (this is the user under which apache runs by default. hence you script needs 777 to execute) So if every thing else fails I'll recommend you to move the script to /var/ww (usually your server root) instead of /home/user -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
>> That's a potential security flaw waiting to happen. A script like this >> shouldn't be kept in a web-accessible directory. /var/www is not the document root. document root is /var/www/html so I dont think there's a problem. >> /var/www (usually your server root) I am mistaken regarding this. for details (the location of httpd.conf may vary depending on your distro, but it is definitely located in /etc/) $ cat /etc/passwd | grep apache $ cat /etc/httpd/conf/httpd.conf | grep ^ServerRoot $ cat /etc/httpd/conf/httpd.conf | grep ^DocumentRoot $ cat /etc/httpd/conf/httpd.conf | grep ^User >> I have no access to that directory. seems you do not have access to any directory other than /home/user. but i dont think there's a work around, you'll have to request your administrator to move that file to /var/www directory (and retain 777). >> ls, pwd, and other commands run fine. i dont think "ls /home/user" will work fine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and CGI
try adding AddType application/x-httpd-php .pl --> or whatever extension your perl script has -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined Offset Error with Pagination and Sessions
may be you can use a couple of var_dumps to see what's happening behind the screens. and... use a debugger like xdebug.. it'll be of help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting the search words from a google query
can you provide a sample URL that you have in your mysql database ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SESSIONS lost sometimes
The original problem.. >> server is losing session variables. I dont think PHP is not good at unset() ing variables while the script is executing. general logger will be of use in this case (especially when cant reproduce the problem every time). PEAR, Zend, FirePHP, files... any thing will do... try to log every thing related to sessions at the start of the page... session_id, $_SESSION super global, _SERVER['PHP_SELF'] do the same thing after the script exists... i had a similar problem earlier... a page in my app used to change $_SESSION['id']. It took me ages to find out the source... even grep was of no use... at last i was able to isolate the page that was causing this, with the help of logging. Of course, the main problem was that my production server has register_globals on, while my development server has them off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SESSIONS lost sometimes
>> I imagine redirects couldn't be the cause of the problem, right? Thanks, this is really a life saver.. I never used session_write_close() before any redirects... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extract column names from a (my)SQL query
this might be some help... http://stackoverflow.com/questions/283087/php-mysql-sql-parser-insert-and-update -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset( $anobject) does not invoce __destruct()
unset($obj) always calls the __destruct() function of the class. in your case clearly you are missing something else. Probably unset($anobject) is not being called at all ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date +30 comparison
i prefer http://in3.php.net/strtotime it supports loads of other formats as well (including +30 days and 8/26/2009) above all it returns unix time stamp which can be used directly with date(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger
I dont think I understood you completely.. Javascript debugger: Something you use to debug javascript. but Formaldehyde dosent make any seance if xhr object is not used. PHP Debugger: We cant use Formaldehyde to debug errors in every single PHP script. I am talking about pages called directly via the browsers URL bar. FirePHP on the other hand can be used with all PHP scripts. AJAX Debugger: I think the example given in Formaldehyde Google code page fits this category. If not may be you can give an example ? @Andera May be you should consider using application/json as the content type instead of text/plain. The Response text given by Formaldehyde cannot be understood manually (for example if I use jQuery.load()). Had the content type been application/json firebug parses it by default -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger
> @Andera May be you should consider using application/json as the > content type instead of text/plain. > The Response text given by Formaldehyde cannot be understood manually > (for example if I use jQuery.load()). > Had the content type been application/json firebug parses it by default my mistake. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Odd Endless Loop with Explorer 8 (pc)
> '; ?> may b u should have '; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl output
using the http://www.w3schools.com/TAGS/tag_base.asp but I am not sure if base tag works outside try... before curl_init() where URL is parsed using PHP's parse_url() function on http://example.com in either case if there are any external js/css files cURL wont fetch external files(and if they are internal/inline your browser should display them already).. your browser will have to fetch them for you, net console of firebug will be helpful in that case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Self-Process php forms or not?
I try to avoid the use of hidden form elements as much as possible, especially for tracking whether a user has submitted a form or not... I use name="submit" for the submit button instead, that will pass the value of the submit button to the action script. above all i use a template engine, smarty to take care of the presentation for me(like deciding whether to show the form and/or a success/failure message) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Incorrect _SERVER['SERVER_PORT'] returned??
i dont have any idea about your problem, but just an idea have you used https://localhost in the browser while trying to check _SERVER['SERVER_PORT'] ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: WYSIWYG editor to change textarea
I would recommend using an open framework like yui/dojo/jquery for ALL your javascript needs..(i personally prefer jquery) each of the above mentioned frameworks have wysiwyg editors of their own. try using http://code.google.com/p/jwysiwyg/ i doubt it will conflict with your javascript with compatibility mode ON http://docs.jquery.com/Using_jQuery_with_Other_Libraries TinyMCE as such is a very good plugin (i use that in nearly all of my projects and never faced a problem with it). may be you should try to debug your code that is conflicting with tinyMCE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Self-Process php forms or not?
>> That only works if the user clicks on that submit button. If the user >> hits the enter key in a text input, the form is submitted but the submit >> input variable is not set. That is why an hidden input is a safer solution. i doubt that, because i use the above mentioned method in nearly all of my projects, and all of them are working fine. P.S: i prefer keyboard to mouse as a input device -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Self-Process php forms or not?
and yes i forgot to mention... i avoid hidden form elements because they can be modified very easily and hence pose a security threat. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Self-Process php forms or not?
>> You say you don't use hidden fields because they can be modified too >> easily, yet you say you check for the submit button? Which out of the >> two do you do, as last time I checked, modifying one form field is as >> easy as changing any other! I completely agree with you. changing submit text is as easy as changing hidden fields, but its less likely for a user to modify a submit button as compared to a hidden field. moreover it just reduces my typing load. (This is just my practice) >> Also worth noting, you can only successfully check for the name="submit" >> value if there is only one submit button in your form, as that is then >> the default (and only) submit that the form can use, so it uses that. If >> you have more than one submit button (and this includes image input >> elements) then using the keyboard will use the first submit field it >> finds I believe. Cant agree with you on this though. as far as i know using name="" (names of the two buttons may/may not be unique) is the only way to track form submission for forms with multiple submit buttons. Please point out if you think otherwise -- Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl output
>> Some browser security settings may not allow you to run Javascript code >> that exists on another server though not many users use those kind of browsers, because if they do most of the websites which use CDNs will not work. Firstly, it is not a good idea to fetch an entire web page and snow it to an user. (use iframes if this is a must) Secondly, this idea may not be feasible if the web page in question uses AJAX, because none of the browsers allow cross domain AJAX requests As a side note, use str_replace("", "", $text) if base tag doesnot work On 02/10/2009, Ashley Sheridan wrote: > On Fri, 2009-10-02 at 12:51 +0530, kranthi wrote: >> using the > relative.. >> http://www.w3schools.com/TAGS/tag_base.asp >> but I am not sure if base tag works outside >> >> try... before curl_init() >> where URL is parsed using PHP's parse_url() function on http://example.com >> >> in either case if there are any external js/css files cURL wont fetch >> external files(and if they are internal/inline your browser should >> display them already).. your browser will have to fetch them for you, >> net console of firebug will be helpful in that case. >> > > Some browser security settings may not allow you to run Javascript code > that exists on another server though. The tag can be used to > reference the external CSS and Javascript, but watch out for security > settings on client agents. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > > -- Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl output
>> I've read that the upcoming Firefox 4 may have some features built in >> for this sort of thing, and there are plugins out there for most >> browsers that can do this as an added layer of security. Sorry but I could not understand what you meant by "this" coming back to original problem... you should keep in mind that if base tag is used, the links () in that page will become absolute links instead of relative links -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Header problem
Thats a lot of headers to read.. At a first glance I can see that you did not specify a content-length header. this is a must and must be equal to the size of the file in bytes -- Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php exception handling
cant http://us3.php.net/manual/en/function.set-exception-handler.php be used ? getMessage()); } set_exception_handler('exception_handler'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get rid of warning massage
http://php.net/manual/en/language.operators.errorcontrol.php ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
i faced the same problem quite a few times. the general email route is php script -> sender smtp server -> receiving mail server in your case path 2 is broken. meaning port 25 is blocked by your ISP the work around is: 1. see if your ISP provides you with an SMTP account that is not blocked (OR) 2. try using a socks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there any way to get all the function name being called in a process?
even APD is not up to the task xdebug trace http://devzone.zend.com/article/2871 is sufficient, but the output will be in a separate file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
i never worked with postfix, but form my experience with hmail server i can say that you need to relay through a mail account of ISP(not the server itself) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions seems to kill db connection
>> Db error: Access denied for user 'www-data'@'localhost' (using password: NO) >> WTF? I´m not using a user called www-data for MySQL connections, but apache >> runs as this user in the case where $test is true there is an open mysql connection, but when $test is false there is no open connection is available. may be you have opened a connection when $test is true or used a mysql_close() when $test is false or when $_SESSION['login']['uid'] is set. regarding www-data, when mysql_query() fails to find a valid MySql connection, it tries to open a new connection with mysql.default_user and mysql.default_password (u can see these values trough phpinfo()); http://php.net/manual/en/function.mysql-connect.php this used to be the behavior earlier, seems it was changed from PHP > 5.3.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RewriteRule to hide PHP vars in URL
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#RewriteCond
Re: [PHP] PHP APACHE SAVE AS
as jim stated you'll get a "undefined function" error if php_mysql extension is not loaded. in this case probably the MySql server is not running, or not running on the default port (most likely the former) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false
may be unrelated to your problem... but are you behind a proxy? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload dir
How can i change the temporary upload directory? var_dump(ini_get('upload_tmp_dir')); gives me (and that is set in php.ini) string '/var/www/cgi-bin' (length=16) but var_dump($_FILES) gives me 'tmp_name' => string '/tmp/phpbSZ6WP' (length=14) var_dump(file_exists($_FILES['file']['tmp_name'])); gives me (/tmp has permissions drwxrwxrwt and i never used file_move_upload or any similar functions) boolean false am I missing something here? Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload dir
i doubt i can use ini_set in this scenario http://us3.php.net/manual/en/ini.core.php#ini.upload-tmp-dir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload dir
my mistake didn't use move_uploaded_file to see if the uploading is working or not in the first case but i could not understand why 1. ini_get() is giving correct value while $_FILES['file']['tmp_name'] is ignoring that. 2. move_uploaded_file($_FILES['file']['tmp_name'], 'file.php'); is working fine but file_exists($_FILES['file']['tmp_name']) is returning false 3. php_admin_value upload_tmp_dir "/var/www/html" in httpd.conf seems to work ($_FILES['file']['tmp_name'] is not ignoring that); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending email with php
another point worth noting... most of the major email clients does not display external css/images by default. The user will have to grant permission explicitly.
Re: [PHP] sending email with php
No. You must have noticed gmail saying "images are blocked from .. ". This is done to prevent spammers from knowing if your email is authentic or not. Moreover you must have also noticed that all the news letters have a link pointing to a web page version of the newsletter.
Re: [PHP] Tracking file download progress
I dont think the problem in discussion has a solution. Your idea can probably work but I could not understand how $_REQUEST['compleated'] variable is populated. However it suffers from 2 problems. 1. It consumes a lot of unnecessary bandwidth. 2. How are you going to initiate the download ? That said, there is a work around of using server push technology. Of course it does not work in IE though. www.howtocreate.co.uk/php/serverpushdemo.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form validation issue
The javascript function formValidator() must return false if any errors are formed. >>The PHP only runs if the fields are set by testing using ‘isset”. You should definitely have a better validation than that. Remember that all users dont have javascript enabled. Moreover it is very easy to modify the request variables. >> However, if the server-side evaluation fails and the page is refreshed, then >> all the previous values are lost -- UNLESS -- you keep them in a cookie, >> database, or session. I suggest using a session. This is true when the page is refreshed but I doubt that is the case here. Since $_SERVER['PHP_SELF'] is being used I think value="" will be sufficient -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php