php

which is better to pass a PHP var in AJAX call to another page: POST or through the session?

Hi, in a PHP site I am building, I use a Prototype AJAX call to address some other php page. This called php page needs a variable that lives as a SESSION var on the first page (in the sense that it's used multiple times throughout that page anyway). It's more curiosity than anything else but: which of both ways to pass our variable i...

PHP passing messages between pages

I have a form on a page where the user has inputs to edit a XML file, the action for the form is to send it to a separate PHP script where the editing takes place after they hit submit. The script will either write successful or fail, either way I have it redirect back to the form page via a header. Is there an easy way to pass back a co...

How to check SOUNDEX in php when php SOUNDEX outputs only 3 digits

I am trying to do a comparison between company names using SOUNDEX, but the php call for soundex only outputs 3 digits so the comparisons aren't quite accurate. Is there a way to get a better soundex output so that the results are more accurate? ...

What is your preferred php deployment strategy?

I'm beginning a new project in PHP and I'd love to get some feedback from other developers on their preferred strategy for PHP deployment. I'd love to automate things a bit so that once changes are committed they can be quickly migrated to a development or production server. I have experience with deployments using Capistrano with Ruby ...

Can PHP restart Apache?

I have a local server which needs to make changes to a virtual hosts apache config file and then restart apache so the new config takes effect. Can PHP do this? I tried passthru and exec but they didn't work. Maybe the problem is that I'm trying to restart PHP's parent process? Thanks for any help!! ...

Converting MSSQL GetUTCDate() into PHP/Unix/MySQL Ticks

I'm inserting a DateTime into MsSQL using the GetUTCDate() function provided by MsSQL. I need to convert the time in C# to show it as the Unix / MySQL integer, so that it can be eventually manipulated with PHP. I believe the Unix / PHP / MySQL ticks start at 1/1/1970, but I'm not sure how I would convert the equiv MsSql / C# time into ...

How do you post data with a link.

I have a database which holds the residents of each house in a certain street. I have a 'house view' php web page which can display an individual house and residents when given the house number using 'post'. I also have a 'street view' web page which gives a list of houses. What I want to know is if you can have links on the street view ...

Pushing Headers and AJAX

Hello all, I have a script that forces a download and I make a call to this via Javascript. However, the dialog box doesn't pop up, here is the download.php script: header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // ...

Curing the "Back Button Blues"

Ever stumbled on a tutorial that you feel is of great value but not quite explained properly? That's my dilemma. I know THIS TUTORIAL has some value but I just can't get it. Where do you call each function? Which function should be called first and which next, and which third? Will all functions be called in all files in an applicatio...

I have a mysterious PHP SOAP error on my host, but can't duplicate locally

I've run across an interesting PHP/SOAP error that has me stymied. After searching I have not found a plausible explanation, and I'd appreciate your help. Here's the background: I have a site built in PHP/CodeIgniter which uses SOAP to communicate over SSL with a back-end system provided by a third party (let's call them "Company X" to ...

Inspect the referrer in PHP

Is it possible to check who is entering your website in PHP. I have a web application ( written in PHP) that should only allow users entering from some particular websites. Is it possible to get the referral websites by examining the _Request object? If yes, how? ...

Is Drupal ready for the enterprise?

Is anyone out there using Drupal for large scale, business critical enterprise applications? Does Drupal's lack of database transaction support dissuade potential users? Are there any other lightweight web-frameworks based on dynamic languages that people are using for these types of apps? What about Java portals such as JBossPortal or...

Scaffolding for PHP

Is there any thing in PHP to create basic scaffold, like in Rails? EDIT: I need something to prototype quickly.. ...

How can I determine if a URL redirects in PHP?

I saw someone ask a question about detecting if a URL redirects from groovy and perl but couldn't find anything on PHP. Anyone know of somewhere I could find that code that does this? G-Man ...

Use Single Row Query with MySQL and PHP

Hey there say I have this $result = mysql_query('SELECT views FROM post ORDER BY views ASC'); and I want to use the value at index 30 I assumed I would use mysql_data_seek($result, 30); $useableResult = mysql_fetch_row($result); echo $useableResult . '<br/>'; But that is returning my whole table What have I got wrong? Edit: Woo...

how to import a very large query over phpmyadmin?

if my host does not allow me to upload a file directly to my mysql folder and i can only do so throught phpmyadmin? are there any alternatives aside from its native import feature so that my connection would not time out while uploading a query that's around 8mb? ...

Toggle data display inside table cell

I have a table that's generated by a normal PHP loop. What I want to do is create a form in the first column of each row that's hidden by default but appears when you click a toggle link in that row. I can make a normal toggle-able div by creating a CSS id called hidden and setting display: none;. Unfortunately I can't keep creating...

How can I hide some content from some users with PHP?

I have created an intranet for our company using PHP. The same menu appears on every page, and includes links to sensitive pages and documents (like Word files). Currently only in-office employees have access to the site, but we'd like to open it up to some out-of-office contractors. The catch is that I'd have to restrict access for cer...

Matrix artihmetic in PHP?

Hi, does anyone know of a library in PHP that handles matrix multiplication, inversion, etc.? I don't mind rolling my own, but I don't particularly fancy implementing inversion from scratch... Thanks, Ben ...

php login code problem

Hi, I'm using this code for login, but when I enter a username and password it just loads the page and the login page again is displayed. Why does this happen? <?php session_start(); if(!isset($_POST['username']) || !isset($_POST['password']) || empty($_POST['username']) || empty($_POST['password'])) { ?> <html> <h...