php

php and javascript redirect

Hi in a simple page i use php and javascript redirect to return to referrer page. header("Location: $refererScript"); onclick="window.location.href='<?=$refererScript?>';" Which is the best way to protect those scripts from generate errors: Ex. should i use urlencode for $refererScript (or at least for query string ) and if so will ...

Cron jobs using php

Hi, I am trying to set a cron job using PHP and so far having no luck. I am following a tutorial PHP - Create a Cron Job with PHP The file is being created succesfully and all my permissions are correct but the job just dosen't get processed. Any ideas??? ...

Drupal Token Examples of Usage

I need to include a node content in another node using some kind of placeholder, for example: [node-5663] will be translated to the node's content (body) where node-id matches 5663. The example above is just an example, what I would need is actually something like this: [table-TABLE-ID] where TABLE-ID will be a field I define in the nod...

what languages are supported in realbasic?

a friend told me that i possibly can create mac applications via the php plugin in realbasic. is this true? ive searched the net like crazy and the syntax doesnt look anything close to php using the plugin that is. all u do is write function calls and write your php in it. but that is kind of dumb. what i wanna know is what languages are...

thumbnail of video in php while uploading

I have made video gallery . i want thumbnail of that video like youtube. how can i get that while uploading in php. ...

PHP: translate virtual path to physical path

Is it possible to translate a server relative virtual path to physical path in PHP? e.g. if I have a url: /home/index.php then find the physical path of index.php somehow from some other script?? ...

Eclipse Galieo - No completions available

Eclipse Platform 3.5.1.M20090917-0800 org.eclipse.platform.ide EPP PHP Feature 1.2.1.20090918-0703 org.eclipse.epp.package.php.feature.feature.group When I write $_var = new MyClass(); and press Ctrl+Enter, i see class methods, but when i write public $math; ... $this->math = new BaseMath(); and press Ctrl+Enter, i see "no compl...

Storing information ecoded in mysql

Hello! I have a field in my database and i want to store the information encoded. So i would like use the AES_ENCRYPT(), AES_DECRYPT() functions. I have a little problem about the right usage... So this is my code what i need to modify, but i try it many ways and always get SQL syntax error. $query="update users set test='".$_POST...

Wordpress the_author_posts_link

I have a loop where I post list of authors w/ SQL Query, I also need to post the_author_posts_link with links to author pages. When I put it into loop it renders only 4th entry for every iteration. foreach ($all_users_id as $i_users_id ) : $user = get_userdata( $i_users_id ); the_author_posts_link(); $email = $user->user_email; echo...

Automated domain registration

I'm busy writing a app that automacally defines a domain on a server and defines the nameservers and registers a domain. At the moment it only registers .co.za domains which are really easy to register since you only fill in a form and send and the domain then gets registered, I do this this via a PHP script which fills in the form and t...

PHP and mySQL help

Hello there I have a database that has 2 tables in it, one is the categoryTable and the is the userMenuTable, the categoryTable currently has two columns in it, categoryId and categoryTitle it currently holds 2 rows of data, the categoryId's = 1 and 2 and the categoryTitles = News and Blog, in the the userMenuTable I keep a record of wh...

How to extract content from other websites automatically?

I want to extract a specific data from the website from its pages... I dont want to get all the contents of a specific page but i need only some portion (may be data only inside a table or content_div) and i want to do it repeatedly along all the pages of the website.. How can i do that? ...

Problems with space within parameters of a php function

Hey, Sorry for not formatting my code. the toolbar was gone... I want to insert some data into a mysql db. I've wrote a function in php: function add_ID($ID, $token) { $add = "INSERT INTO ids (ID, token) VALUES ('$ID', '$token')"; mysql_query($add); echo 'added successfully'; } if(isset($_GET['addDeviceID'])) { add_ID($_GET['...

How to create thumbnails or preview for videos?

hi i want to display thumbnails or preview panels for videos listed on my site, i want to fetch a single frame from a video (from a particular time i.e get a frame of exactly after 1 min) and display them as thumbnails as in youtube... Any help? ...

PHP E-Mail Encoding?

Hi, I am having some trouble with foreign characters when sending an e-mail. Could someone advise me on what to do. I think the problem could be one of three things. 1) The html page encoding is incorrect. (Would this affect the POST data from the form?) 2) The mail function doesn't have any encoding. Thus the program doesn't know how ...

PHP Function Definition, Null Arguments

What's the best way to structure a function, that has parameters that can be null? Eg function newDate($day, $time = null, $overRide) { Do something with the variables } # newDate('12', '', 'yes'); Would it be to simply restructure the function as follows: function newDate($day, $overRide, $time = null) { ...

PHP: How to run readdir() as root

I am trying to make a lightweight frontend for my fileserver. I use PHP to display all the files, but readdir() is executed as the http user, because apache is started as this user. This is a problem, because I want to view all my files. Therefore, readdir() has to be run as root, but I don't know how to do that. Can you guys help me? ...

A question about ; in PHP

exit() is valid,but exit() echo 1; Will fail. Why? ...

Date and time in PHP pagination script - slight problems

I have an events calendar written in PHP, with the following pagination script that I obtained from a free PHP site. This is the basic script (entitled PmcPagination.php): http://pastebin.com/f7c5a4a90 (linked here for convenience, too lengthy to post in full!) It works to the extent that it shows all events - but the dates do not tall...

Google Chrome Extensions - Online Packaging

I am coding something like an online PHP editor. So, now I have this option to port the web applications created using the editor as Chrome extensions (popup). It works okay save the fact that the files created need to be downloaded, packaged (using Chrome or cmd) and re-uploaded. I do have this provision but I find it annoying myself to...