php

PHP upload - Why isset($_POST['submit']) is always FALSE

Hello all, I have the following code sample upload3.php: <html> <head> <title>PHP Form Upload</title> </head> <body> <form method='post' action='upload3.php' enctype='multipart/form-data'> Select a File: <input type='file' name='filename' size='10' /> <input type='submit' value='Upload' /> </form> <?php if (isset($_POST[...

Getting PHP Notice: Undefined index: password_clear in joomla when using plugin other then joomla login

Hi, I am getting PHP Notice: Undefined index: password_clear when I use any plugin other then joomla's login plugin to log-in the user. In joomla database, we are not storing any user's data. so I have got a custom plugin, which will do the check for user's credentials through a web service call. The credentials are checked good,...

MySQL error when using send() method of Email component in CakePHP

I've followed the tutorial here: http://book.cakephp.org/view/1286/Sending-a-basic-message, which I have successfully used before with 1.2. However, in 1.3, with a different application, I get the following error: Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser...

How to create pages in Wordpress that are not visible in menus

hello all I want to create some pages in wordpress, but I dont like these pages visible in menus. How can I create such pages ? thanks ...

BBS Posts Per Day

Many forums have a feature that shows posts per day for a given user. How do they calculate that number? ...

MySQL singleton class conflicts with recursive function (PHP)

I have a MySQL singleton class written in PHP. Its code is listed below: class Database { private $_result = NULL; private $_link = NULL; private $_config = array(); private static $_instance = NULL; // Return singleton instance of MySQL class public static function getInstance(array $config = array()) { ...

Quiz - user submissions into MySQL database

Hello What I am trying to achieve: a quiz system with user account and cumulative results table. Process: -User sets up an account -User logs in -User completes quiz -Answers go into results table -Results table displayed My database structure: Table 1: users user_id username password email Table 2: quizzes quiz_id title Tab...

How do I recursively delete a directory and its entire contents (files+sub dirs) in PHP?

How do I delete a directory and its entire contents (files+sub dirs) in PHP? ...

Convert DSA asymmetric key in .NET XML format to PEM format

I have a DSA private key exported using the DSACryptoServiceProvider.ToXmlString, and I need to convert it to PEM format ("file.pem"), so I can open it in PHP using openssl_pkey_get_private function. How do I accomplish this? The solution can use DSACryptoServiceProvider.ExportCspBlob method if it's of any help, I just need to convert ...

insert all $_POST data into mysql using PHP?

Hello All, once again I have a question for the STACKOVERFLOW hivemind. Here's the deal, I'm trying to insert all of my $_POST data from a form into a mysql table. Before, I did: INSERT INTO forms (Place, Date, Find, username, who_sponsored, hours, comments, howdiditgo, studentleader_name, studentleader_email, description) VALUES ...

My php project work properly on local server but does not work properly when I put it online on the web server, WHY?

I'm working on a php project.. And I started building the admin login system and have already finished it and it works properly on my machine (local server) where I'm developing the project.. But when I moved it to a (web server) it didn't work properly as it was working on (local server). the problem that showed up is that when the adm...

How does hosting work with both PHP/MySQL?

I've never had to purchase hosting for a PHP/MySQL environment before. Usually I just need .NET hosting by itself. If I've ever had a sql backend I usually hosted it myself. How would I setup the MySQL hosting (such as hostname, credentials in my config)? I'm assuming they provide this information? ...

Calculating cron next-run-time in PHP

I'm designing a task scheduler in my own personal framework and am trying to avoid the not-as-flexible "run every n minutes/hours/days" method that'd be easier to implement. What I'd like to do is mimic cron scheduling. I've got functions in place to split patterns and calculate the next value for the next date (day of month) currently, ...

reading xml: can xpath read 2 fields?

I'm using SimpleXMLElement and xpath to try and read the <subcategory><name> from the xml at the very bottom. This code works.. but the stuff inside the while loop looks a little messy, and now I also want to get the <subcategory><count> and somehow pair it with its appropriate <subcategory><name>. $names = $xml->xpath('/theroot/categor...

deleting last array value ? php

1 question type $transport = array('foot', 'bike', 'car', 'plane'); can i delete the plane ? is there a way ? 2 question type $transport = array('', 'bike', 'car', ''); // delate the last line $transport = array('', 'bike', 'car', 'ferrari'); // dont the last line $transport = array('ship', 'bike', 'car', 'ferrari'); // dont the...

Looping an array through a second array

Looking to loop through an array of URLs and inject each keyword from a second array into each URL but can't get to grips with the understanding of arrays. Eg: $key = array("Keyword+1", "Keyword+2", "Keyword+3"), $url =array("google.co.uk/#hl=en&q=", "bing.com/search?q=","uk.search.yahoo.com/search?vc=&p="), I'd like the above to outp...

I want to know how to show a "loading" image when a form is submitted by action="any.php"

I want show Loader img with jQuery when you post by PHP Simple action="search.php" Not ajax post or jquery post and Thanx for all ...

Custom Data-types classes

Im thinking of making a custom datatypes / prototypes for a project im working on but im wondering if its such a good idea? For example class String { var $Value; private $escaped = false; function __construct($String) { $this->Value = $String; } function escape() { if($escaped === false) ...

Javascript to socket server conneciton

Hi! I wanted to create a web chat. It was suggested that i use Php Socket Servers. I've made one and they function well with a telnet client. What i find myself bamboozled by is how to get that data to the client via ajax (no page refreshes). All I can come up with is calling a php file with ajax, getting the data and updating the page....

How to add multiple sql queries to paginaiton dynamically?

Hello, I am trying to add or connect multiple sql queries dynamically. I am creating a pagination script and I am trying to add some filter buttons or links in this case when a user clicks on the links, it will add the id to the sql query and then display the results. To better understand what I am saying, I will show you the script I'...