php

Is there an out of directory project builder for PHP yet?

So that I can keep the .proj from my PHP project. This gives great flexibility for me to switch from one IDE to another(for debug,of course:)). ...

How do I display a quote for 24 hours

I want to display a quote on my site for daily basis. after 24 hours it should change. quotes are stored in MySQL database. how do I do this with PHP Thanks Mathew ...

What are the possible tags inside the "global" tag in Magento "config.xml" file?

Can some professional experienced Magento developer tell me how to accomplish the following in Magento? I want to know what are the possible tags that can fit in the "global" tag of the "config.xml" page of every module's etc folder? I have tried searching for this answer at many places in Internet but in vain. Please provide the full...

Height of a webpage for snapshots in PHP

We have an application that takes snapshots of certain web pages. It's quite tightly integrated into the code, so we're not ready to incorporate another library. But we don't have a way of being able to calculate the web page height, so we end up taking snaps of 8000px height. Which is now proving troublesome when inserted into PDFs. I...

"Remember" last three MySql queries; Cookie, passed variable or other method?

I have a classified website, with pretty sophisticated searching, and I am about to implement a function where the last three queries is displayed for the user, so that the user can go back easier through the queries. This because for each query the user has to provide a lot of input. I have four questions for you: I wonder, how can I...

Get all followers of user on twitter

I am using twitter application in mywebsite. I am using followers api of twitter. I want to see all followers of particular user. but it shows only 100 followers.I want to see all followers. Please help me how can fetch all followers of user ...

How do I show todays top search list??

I owns a website which is doing lots of searches per day. these search results are stored in my MySQL databse. what I want is I want retrieve today's top searches from MySQL limit to 20 and display in my website. how do I do this with PHP & MySQL?? Thanks Mathew ...

Header how to modify title of the page "on the fly"

Hello, My header is called as you can imagine, on each pages. it means that on each pages i've the same title (bad for SEO) Is there a workaround to set pages title outside the header.php ? Thanks ...

advanced search with mysql

I'm creating a search function for my website where the user can put in anything he likes in a textfield. It get's matched against anything (name, title, job, car brand, ... you name it) I initially wrote the query with an INNER JOIN on every table that needed to be searched. SELECT column1, column2, ... FROM person INNER JOIN person_c...

query about calling Php web service through .net

Hi, with the ref of page: http://stackoverflow.com/questions/2469594/how-to-access-a-php-web-service-from-asp-net/2825735#2825735 I got following code; I cudnot find "requestXmlString" in whole code, where to declare and what is in this variable? Its urgent please. private string MakeWebServiceCall(string methodName, string requestXm...

jshttprequest failing when added Zend Library

I have a php project in which I now need to use Zend library for uploading video on youtube the code for uploading video on youtube works fine if it is run as a separate project. But when I add Zend library to php project like this require_once('Zend/Loader.php'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadCl...

facebook authentication / login trouble

I have setup facebook authentication using php and it goes something like this first getting the authorization here : https://graph.facebook.com/oauth/authorize?client_id=<?= $facebook_app_id ?>&redirect_uri=http://www.example.com/facebook/oauth/&scope=user_about_me,publish_stream then getting the access Token here : $url = "h...

how to force the user to download a file, not to view it?

I have a download page where i have kept musics, pictures, ebooks and etc. Whenever users click at the image it opens it, and same things happen with .pdf files if the user has installed pdf reader on their PC? I dont want them to open the file but to download it? Any ideas ...

undefined GET id?

<?php $s = $_GET["s"]; if($s) { $hent_b = mysql_query("SELECT * FROM member_battles WHERE state = '1' ORDER BY id DESC LIMIT 0,200") or die(mysql_error()); }else{ $hent_b = mysql_query("SELECT * FROM member_battles WHERE state = '0' ORDER BY id DESC LIMIT 0,200") or die(mysql_error()); } while($vis = mysql_Fetch_array($hent_b)) { ?> ...

Getting directory's permissions via FTP

I am trying to get permissions of a directory via FTP command "STAT" like this: $directory_list = ftp_raw($conn_id,'STAT '.$path); The above command lists entire directory contents , including files and subdirs. I then search the returned data array for the directory i need to check, and retrieve something like: drwxr-xr-x 3 user ...

How to call a bash script from php passing parameters

I have a php script that execute a bash script. I try to pass parameters like this: $script="/opt/lampp/htdocs/adapt.sh" $file="/opt/lampp/htdocs/videos/video1.mp4" $prefix="Test" exec ('.$script.' '.$file.' '.$prefix.'); What's wrong? How can I pass the parameters? ...

How to modify this regex expression to accept hyphens?

I have the following Regex (in PHP) that I am using. '/^[a-zA-Z0-9&\'\s]+$/' It currently accepts alpha-numerics only. I need to modify it to accept hyphens (i.e. the character '-' without the quotes obviously) as well. So it will accept strings like 'bart-simpson' OR 'bond-007' etc. Can anyone explain how to modiy the pattern? ...

Does in_array() use a binary search algorithm?

I have a largish array of string that I want to use as a lookup. I a using in_array(), but I suspect its doing a simple loop through - does anyone know whether the in_array() algo uses a bsearch algo? ...

Detecting maximum execution time in Runtime

I've seen a lot of questions regarding this error in PHP. But everywhere the solution is given as to set the time limit. But what I want to do is, to detect the error and if it occurs then switch to another course of action. I mean, if my requests exceed my maximum time set, then it should not give an error message and stop but continue...

php strtotime() some help

Hi there, I am taking credit card details and I am taking the expiration date in two form field, one for the expiration month and one for the expiration year, I am wanting to store the expiration date as timestamp. Will strtotime("05/2010") create a time stamp or do I need to pass a day as well or is there an alternative? Thanks ...