php

Joomla + Mootools XMLHttpRequest problem.

I'm building a Joomla extension and i'm trying to send some data to a php script, with MooTools, to be saved in a database. This is the code for the request : myReq: new Request({ url: '/index.php?option=com_calculator&task=saveData', method: 'post', onSuccess: function (responseText, responseXML) { ...

how to place a space between to tables in php

How do I place a space between two tables which are vertical. The tables are within the php script: $result = mysql_query("SELECT * FROM t2 WHERE FIRSTNAME='{$_POST["fname"]}' AND HOSPNUM='{$_POST["hnum"]}'"); echo "<table border='1'> <tr> <th>HospNum</th> <th>RoomNum</th> <th>LastName</th> <th>FirstName</t...

jquery remove last created element

I need some help with removing some elements from my page with jQuery, currently I have PHP loop that builds links, <?php $findMore = array(); $i = 0; foreach ($backgrounds as $row) : ?> <a id="<?=$i;?>" class="findOutMore" href="<?=$row['backgroundAddress']; ?>">Find Out More</a> <?php $i++; endforeach; ?> ...

Parse address with regex

I have to create a loop, and with a regexp populate any of the 4 variables $address, $street, $town, $lot The loop will be fed a string that may have info in it like the lines below '123 any street, mytown' or 'Lot 4 another road, thattown' or 'Lot 2 96 other road, her town' or 'this ave, this town' or 'yourtown' since anything a...

Help with PHP and COM

What is the best way to communicate with another process in PHP? Update: Using Windows, PHP 5, calling COM assemblies, COM may or may not be needed, I don't really care. Update: I am trying to send a command from PHP to Ascom (a control program). I mainly need to execute methods and pass small parameters. I also need to be able to get ...

Japanese Date in this format

I'm wanting show the Date in Japanese in this format: 2010年2月18日(木) which translates to: February 18, 2010 (Thu) in PHP can anyone help? Thanks ...

Is there a way to retrieve the DSN from PDO after it has been created?

Is there a way to extract the DSN from a PDO object after it has been created? I have a rather tricky refactoring job to do and so far my best candidate solution may necessitate getting this info out of a PDO constructed elsewhere. For example: <?php $pdo = new PDO("sqlite::memory"); $otherClass = new OtherClass(); $otherClass->setDbCo...

What is the purpose of abstract classes?

I am trying to learn OOP in PHP, and I have some confusion about interfaces and abstract classes. They both contain no implementations, only definitions, and should be implemented through their sub-classes. What part of abstract classes clearly distinguishes them from interfaces? Also, due to their apparent similarities, based on what re...

How to check if a file exist on an external server

How to check if a file exist on an External Server? I have a url "http://logs.com/logs/log.csv" and I have an script on another server to check if this file exists. I tried $handle = fopen("http://logs.com/logs/log.csv","r"); if($handle === true){ return true; }else{ return false; } and if(file_exists("http://logs.com/logs/log.csv")...

integrate outlook calendar to php app

Is there a way to transfer the events setup on outlook calendar to a php app. ...

image gallery with slideshow option

hi everyone im new to PHP I'm looking for an image gallery with slideshow mix script with preview pane, like : (thumb 1) (thumb 2) (thumb 3) (thumb 4) (thumb 4) (thumb 5) etc. ...where clicking a thumb the main image ll appear, but i ve only next, previous, close options in main image i need slide show option also can anyone pl...

converting .doc and .xls file to html on rhel 4 server using php

i have a rhel 4 server and use php as a server side scripting language. There are many doc and excel files that are uploaded to the server daily. i make these files to be downloaded. i want to implement the view as html feature and they should preserve the formatting also. so which tools can be used or it can be done through php only. (o...

What's the standard way to get the part /2/xxx when we request /filename.php/2/xxx?

How to get the /2/xxx part in filename.php? It's not $_GET or $_POST ...

the best way to make a gallery page

hi, Just wondering if someone could tell me the best way to make a gallery page, cos at the moment I'm using images inside the html and as the page and images are getting more the page takes for ever to load, so I'd really appreciate it if you could tell the practice regarding different galleries on one page. thanks ...

How to trigger XDebug for a command line PHP script?

XDebug offers the configuration directive "xdebug.profiler_enable_trigger" that allows to activate profiling by passing the GET or POST parameter "XDEBUG_PROFILE" when calling a script via HTTP. This is handy if you don't want profiling for ALL of your scripts but only for a few special cases without always changing your PHP configuratio...

What does actAs and relations mean in doctrine?

I'm totally at a loss with the following schema.yml: JobeetCategory: actAs: { Timestampable: ~ } columns: name: { type: string(255), notnull: true, unique: true } JobeetJob: actAs: { Timestampable: ~ } columns: category_id: { type: integer, notnull: true } type: { type: string(255) } company: { typ...

Dealing with two people buying a unique item in an online shop at the same time.

Hi there, I'm creating a simple online shop with PHP integrated with PayPal that sells unique items. What I'm wondering is how other shops deal with multiple people attempting to go through the payment process with the same item. This is my current draft strategy: Items have three status types: available, on hold & sold. As a user mo...

PHP escaping question

Hello, I have just read the following code but do not understand why there is " and also ' used. Thank you! $sql='SELECT uid,name FROM users WHERE user="'.mysql_real_escape_string($_POST['login_name']).'" AND .. ...

PHP Register Script - Not working...

I just made a register script from scratch, but I'm still going to improve it. Basically I'm testing it first before I improve it - somehow, it doesn't work... if(isset($_POST['submit'])) { $username = mysql_escape_string(trim($_POST['login'])); $password = $_POST['password']; $vpassword = $_POST['vpassword']; $email = mysql...

Do I need different session tables for different websites?

Hi, I have multiple web applications (PHP) which are being served to different customers from their own domain. Each domain obviously has separate cookies and sessions (with the domains and paths all set correctly). Should I need to set up a completely separate sessions table in the database for each website to try to ensure unique ses...