php

Which PHP mcrypt cipher is safest?

So guys, there's plenty of different ciphers available - but which one is the safest to use nowadays? List: http://www.php.net/manual/en/mcrypt.ciphers.php ...

Find multiples of a number in PHP

Hay i need help. I want to find all muliples of a number in PHP. I'm using something like this if($count != 20 ) to work out if $count is not equal to 20. but i also need this script to check if $count is not equal to 20,40,60,80,100,120,140,160 etc. Any ideas? I think i need to use the modulus symbol (%), but i don't know. Thank...

Check if date is allowed weekday in php?

Hello! I'm stuck with a problem how to check if a specific date is within allowed weekdays array in php. For example, function dateIsAllowedWeekday($_date,$_allowed) { if ((isDate($_date)) && (($_allowed!="null") && ($_allowed!=null))){ $allowed_weekdays=json_decode($_allowed); $weekdays=array(); foreach($allowe...

Handling PHP exceptions with JQuery

Hello, I'm using JQuery to call a PHP function that returns a JSON string upon success or throws some exceptions. Currently I'm calling jQuery.parseJSON() on the response and if it fails I assume the response contains an exception string. $.ajax({ type: "POST", url: "something.php", success: functio...

Reference to array not working as expected in PHP

hi guys, I am confused from the result of the following code: I can't get my expected result: $arrX = array('a'=>array('val'=>10),'b'=>array('val'=>20), 'c'=>array('val'=>30)); foreach( $arrX as &$DataRow ) { $DataRow['val'] = $DataRow['val'] + 20; } foreach( $arrX as $DataRow ) { echo '<br />val: '.$DataRow['val'].'<br/>'; } ...

PHP: allow only two IP addresses at the same time

I want my website to be accessed from only two IP addresses. when ever the site is accessed by more than 2 IP addresses it will shoe an error. can any body done this in php please help me thank you ...

how to make a search engine for website?

I want to have a search engine for my website, is any of these web search engines(like Google,yahoo,etc) provide a free service? Or I should do it by myself ...

how to read uploaded files from xampp

I have this code for uploading files on the server: <tr> <td> <form enctype="multipart/form-data" action="uploadaction.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> </td> </tr> <tr> <td> Select the image: <input name="uploadedfile" type="file" /> </td> <tr> <td> <input type="submit" value="Upload File"...

How to add a php page to Wordpress

I want to create a custom page for my Wordpress blog that will execute my php code in it, whilst remaining a part of the overall site css/theme/design. The php code will make use of 3rd party APIs (so I need to include other php files) How do I accomplish this? N.B. I do not have a specific need to interact with the Wordpress API - a...

How to convert characters to something like '\x{ff41}' in PHP?

I see some data format like \x{ff41} in my regex patterns. I know how to use it via some examples but don't know what it means in PHP.And now I need to figure out whether a character is included by a sequence with range like \x{FF10}-\x{FF19} .Help would be highly appreciated! ...

FCKeditor extension in mediaWiki is Throwing Error

Hi, I'm trying to add FCKeditor extension in mediaWiki and I followed all the instructions that are written in their documentation http://www.mediawiki.org/wiki/Extension:FCKeditor_(Official) but it throws me this error. Strict Standards: Declaration of FCKeditorParser::makeImage() should be compatible with that of FCKeditorParserWr...

get correct word from wrong word php

hi i want to know how to get correct word from wrong one... example The string is "sstring" but the correct word is string... is any algorithm in php? thanks and advance ...

MySQL escape string help

I have a pretty large insert statement something like INSERT INTO multimedia (filename, regex, flag) VALUES (('adsfavr.jpg', '<div id="title">', 0), (...), (...)); How do I prepare the query for MySQL.It's too long to do it manually. It includes double quotes so I can't use the php function mysql_real_escape_string() ...

How do I seperate posted values from a form in PHP.

how pass multiple values to paypal .i used it in paypal submission page <input type="hidden" name="custom" value="id_cart={$id_cart}&option={option}" /> i get $_POST['custom'] = id_cart=534&option=1620850004 , how i get it seperately like $_POST['id_cart'] =534 , $_POST['option'] =1620850004. ...

PHP when display_errors set to 0 500 in AJAX response

Hello All, I have a wired problem. When I set display_errors to 0 on production enviroment then AJAX request to some PHP script returns apache server error 500 and nothing works. When I set it to 1 then response is 200 and everything seems to be fine. Question is what is the connection between display_errors and server error number. I ...

Looking for an easy explanation of exec in PHP

I am having trouble understanding the exec function in PHP. Can someone please explain it to me in simple terms? ...

Drupal 6 / Views2 Grid style: whole cells link to nodes

On my Drupal site, I have made a Users page using the Views module, which is simply a nicely styled grid (HTML table) of users. I'm displaying a few fields for each one, and both the name and the profile picture have been set to link to the user node. What is the best way to change it so that the whole cell (HTML td) links to the user n...

How do I update a blog by sending an email, using php

Hello, I want to update a blog, by sending an email using php. This is not wordpress, tumblr, or the famous ones. I could set up an email id, with a specific code in the subject line, but how I get input the contents into the db? Thanks Jean ...

Zend Framework Codes

what is below codes for?(in Zend Framework) i mean what is the job of these? $this->view->default $this->view->action ...

Horizontal div layout within a foreachloop

I am trying to integrate a small section on an existing website, my problem seems simple, but I can't seem to get my head around it. Here is how I want it to look like: Blue = #pagecontainer Red = #sectioncontainer Yellow = .post pagecontainer { height: 100%; width: 900px;} post container {width: 900px;} .post {width: 210px;} Four ...