php

What's the recommended way of running Java from PHP 5.2?

I want to call Java from PHP 5.2, running either on a webserver or from a command line script. From PHP 4, this seems to be simple, and just involves installing the PECL Java extension. Example code from the PHP 4 extension: <?php // get instance of Java class java.lang.System in PHP $system = new Java('java.lang.System'); // d...

How to identify if referrer is a 301 redirect

I'm implementing a slug system for my website at the moment. I plan to redirect invalid slugs to the correct on that is stored in the database. E.g. http://example.com/11/wrong-slug Hit db, check if 11's slug is wrong-slug if not do 301 redirect http://example.com/11/right-slug Detect 301 and inform user that they foll...

Comparing string - woes in PHP

I want to allow the user to enter a coupon number in order to get a discount. After the coupon number is entered and submitted, the page reloads withe a tick showing that they have entered a correct amount. The way I'm trying to do this is displaying the tick if the coupon amount is not £0.00. But the string comparison doesn't seem to ...

Date Picker with Simple Javascript or Jquery

Hai, I have a form with multiple date fields, Can anyone suggest me simple date picker in jquery or in simple javascript? Note: My form contains multiple date fields ...

How to implement a general Mime type correctly in PHP?

If you click view,you'll open that file in browser, I've tried : readfile('test.jpg'); But seems it fails in firefox. ...

image upload in PHP

I can upload small size files with no problem, but fail when the size is more than 1M. What's the matter? ...

Role-based access to pages in PHP

I'm looking for a solution in PHP that will allow three types of users to pages that are relevant to them. Not everyone will access all the pages. What do I need - a role-based access control or ACL? Please suggest a good script / tool to address this requirement. Thank you for your time and attention. ...

shipping label printing for fedex.

Hi! I am working on shipping label printing for fedex. Information is given below in an array. All values are showing in generated label but Adress, Delivery address, company name are not shown. Sample array is given below. please suggest why we are not able to get all the values. also suggest any possible related resources to solve t...

PHP - On the website i want to show New tab, Mark as read options, when i right click on the any text, msg such as

I am making a mail application, so just when i right click on the msg it should create a window or a block (just as Windows- when right click on folder options appears) showing options such as New tab,Mark as read, Unread etc...... ...

user registration php

<?php include"include/connection.php"; $checkusername=mysql_query("SELECT * FROM employer WHERE eusername='$username'"); if (mysql_num_rows($checkusername)==1) { echo "username already exist"; } else { $query = "insert into employer(efname,elname,egender,eemail,eusername,epwd,eadd,ephone,ecity,ecountry) values ('".$_POST['first_name...

Do I have to display specific error message for each error in PHP script(these error messages are included in Javascript code).

I am developing a website using PHP. I use Javascript/jquery to control/regulate user input. Of course I need to validate user input against these rules in PHP script. However, do I have to display specific error messages once an error is detected in PHP script? I mean if the Javascript runs properly, the errors of input won't come out i...

implement Comet with erlang and use it for PHP application

I'm building a PHP web application and I've reached a point that I need to build a Comet server because I need to update my users' whenever a new data is available (pretty much like FB). I've spent so much time searching the web and I've come to a conclusion that the best way to build Comet server is to build it with erlang. Also I've fo...

Interested in making a PHP script that increments IP address from defined starting address to defined ending address

Hi, I know I can do this easily by converting the IP addresses to decimal notation first using PHP built in functions like up2long and long2ip. I just want to be able to do the same using the standard IP address notation as an exercise. The problem I am thinking goes like this: Given an starting IP address, say 192.168.1.100, and an end...

Images not showing up with https

Suddenly, my images are not showing up on my site when accessing https pages. No change in my code. My host did have to recompile their ftp service with SSL support after my request (so I could ftpes my site). Can't thing of anything else that would affect my SSL cert. Same thing happens on FF and IE and on different computers. ...

OpenSSL enabled but not working

I am running Apache 2.2.13 and PHP 5.2.12. Just installed PHP 5.2.12 manually (to have access to all extensions) and enabled OpenSSL. phpinfo() indicates OpenSSL is enabled and running OpenSSL 0.9.8k 25 Mar 2009. I'm getting this error: PHP Fatal error: Call to undefined function ftp_ssl_connect(). I've seen where the PHP manual sugges...

PHP Output Buffering

Simple question: If I enable output buffering... ob_start(); $a = true; header('Location: page.php'); $a = false; ob_end_flush(); ... will $a be registered as false, or will it just redirect the page without processing the command (as it would if output buffering were not enabled)? Thanks! ...

PHP library for converting html to image?

Is there a free (or commercial) PHP library which would help me convert a piece of HTML to image? I googled it but haven't found anything. thanks in adv ...

What does this symbol mean in PHP <?=

<h2>Manage Role: > (<?= $myACL->getRoleNameFromID($_GET['roleID']); ?>)</h2> ...

What kind of different request and response scopes are there in PHP?

I slightly remember from my age old Java days, that there was an RequestScope object and a Response object. RequestScope contained the POST headers sent from browsers and the GET arguments. Well, it's a few years ago, might be inaccurate. What kind of scopes for request and response are there in PHP environment? Well I think there's a $...

variable predefinition, moving variable to earlier point

Ok, here's the deal where I'm really stuck. I use my cms with design patterns. Where's the last final output(in design template's main file: 'design.php'): <div>{CONTENT_HEADER}</div> <div style='float:left;width:25%'>{CONTENT_LEFT}</div> <div style='float:left;width:50%'>{CONTENT_CENTER}</div> <div style='float:left;width:25%'>{CONTEN...