php

Spam Assassin giving invalid output

Hi, I want to use Spam-Assassin for scoring mails for spam before sending them to the users. I'm using PHP for executing it as a process using the exec. exec("/usr/bin/spamc -R < {$fname}",$score,$rr); The problem is that the result being returned is always 0/0. I took the PHP code from PHP Classes website. The demo message being us...

Get specific value from Object in PHP

<?php $a['registrationID']="*******"; $a['password']="******"; $a['smsPort']=7424; $a['msgID']=0; $soap_url='http://localhost/WebService_GP_ADP_BizTalk_SMS_Orchestrations.wsdl'; $soap = new SoapClient($soap_url); $response=$soap->getReceivedSMS( array ("ReceiveSMSRequest" => $a) ); print_r($response); ?> This returns: stdClass Ob...

want to combine multiple array in php

Hi All, i want to do this type in my form i have check box array and the function i want to call as the size of check box array, now all is ok simple one time calling. but i want to call the function as above, and store the function return value in one array as function return array so i want to do like this for user id 1->callfunc...

Stopping Parallel Execution of PHP Script

I am trying to stop my cron script from allowing it to run in parallel. I need it so that if there is no current execution of it, the script will be allowed to run until it is complete, the script timesout or an exception occurs. I have been trying to use the PHP flock function to engage a file lock, run the script and then release the ...

combobox treeview in php & mysql

Does anyone know how to display MySQL db hierarchical data (Nested Set Model (http://www.phpro.org/tutorials/Managing-Hierarchical-Data-with-PHP-and-MySQL.html)) in a combo box as shown here under the "Category:" comboxbox field:http://dir.globetourism.biz/submit.php Thanks ...

mysql_real_escape_string : Is it enough for database security alone?

mysql_real_escape_string is used for SQL statements. Is it enough for database security alone? For example with get_magic_quotes_gpc() we have use stripslashes. Is there any issue that we have to know about using other function with mysql_real_escape_string ? Thanks in advance ...

How to implement paypal in facebook application canvas using PHP?

I want the user to subscribe my app in two ways means there are two choices say 200$ and 350$ subscription are available. Firstly I want to direct them to Paypal inside the canvas and then return to the app's page.I want to use PHP libraries .. ...

Videos for developers

Hi, Is there any developers-centric video tutorials site? For example containing video tutorials on topics such as php, jquery, c#, java, etc. Note: I know youtube, so please don't write about such sites. ...

What could I do to improve my MVC?

I'm thinking of re-working my MVC before I get to far along with it. At the moment it uses a sinle controller which takes the user input and determines the model. The model has maby differ methods which I call actions, because one is called automatically. The model loads its view file, which again holds many different methods. The model ...

PHP: How to check if a file is currently being written to

Lets say I have a PHP script that is going to serve a big file and I am currently uploading this big file through for example FTP. Is there a way I can check in my PHP script if the upload is complete? Is there for example a way I can check if a file is currently being written to or something like that? Update: Should have mentioned th...

How I'll let PHP to show the default error page of the server?

If the ID (ie user) does not exist I send header("Status: 404 Not Found"); to the browser but PHP sends rest of the page too. Then I made it to send nothing but then it showed a blank white page. I want it to show the default error page. How I'll let it to do it? ...

How to display the random images without repetition from database(MySql) using php

Hi Everyone, I have a program in php that should display the random images without repetition,I was able to store the images in the database, but I don't have any idea to do this can anyone help me with this. Thank you, ...

How to search for city in a record in MySQL

I have to search user according by city but my problem is that in user table in city field there are two cities like arizona@losvegas, because in registration user can select two cities. So how can I search city by city name? Like if someone searches for all users from arizona... I have done this by using LIKE in SELECT query but I wan...

How would you structure, or the best way to structure the code in PHP?

Hi, i want to know the best way (faster and better) to structure the code in PHP. Some people save a Master Class with functions, sub-classes and var's into an unique global variable, like $modx CMS case. What are your structure techniques? And how do you connect to your DB? Do you all prefer PHP Frameworks like PHPCake? How do you str...

Extract from Php Array using Conditions

I would like to extract the data groups from the PHP arrays depending on the "RouterName". So, in the end, I will get 4 Big Arrays (ArrDeviceA, ArrDeviceB, etc.) I don't want to use foreach and loop every rows and put into the separate array. Moreover, there might be the chance that some arrays might contain more than 3 rows. The nu...

Taking mysql data backup with php5

I am using php5 and mysql5.- in my local server I want to take mysql database backup ( in my local server ) - just by copying the datafile ( located in mysql server in the folder data ) I have copied a particular table name account.frm file - but it is not working It is showing the table name but it is showing error that ( I check...

Mysql insert and update impressions with PHP

I want to record number of advertisement impressions and clicks per day in database. I'm using PHP to insert and update that data in mysql. The script that display specific advertisement and store data in db looks like: ...count the number of rows in db with this advertisement ID ... if ($total == "0") { mysql_query("INSERT INTO impres...

File Upload in Web not working

i have working codes from my server which is really working using Xampp server but when i uploaded it to my hosting site, it seems the whole uploading isn't working.. what is missing? the temp folder? do i need to make a temp folder to my hosting site? ...

How to create a new module in prestashop?

create a new module in prestashop ...

how can I dig my variable out of this pit?

I asked a fairly poor question yesterday, but I still have the same general problem. I wanted to add a variable property to an object, and the solution I attempted was to do an ajax request to receive the variable, and then set the property to the response. I think I have tried this at least 100 different ways: Ext.onReady(go); functi...