php

Text Display in PHP

Hi, if i stored data in DB which contains urls (for example : Go thorugh this link http://www.google.com). when i display that data in browser, i want to display that data like " Go through this link http://www.google.com ". but that url which looks like anchor link... if you didn't get this..open google chat...send some msg to anyone...

Can You Switch PHP Sessions In a Session?

I have two apps that I'm trying to unify. One was written by me and another is a CMS I am using. My authentication happens in the one I coded and I'd like my CMS to know that information. The problem is that the CMS uses one session name, and my app uses another. I don't want to make them use the same one due to possible namespace confli...

Mail Headers

I have a website in wich I send a confirmation mail as part of the registration process. Some time ago, I had some troubles with the mails I sent since I used no headers (php mail function). Once I put some headers, I've got more reponses from users but I suspect that not every message reach its destination. How can I be sure that th...

Check user rights before attempting to CREATE DATABASE

Some hosters let your script CREATE DATABASE, some do not, and require you to use their control panels instead. How do I check whether database would let me run this query with given user/password without actually creating any databases? Because if I don’t have enough rights, I just want to hide the “Create database” button from UI alto...

Propel - SQL: extract a month from a date

I'm trying to build a query with propel Criteria to get all Foo's in a given month. For example I want all Foo's in March. In regular SQL I would build a query like this: SELECT * FROM FooPeer WHERE MONTH(startDate) = 3 Any Idea how I can implement the "MySQL Month-function within a Criteria Object" ? $c = new Criteria(); $c -> add(...

RSA encryption/decryption compatible with Javascript and Php

Hi, I'd like to encrypt in javascript and then decrypt in Php. There are RSA implementations for javascript and php but they are not compatible. I cannot decrypt in Php correctly what I had encrypted with javascript. Does anyone know a library/code that will work both with javascript and Php? Thanks. ...

Difference in server times

I'm developing a web site which will retrieve SMS messages that have been sent to a gateway. The gateway is accessed via an API, with the requests in the following format: http://www.smsgateway.com/?login=myusername&password=mypassword&lasttime=1236164238 Notice that I'm having to track the last time messages were downloaded -...

PHP.ini does not work

I opened the notepad, inserted 3 lines in it, saved it as php.ini, and uploaded it in public_html, but I am still getting an error that requires to first switch the magic quotes off. The syntax of the three lines is as following: magic_quotes_gpc = 0 magic_quotes_runtime = 0 magic_quotes_sybase = 0 What am I doing wrong? ...

binding results into php array

I am trying the following code to get results from query and display it in the tes.php page. db.inc.php <?php function db_connect() { $handle=new mysqli('localhost','rekandoa','rekandoa','rekandoa'); if (!$handle) { return false; } return $handle; } function get_member() { $handle=db_connect(); $sql="Select email,na...

Determining if a lat-long circle and a circle on a sphere overlap

I am creating an application with Geo Proximity Search capability using PHP as server scripting language and MySQL as Databse. Consider a situation: Where we have certain set of objects having latitude and longitude positions assosciated with respective objects. On specifying location details like country and/or city along with range/r...

Arrays as objects

I there a method to allow me to use an array as an object? I have the following code in my main class function __construct() { require 'config.php'; $this->config = new PHPSO_Config(); } where the PHPSO_Config class looks something like this class PHPSO_Config { /** * The administrators email address */ ...

Help me translate long value, expressed in hex, back in to a date/time

I have a date value, which I'm told is 8 bytes, a single "long" (aka int64) value, and converted to hex: 60f347d15798c901 How can I convert this and values like this, using PHP, into a time/date? Converting it to decimal gives me: 96 243 71 209 87 152 201 1 A little more info: the original value is a C# DateTime, and should repres...

Tricky Question: How to order results from a multiple regexes.

I currently use 3 different regular expressions in one preg_match, using the or sign | to separate them. This works perfectly. However the first and second regex have the same type of output. e.g. [0] Source Text [1] Number Amount [2] Name - however the last one since it uses a different arrangement of source text results in: [0] Source ...

dojo.xhrPost Not Sending any Data

I'm just getting into Dojo and wanted to try a simple AJAX Post like the examples on Dojo's website. Here is the HTML/JS: <form method="POST" id="addProjectForm"> <dl> <dt>Project Name:</dt> <dd><input dojoType="dijit.form.TextBox" id="projectName"></dd> <dt>Project Description:</dt> <dd><textarea dojoType="dijit.form.Textarea" ...

Install PHP 5 without libxml2

I am trying to install a copy of PHP 5 to my home directory on the school computer. The problem is that whenever I try, it complains that my copy of libxml2 is too outdated to work. Is there any way I can install this without upgrading libxml2, since I don't have permission to upgrade. Any suggestions? ...

Configuring Eclipse to add a buildpath folder outside the workspace

I'm developing PHP on a mac. As per other suggestions, I've set the workspace to be in the HTDOCS folder of MAMP. Unfortunately, this means I cannot use links to '/' as I would in production. Any suggestions? Relatedly, the workspace seems to prevent references to build paths outside the workspace, yet I would Like to keep my sensitiv...

GZip for PHP on IIS

If GZip is enabled in IIS is it only going to improve performance for ASP pages or can it be setup to compress PHP pages as well? ...

Anyway to error check PHP in Dreamweaver?

I do all my PHP coding in Dreamweaver (currently version CS3) I am used to it and like it. There is one thing I would like though, is to be able to check for errors. Currently I don't see them until I upload the page to a server. Is there anyway to setup PHP error checking in Dreamweaver? Thanks. ...

Preventing directory traversal with web-facing application - are regular expressions bullet-proof?

I am in a situation where I need to allow a user to download a file dynamically determined from the URL. Before the download begins, I need to do some authentication, so the download has to run through a script first. All files would be stored outside of the web root to prevent manual downloading. For example, any of the following could...

What does Windows FILETIME contain? Trying to convert to a PHP date/time.

I've determined that I need to convert a Windows FILETIME type to something PHP can work with. I want this to be a PHP function. Say I have this value: 60 F3 47 D1 57 98 C9 01 Step 1: (Thanks to this page http://www.cyanwerks.com/file-format-url.html) I know I need to change the order to 01 C9 98 57 D1 47 F3 60 Step 2: ????? ...