php

Zend Framework $this->baseUrl() always returns the current page :( why

Hi guys - check out this website www.fltdata.com. For some reason the home link no matter what page you go on instead of pointing to the home page it points to the current page. It works fine on my localhost but online its behaving like this. The href value of the home link is just : $this->baseUrl() Whats wrong here.. === EDIT=== Wel...

Using Zend_filter_input standalone

Hi, Is it possible to use Zend_Filter_Input as a generic input filter? I want to use it to filter all form fields (strip tags etc but no validation). All the examples seem to include a $validators array and pre-suppose that I will know the names of the fields on the way in. Because of the nature of the project, timescales etc, it is no...

twitter status is not decoding #

Hello, I am using the following to share something on twitter from my site.. <a target="_blank" href="http://www.twitter.com/home?status=&lt;?=$res?&gt;" name="share" ><img src="images/referral_twitter.jpg" alt="Share On twitter" /></a> where $res=Track SunGlass Up for #share #barter at http://su.pr/2UBgEg - #ihave but if i ...

How can i escape MySQL 'Unable to jump row 0' error?

Hi there! My question is how can I be sure of a row that I'd like to return is exists? I don't want to suppress it with PHP's @ option or count rows before every query to find out the row is exists or not. So there's a simple query like this: "SELECT `title`, `id` FROM `event` WHERE `id` = '234'"; and the table cannot contain the ro...

PHP: How Do I Get a MySQL Link Identifier For an Already Open Connection?

When you open a MySQL connection with mysql_connect(), it returns a link identifier. But what if you want to get that link identifier again later in the script? (for example: A plug-in, that needs to open a new database connection, and still access the old one.) I'm looking for a way to return a link identifier to the last connection op...

How to remove unwanted characters from a string?

Hello, I'm parsing a large text file using PHP and some lines look like this "äåòñêèå ïåñíè", or "ääò", or like this "åãîð ëåòîâ". Is there any way to check if there are more than three characters like this in string? Thank you. ...

Postgresql / php

I want to get id of current inserted row after executing insertion query. p.s.: I'm using postgresql database. ...

listing a folder content : how to prevent user from going above the authorized directory?

Hi, i'm working on a script to allow users to browse a given directory, which is not the directory this file is sitting in, but set in a variable. define('FOLDER', '../_files/'); Now, the rendred html allows to navigate subfolders inside that folder. I use a "dir" GET variable to tell my script which subfolder's content to display a...

how to call a function in PHP after 10 seconds of the page load (Not using HTML)

Is there any way to call a function for every 10 seconds of 10 seconds after the page load in PHP. (Not using HTML.) Thanks in Advance. FEro ...

Simple HTML DOM Parser error handling

Hello, I'm using SimpleHTMLDOM Parser to scape a website and I would like to know if there's any error handling method. For example, if the link is broken there is no use to advance in the code and search the document. Thank you. ...

Does sifr flash display the fonts if they are not installed in the pc?

I want to use the Sifr functionality with the Margarosa font and so i have created my sifr swf with the required margarosa font. This works fine and the effect is visible properly in my pc as the margarosa fonts are installed in my computer. But when i check it in another computer where these fonts are not installed, the effect is not di...

Security of $_SESSION array

When a low-privilege non-administrator user logs into my web app successfully, I am storing the following data in the $_SESSION array: $_SESSION = array( 'user_id' => 2343, // whatever their user_id number is from the DB 'allow_admin' => false, // don't give them access to admin tools 'allow_edit' => false, // don't le...

How can I filter blog posts by author?

I'll use have_posts function to fetch messages, how can I filter posts by author name? ...

how to execute an external program from within php without waiting for finishing execution

hi all, i want to execute an external program from within php. but i dont want that php wait for the program to execute. when i use exec function it wait for the program till it finish. ...

RegEx in php for "comma, space or one per line" ?

I have a textarea field on my webpage. I am accepting the user input, I want to parse that user input for "(SEPARATED BY COMMAS, SPACES, OR ONE PER LINE)" this line. Basically I want to fetch the words, seprated by comma, space or one per line. What can be the RegEx for this which I can use like below: preg_split('/[,; " "]+/', $_tags...

Call some JavaScript when the user closes a (popup) window

Is it possible to call some JS when the user closes a window? I searched for JS event handlers and found only onunload, which calls the script whenever the user leaves a page, not necessarily closing the window. The intended use is to call an AJAX script that unsets a few sessions pertinent to the popup window. There may or may not b...

Encrypt in PHP not working as expected...

Hi, I have a very silly situation, i am receiving an encrypted string from VB.NET in PHP. I am able to decrypt the key. But when i want to encrypt the result and get the encrtypted string i get a mismatch. Can anyone help me out please.... Below is the PHP CODE. <?php //$syscode=$_REQUEST['syscode']; //The actual string is "blueberr...

PHP parsing textarea for domain names entered (separated by spaces, commas, newlines)

Hi there! For my users I need to present a screen where they can input multiple domain names in a textarea. The users can put the domain names on different lines, or separate them by spaces or commas (maybe even semicolons - I dont know!) I need to parse and identify the individual domain names with extension (which will be .com, anyth...

top frame in the site

hi i want to create a frame in my site like the google image section im using php for server side scripting ...

how to delete a folder with contents using PHP

I am in need to delete a folder with contents using PHP. rmdir( ) and unlink( ) are deleting the folder which is empty. But not able to delete the folders which contain contents. could anyone help me regarding this issue. thanks in Advance... Fero ...