php5

How to open file in PHP that has unicode characters in its name?

For example I have a filename like this - проба.xml and I am unable to open it from PHP script. If I setup php script to be in utf-8 than all the text in script is utf-8 thus when I pass this to file_get_contents: $fname = "проба.xml"; file_get_contents($fname); I get error that file does not exist. The reason for this is that in Win...

Weird IE7 js issue in Drupal

In IE 7 when I click on any javascript link for example "< a href="#" onclick="toggleGroup(); return false;" id="slick-toggle">View Classrooms" the page will refresh. This is occuring in a drupal project I inherited. This problem doesn't happen in IE7 when I run the same script outside of drupal. Even in the drupal admin onclick event...

Remove/Edit Links within Dynamically-loaded Markup

description like <a href="myexample.com"></a> should return blank ...

Is it posible, to modify or edit txt file, if the file's permission is set as 606 ?

Is it posible, to modify or edit txt file, if the file's permission is set as 606 , via WEB browser , by normal users ? I mean I make a txt file named "1.txt" The first original contents of the txt file is "PAX is great man" and then ,I upload this file to server. I set the permission of the file as 606. so the general users can n...

Is it old explanation,if he use var thing for his PHP OOP explanation?

Is this old way to explain for PHP oop, if he use var thing? for example, <?php class person { var name; } ?> ...

mysql-php querying a list to build a table

I've had the same problem with sql for a while and as I sit down to write the same 'brute-force' hack I always use, I figure there MUST be a more efficient way to do what I want to do. I have tables similar to this: grades(gradeID, taskID, grade, username, date) tasks(taskID, task...) assignment(assignmentID, title...) assignment_tasks...

Why does PHP 5.2 disallow abstract static class methods?

After enabling strict warnings in PHP 5.2, I saw a load of strict standards warnings from a project that was originally written without strict warnings: Strict Standards: Static function Program::getSelectSQL() should not be abstract in Program.class.inc The function in question belongs to an abstract parent class Program and is de...

Why does working permisson of PHP script differs between server?

<?PHP print "hello"; ?> I write this code and save as "1.php"; Then I upload this PHP script to my server. I have 8 diffrent free hosting server's accounts. And I noticed that there are 2 types of server settings. (1) "type A" for exapmle, sqweebs. We need to set the PHP file permission as 640. This means that sqweebs server req...

php list into a table

I asked a question yesterday and the answer I got has answered the first part of my problem - I now have a query that generates a list similar to this: fname, sname, uname, assignment, task, grade joe, blogs, joe.blogs, 1, 1, 52 joe, blogs, joe.blogs, 1, 2, 58 jim, blogs, jim.blogs, 1, 1, 95 jim, blogs, jim.blogs, 1, 2, 86 amy, blogs, a...

How many percent we need to pass Zend Certifieed PHP5 Exam

How many percent we need to pass Zend Certifieed PHP5 Exam? ...

When to use a variable variable in PHP?

I've been developing in PHP for a while now, and I still have not had a task where I've had to use variable variables. Can anyone give me examples where using them is a good idea ? Or were they included in the language just for fun ? ...

PHP class function not working

Hello Folks. I'm new to PHP and web scripting in general so this a newb question. Currently i'm a creating an instance to an object, yet when I call the constructor the script slienty shuts down... it doesn't call the next function and I don't know why. Any help would be welcome. Here is the code. <?php class product { var $ssPro...

Want to add Localisation in my website - multilingual website

Hi friends, I have created a website, i want to add localisation for this website - multilingual website. I have created this using PHP, javascript and ajax. I had tried for google language translator API. Is there any other way to do this. Could you please suggest me how to implement this in my website. ...

How feasible is a daemon written in PHP, using ignore_user abort and set_time_limit(0)

I'm mucking about with daemons, and wondered how feasible (in terms of memory and cpu usage, and reliability) it is to do this using PHP: <?php // Ignore user aborts and allow the script // to run forever ignore_user_abort(true); set_time_limit(0); $fp = fopen('loop.log', 'w'); fwrite($fp, date('Y-m-d H:i:s') . ' Started' . PHP_EOL); w...

How do you write code for ID/password info get from CSV and login process?

I thought that I should use JSON for ID/pass storing format once, but I reserched about it, then I finally found that JSON is too difiicult to me, so now I am considering to use CSV. The CSV file would be like this. File name is id.csv. aaa_id,aaa_pass bbb_id,bbb_pass ccc_id,ccc_pass Left colum is id, and right colum is password an...

Coalesce function for PHP?

Many programming languages has a coalesce function (example). PHP, sadly, does not. What would be the most efficient way to implement one in PHP? ...

how to evaluate formula passed as string in php?

Just trying to figure out the proper and safer way to execute mathematic operation passed as string. In my scenario it is values fetched from image EXIF data. After little research I found two way of doing it. first, using eval: function calculator1($str){ eval("\$str = $str;"); return $str; } second, using create_function: ...

How do you guys dealing with errors about PEAR thing?

When I use PEAR, it always generates lots of errors. How do you guys treating about them? (1)use PEAR , and just ignore errors. What is error thing? I can't see them. (2)use PEAR, but tweak error level, to they do not generate errors. (3)Don't use PEAR thing. switch to cakephp. ...

NuSOAP on XAMPP with PHP5: failed to open stream

Hey guys, I have a problem (again). This time I am trying to use NuSoap w/ XAMPP 1.7.1 which includes PHP5 and MySQL ... I wrote a soap-client: <?php // Pull in the NuSOAP code require_once('nusoap.php'); // Create the client instance $client = new soapclient('http://localhost/mysql/helloworld2.php'); // Check for an error $err = $clien...

Registration Codes/Server Verification & Joomla

This question can be broken up into a couple of parts: What is the best way to create a registration key for a product in PHP (ie. a person purchases a PHP program and after payment receives an activation key) I want to be able to store the registration keys on my server (Joomla) and associate the key with my existing users. Then the P...