php

SEO of multi-language website

hello! i am building a website with a multi-language feature. it would be hard if each of the pages are to be created manually for each language so instead, i have different php files for each language containing define() statements like <?php define("hello", HELLO); define ("there", THERE); ?> and the webpages will only con...

Zend - access layout property from controller

Ahh forgive my Zend newbness, I'm trying to access this form, stored in: layouts/scripts/layout.phtml: $this->layout()->userForm = $this->action('index', 'user'); within class IndexController extends Zend_Controller_Action { public function init () { /* Initialize action controller here */ } public function indexA...

How to set the number of photos in flickr

I am reading this page about Zend_Service_Flickr. However it does not say how to set up the number of photos showing. The following code returns 10 images. Zend_Loader::loadClass('Zend_Service_Flickr'); $flickr = new Zend_Service_Flickr($this->flickrapikey); $results = $flickr->userSearch($this->flickemail); Could anyone tell me how ...

Is there an API for time zones based on IP address?

i want an API of time zones which is based on IP address to be used in php. ...

calculating pi through php

how to calculate value of pi in php till 100000 decimal numbers.. or may be more ...

myproblem in uploading in php

i have this page for upload: <?php require ('incs/db.php'); require_once ('incs/funcs.php'); ?> <?php if (array_key_exists('upload', $_POST)) { $directory = str_replace(basename($_SERVER['PHP_SELF']),'',$_SERVER['PHP_SELF']); $uploadHandler = $_SERVER['DOCUMENT_ROOT']. $directory . 'images/'; // $uploadHan...

How to disable or encrypt "View Source" for my site

Is there any way to disable or encrypt "View Source" for my site so that I can secure my code? ...

How would I incorporate DATEJS into a form driven by PHP?

I'm creating a simple app (PHP & MYSQL) that collects information about an event, and I'd like to incorporate natural language processing in the date collection portion. I stumbled upon date.js (www.datejs.com), and it seems like a great fit, but I'm not sure how I'd incorporate it into the input form and then pass the converted string a...

PHP cURl: Can I check if my user agent is working?

I'm writing a cURL script, but how can I check if it's working and passing properly when it's visiting the website? $ckfile = '/tmp/cookies.txt'; $useragent= "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7A400"; $ch = curl_init ("http://website.com"); cur...

How to strip all tags from wikipedia pages or make page more readable.

I want to strip all tags, remove the [show][Hide] stuffs from wikipedia, or is there some website that makes pages in more readable format. Please I am aware of the Wikipedia printable version, but I don't need any tags in that, as I have some other use. So please answer the original question only, about any website or webservice or c...

Update not working for MySQL and PHP

hi all, I am trying to update the entry in the database i ahve encrypted the field uniqueID i think that is causing some problem. $query = "SELECT UniqueID FROM configuration"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); echo $num_rows; while($row = mysql_fetch_assoc($result)) { $dbuniqueID = Encryption...

Is actionscript 3.0 strong enough to finally be my sole server-side language?

Actionscript 3.0 is much more powerful than its previous versions. Does this mean that I can start using it as my sole server-side language? can it connect to the database just like coldfusion or php? What is it that it can't do on the server-side? Thanks ...

Odd strpos behavior

This is my code: <?php $url = "http://www.uhasselt.be/collegeroosters/2009_2010_298_5_10.html"; $headers = get_headers($url, 1); print_r($headers); $contloc = $headers["Content-Location"]; echo "Content-Location: " . $contloc . "\n"; $soft404test = strpos($contloc, "http://www.uhasselt.be/404b.htm") ? true : false; var_dump($soft404test...

session table ?

hi all How can I send session[table] to database in php ? like that. session_start(); session_register('table'); $qty=$_POST[txtQty]; $pid=$_REQUEST[pid]; $data=@mysql_query("SELECT * from products where productid=".$pid,$con) or die(mysql_error()); $table=$_SESSION[table]; while($row=@mysql_fetch_array($data)) { $table.='<tr>...

cURL Error when using CURLOPT_FOLLOWLOCATION

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/public_html/curl.php on line Trying to use curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, TRUE); but I'm getting this error. How can I overcome it? ...

What development environment for PHP + MySQL would you suggest

I am setting up web application development environment on my localhost. I am used to use WAMP server but I noticed Zend Server which looks promising. I am developing both Zend Framework and non framework applications. Which of these two would you suggest? Is there another option? ...

simple xml object

hello i'm trying to save the values of a SimpleXMLElement to a $_SESSION but the values are entered as "SimpleXMLElement Object". code below: $xml = new SimpleXMLElement($auth_info); $_SESSION[userName] = $xml->profile->preferredUsername; (garfx) $_SESSION[email] = $xml->profile->verifiedEmail; $_SESSION[givenName] = $xml->profile->na...

audio comparison

How to compare two audio files to see the difference of them ...

Magic quotes on older and new versions of PHP

this code is supposed to ensure that clean code gets to the database it is supposed to work in earlier versions of PHP (earlier than 4.3.0) and later versions of php (older than 4.3.0) it works well because the data gets to the database without a problem but i get an error on the browser $menu_name = mysql_prep($_POST['menu_name']); ...

[Solved] Server-side, get progress on sending file

Hello fellow programmers. Basically, what I want to do is to check how much of a file my webserver has sent to a client, when the client is downloading one. Is this even possible? Does apache provide any module/extension that would help me accomplish my task? I use a linux distro, apache2 and php5. Regards. ...