php

Undefined offset PHP error

I am recieving the following error: Notice indefined offset 1: in C:\wamp\www\includes\imdbgrabber.php line 36 the code is for getting information from IMDB. The link is posted to the page using ajax on another page, I have tested that i am getting the correct response using echo $url <?php $url = $_GET['link']; echo $url; //$...

Findind string in another string in PHP

Hi everybody I got a string like this : $str1 = "mod 1 + mode 2 + comp 1 + toto" I would like to test even " mod 1" is in $str1. I used strpos but this function dosen't help Pliz can anyone give an idea to fix this problem thank u. ...

Discussion on SEO best-practices for site development involving php...

Recently in our work, I've started getting some experience with SEO (finally). It's something I've put off for a long time because I've always maintained that SEO is a buzz-word b.s. pseudo-science and more about providing quality, relevant content (assuming proper header tags and the basics are covered). However, sometimes a client do...

storing image_id after uploading image in article table

According to this question i successed to create upload image , but now i need to store the image_id to another table called articles , i do not know if this is correct , but i tried to select the image_id from table image like this $select_image=mysql_query("select image_id from image where image_name = $fileName") or die(mysql_error()...

How can I invoke a PHP script from Perl?

How can I call a PHP script from a Perl script and get its output as a variable? ...

How should i properly add key => val pair to an existing array

Tried examples from 'php.net' but don't understand what's the problem. Any suggestions ? <?php $_SESSION['test'] = array('a' => '1', 'b' => '2'); foreach ($_SESSION['test'] as $key => $val) echo "key: " . $key . " val: " . $val . "\n"; // Parse error array_push($_SESSION['test']['c'] => '3'); // Parse error $_SESSION['test'][] ...

How to make every word in the text clickable and send it to the script

I have a text for example "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog." When i click on word i must get data from XML or from mysql about this word. How i can make every word active for click and se...

Decoding base64 string?

I can't seem to decode this base64 string which is in the footer of a wordpress theme. I want to be able to add more to the footer. Any help appreciated, thanks! <?php eval(stripslashes(gzinflate(base64_decode("pVNRa9swEH7OYP/h1kG7PbiGwfaQuM7D1tCwsY42UAaBINsXWyD7hKTO87/vSXUct3PZYPKLdN/5vrvvk5Yp8JrNkkL+glwJay+2J7lCYdBsT9Ik5nj6+lVIGh+e7...

mysql_query( "CALL... multiple results

I am tapping into a service that provides zip codes tax information - there service is a bit shakey, so I want to copy their database over and run the results off my own server while using their service to just update my table. However I'm not sure I'm able to loop through multiple results with this query: mysql_query( "CALL zip2tax.z2t...

Cassandra PHP module

Anyone out there using Cassandra (http://cassandra.apache.org/) with PHP? What PHP module would you guys recommend to communicate between PHP and Cassandra? ...

How do I perform this MutliArray setup in Java?

I come from a PHP background and I'm just getting my teeth into some Java. I was wondering how I could implement the following in Java as simply as possible, just echoing the results to a terminal via the usual "System.out.print()" method. <?php $Results[0]['title'] = "No Country for Old Men"; $Results[0]['run_time'] = "122 mins"; $Resu...

What's the most efficient way to setup a multi-lingual website

Hi, I'm developing a website that will be available in different languages. It is a LAMP (Linux, Apache, MySQL, PHP) setup, and it makes use of Smarty, mostly for the template engine. The way we currently translate is by a self-written smarty plugin, which will recognize certain tags in the HTML files, and will find the corresponding ta...

login form running script without refreshing page, but need to remove form once successful

The code below gets the username/password and runs it thru the backend.php script. <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script type="text/javascript"> ...

Content-type not working in PHP

Hi everyone, I have some issues with a PHP file that is not working properly. The Content-type does not get recieved by any browser at all. Firebug interprets the file as text/html instead of css. Here's the file : <?php header('Content-Type: text/css; charset=UTF-8'); error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 'On');...

Duplicate array but maintain pointer links

Suppose I have an array of nodes (objects). I need to create a duplicate of this array that I can modify without affecting the source array. But changing the nodes will affect the source nodes. Basically maintaining pointers to the objects instead of duplicating their values. // node(x, y) $array[0] = new node(15, 10); $array[1] = ne...

I'm not sure if I should use a redirect

Hi there, I have an affiliate link on my webpage. When you click on the link it follows the href value which is as follows: www.site_name.com/?refer=my_affiliate_id This would be fine, except that the site offers no tracking for the ads, so I can't tell how many clicks I am getting. I could easily implement my own tracking by changin...

In Symfony, how can I add a 'selected' class to the currently selected page in my navigation?

My navigation is written in the layout.php template It looks like this: <ul id="nav"> <li><a href="item1">Item 1</a></li> <li><a href="item1">Item 2</a></li> <li><a href="item1">Item 3</a></li> <li><a href="item1">Item 4</a></li> </ul> What is the best way to get a class="current" on the currently selected page? ...

How to current snapshot of MySQL Table and store it into CSV file(after creating it) ?

I have large database table, approximately 5GB, now I wan to getCurrentSnapshot of Database using "Select * from MyTableName", am using PDO in PHP to interact with Database. So preparing a query and then executing it // Execute the prepared query $result->execute(); $resultCollection = $result->fetchAll(PDO::FET...

So i've been recommended Zend search lucene php for search functionality, but is it better than mySql full text?

i've playing around with mysql's full text search and I'm not sure if it is the best. let's say I search for "how do I book an appointment?" it will give me the correct results from the database, so "how can I book appointments?" I think it is because "book" is an uncommon word. What if the user searches "how can I schedule an appoint...

Auto login to Google Analytics??

Hello I have tried following similar steps as mentioned on this Auto login to Google Analytic to impress clients page <form id="googleanalyticslogin" action="https://www.google.com/accounts/ServiceLoginBoxAuth" method="post"> <input type="text" name="Email" class="gaia le val" id="Email" size="18" value="[email protected]" /> <input type="p...