php

get json data back from ajax call

Hello, my question is: How can my php script send json type data and received back into the success or complete function? I was trying to get this chatfunction to work on my website Because it diddn't work, I created a minimized portion off the code to check if it had something to do with the json method. I only tested if I could get a...

HTML, PHP - Redirecting example.com/blogs to example.com/blogs.php

Hello, How do I redirect "example.com/blogs" to "example.com/blogs.php" Thanks in advance, John ...

Compiling my own PHP extension on Windows with Visual Studio 2008

I wrote a PHP extension and it could be compiled and run under linux successfully. But on windows, I met some problems. I did the compiling on windows according to http://blog.slickedit.com/?p=128 with PHP source version 5.2.10, and after the compiling it generated the dll file. But when I tried to use the dll file, it reported me the m...

PHP - PDO SQLite3 Prepared Statements

I'm trying to use prepared statements in a PHP script that accesses an SQLite3 database using PDO. The normal version of this query works as expected: $q1 = "SELECT COUNT(*) FROM fruits WHERE name='apple'"; echo $db->query($q1)->fetchColumn(); However, my prepared statement version outputs nothing. $q2 = "SELECT COUNT(*) FROM fruits...

Boostraping using apache and php or another method

So i've got the following code: ini_set("include_path" , ini_get("include_path") . ":/Library/WebServer/Documents/__CMS/:"); ini_set('display_errors', 'ON'); $base_url = '127.0.0.1'; $lib_dir = '/Library/WebServer/Documents/__CMS/'; header('Location: admin/main.php?base_url='.$base_url.'&lib_dir='.$lib_dir); which is pretty ugly but...

Whats the best way to audit changes on a particular form field??

I need to add an entry into a database everytime a field changes in a form indicating the old value and the new value. How would you go about this?? Would you... Add a hidden field for every field and compare it to the new value on submit then add an audit entry if neccessary?? Do a select of the data to be inserted on post then comp...

Why not to use highest error reporting level in PHP?

I want you to give reasons why someone should not use the highest possible error reporting level in PHP? Ways to set highest level: PHP 5: error_reporting(E_ALL | E_STRICT); PHP 6: error_reporting(E_ALL); PHP all versions (as recommended for config files): error_reporting(2147483647); My experiences: there is no reason for l...

Would this regular expression work?

^([a-zA-Z0-9!@#$%^&*|()_\-+=\[\]{}:;\"',<.>?\/~`]{4,})$ Would this regular expression work for these rules? Must be atleast 4 characters Characters can be a mix of alphabet (capitalized/non-capitalized), numeric, and the following characters: ! @ # $ % ^ & * ( ) _ - + = | [ { } ] ; : ' " , < . > ? / It's intended to be a password v...

Php Javascript alternative for jquery grid

Hi, I want an alternative to a jquery grid for crud operations in php. I want to use a simple table with facilities such as searching, sorting an pagination. Is there any library for this? Can i use prototype.js for achieving this? Please guide me. ...

PHP: GD Library:Increase font size in ImageString function

I have the following block of code which will output a captcha image $im = @imagecreatefromjpeg("captcha.jpg"); $rand = _generateRandom(3); $_SESSION['captcha'] = $rand; ImageString($im, 5, 2, 2, $rand[0]." ".$rand[1]." ".$rand[2]." ", ImageColorAllocate ($im, 23, 85, 160)); Now i want to increaese the font size.I have used the ...

What is the best way to set up shared php script files on a webserver?

I'm running the same php script on many domains on an apache2 server. Only some of the files change between domains, and the rest are always the same. Right now, every time I set up a new domain, I copy all the files, but I'd really like to have these common files in one place so any changes would affect all domains. I've thought of usi...

Parameterized Constructor Cascading

Consider the following situation class URISplit { var $REQ_URI; //some more variables function __construct($uri) { //some code $this->REQ_URI = $uri; //some code yet again } } and the following class URIResolve extends URISplit { //some variables function __construct($uri) { ...

Encrypted and signed MIME messages using RFC 1847

I need a client-server encryption solution for web transfer, (i.e. signed and encrypted client-side, and verified and decrypted server-side). I am using HTTP, but SSL is not available due to shared hosting restrictions (my server is a shared host environment). Looking into alternative solutions, I have decided on OpenPGP using GnuPG. On...

undefined error with ajaxcall to receive json data

Hello, my problem is that I can not solve this problem If I call the php script, all I get is an undefined error this is the code I use for testing AND this is the original code from the creator that is giving me a headache function startJsonSession(){ $.ajax({ url: "jsontest.php?action=startjson", cache...

Setup expires headers PHP & Apache

How can I setup expires headers in PHP + Apache? I'm currently using an auto_prepend to serve resources gzipped but I'd also like to maximise the cache. How can I set these up? ...

Php script running as scheduled task hangs - help!

Hi guys, I've built a php script that runs from the command line. It opens a connection into a pop3 email account and downloads all the emails and writes them to a database, and deletes them once downloaded. I have this script being called from the commandline by a bat file. in turn I have created a scheduled task which invokes the bat f...

Php eclipse

Hello All, I have one prject with is developed in Php and javascript.Can anyone tell me how to open the project in eclipse ide.I want to debug it. It's very urgent. Thanks ...

Setting encoding, newline, linebreaks, end-of-line (EOL) in PHP

For example, when I create a new file: $message = "Hello!"; $fh = fopen(index.html, 'w'); fwrite($fh, $message); fclose($fh); How can I set it's encoding(utf-8 or shift-jis or euc-jp) and linebreaks(LF or CR+LF or CR) in PHP? ...

PHPLiveX and loading html into DIV

Hi, I am using an JavaScript (and AJAX) to dynamically load a PHP page into a DIV, (when a hyperlink is clicked the div gets code from an external file loaded into it without the page refrshing). The problem i am having is that when i use PHPLiveX (an AJAX framework for PHP) within the DIV it does not work, however when i load the page...

How to clear browser cache with php?

How to clear browser cache with php? ...