php

Dependent dropdowns or similar, using mootools, php and MySQL

I need to find some way of displaying a drop-down menu that depending on what is chosen will display a second tier of results in another drop-down. All data will be stored in database. Any other similar techniques are welcome. I am currently using mootools, with php and Mysql. Any help or thoughts welcome on this one... ...

PHP Post data with Fsockopen

I am attempting to post data using fsockopen, and then returning the result. Here is my current code: <?php $data="stuff=hoorah\r\n"; $data=urlencode($data); $fp = fsockopen("www.website.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "POST /script.php HTTP/1.0\r\n"; $out .= "Hos...

php getting the name of the class

Is there a way for a class called inside another to know the name of the outer class? Example: class A{ // need to get the name of B // some stuff } class B{ $var = new A; } get_parent_class() qon't do the work since B is not a child of A. Any suggestions? Edit: Sorry everyone I had to change the question. What I wanted to a...

What's a good free php editor?

Possible Duplicate: Any good PHP IDE, preferably free or cheap? Currently I'm using Notepad++. It's a great editor but there are 2 things I'm missing: autocomplete and debugger. I'm looking for a PHP editor that supports: autocomplete for PHP functions (for 5.3). It would be great to have a feature to autocomplete class mem...

PHP header in a loop

Is it possible to "call" a PHP script in a loop like this ? ... while (...) { ... header("Location:myscript.php"); ... } ... ...

Extjs & explorer & file upload

We have got an extjs 3.1.1 form with file upload field (http://www.extjs.com/deploy/dev/examples/form/file-upload.html from here, the latest). After successful submission the reply is {"success":true} with application/json content type. We use Zend Framework as backend, json is generated with json helper. This works like a charm in fire...

Post Curl issue

<?php $url = "http://website.com/folder/index.php"; $data = array('id' => 'R98s', 'name' => 'Bob', 'content' => 'Hello'); $handle = curl_init($url); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); curl_exec($handle); ?> This works great, only 1 problem though, id like a way to get the conten...

How to update a mysql field when a checkbox status changes? using jquery (ajax), php and mysql

Hi guys, I'm new to jquery and ajax and I'm having trouble doing this... I have a php webpage that builds a table with values from a mysql table. The rows are "messages" and the last field of the row is a boolean field "read" that states if the message has been read or not. Building the table, I transformed the boolean value to a chec...

SEO/PHP: How to Convert Form-Submit URL (Get-Method) without Javascript SEO-Friendly?

hello, i have this code <form action="index.php" method="get" class="search-form"><input type="text" size="35" name="search" class="searchBox" value="" /><input type="submit" value="Start Searching!" /></form> and actually i convert the url with javascript <script type="text/javascript"> $(document).ready(function() { $('.search...

Listing rights/roles on MS SQL Server 2005 and Analysis Services using Perl (or PHP)

As part of a project to create a tool to query all sorts of permissions relevant to users in our area at work, I need to query some information about our database servers. The servers run SQL Server 2005 (including instances of Analysis Services 2005). I need to be able to find for a given server: The list of logins on that server The...

php sort an object by two criteria?

Trying to sort this array of objects according to (1) depth and (2) weight, and am unsure how to modify the function I'm using to include this other level... I'm using this function: function cmp( $a, $b ) { if( $a->weight == $b->weight ){ return 0 ; } return ($a->weight < $b->weight) ? -1 : 1; } And then doing this: $menu = g...

Using one variable to look up info in two tables

Hello, The code below works nicely. Each "title" in the MySQL table "submission" is printed in reverse chronological order alongside its corresponding "loginid." I have another MySQL table ("login") with the fields "loginid" and "username." So each row has a "loginid" and a "username." The "loginid" in these two MySQL tables "subm...

Problems with CGI wrapper for PHP

I'm having a bugger of a time with a CGI wrapper for PHP. I know very little about CGI and PHP as CGI. Here's what I know about the system: Solaris 10 on a 386 Suhosin PHP normally running as CGI, with cgiwrap (http://cgiwrap.sourceforge.net/). I am not able to find an example wrapper.cgi on the server to look at. Shared hosting (vi...

Syntastic for Vim: What are the required lines in ~/.vimrc? (PHP error checking)

I find the documents frustrating. What are the basic lines I need to add to my config file to get it working? ...

Will using the php function "insert into" create new columns if they aren't already defined, or return an error?

I'd like to use a foreach loop to insert a _POST associative array into a database using INSERT INTO. What I need to know, is if my _POST data contains keys that don't match the columns of my database, will INSERT INTO simply create these columns in the database? if not, will it return an error and not update my database at all? or wil...

Best way to store a PHP App's Settings?

What is the best approach to storing a group of global settings for a custom PHP application? I am working on a personal project (first major one really), and need a method of storing key-value pairs for recording overall settings for the application. Things to store as... Website's Global Name. Theme (just a variable, or path to them...

How can I beef up this security with cross domain user sessions?

I have a Mothership domain, and if you log into it, a token is created in the database for your login with user Id, created datetime, expiry datetime and user agent. The expiry is set to an hour after the token was made (created when the user logins). To be able to login from Mothership to Scoutship, I append a query string like so <a ...

How to link access card reader with php

Hi Guys i want to use access card reader with php .. I am doing this to moniter attendance on the college ...Is there any intermediate technology which can be used to take the readings from acces card reader to the database.... I am searching for a solution .. can anyone provide me ...

Issues with doctrine build in Symfony

I am getting stuck with this Symfony command after following the Jobeet tutorial on their site. After running the build model command, here's what I get: $ php symfony doctrine:build --model doctrine generating model classes file+ /private/var/folders/yX/yXtbVXwPHcCUpfC-n06OAU+++TI/-Tmp-/doctrine_schema_56533.yml ...

PHP regex help - Find a Match Within Another Match and replace something

guys i have arrays in which i have to match this kind of text then remove spaces in-between the words , Name:'lofse erbbnwq qweqw-qweqw' KKK Name:'lofsdsse erbsdsdbnwq sds sdsd sdqwsdseqw-qwsdseqw' KKK Name:'lofsse esdsdbnwq sds sds sddseqw-qwseqw' KKK i read somewhere that it will work like this, but i tried and its not working ...