php

Finding the value of a child in a specific attribute

<data> <gig id="1"> <date>December 19th</date> <venue>The Zanzibar</venue> <area>Liverpool</area> <telephone>Ticketline.co.uk</telephone> <price>£6</price> <time>Time TBA</time> </gig> <gig id="2"> <date>Sat. 16th Jan</date> <venue>Celtic Connection, Classic Grand</venue> <area>Glasgow</area> ...

Get last <li> element from a string

I have a string variable that contains a lot of HTML markup and I want to get the last <li> element from it. Im using something like: $markup = "<body><div><li id='first'>One</li><li id='second'>Two</li><li id='third'>Three</li></div></body>"; preg_match('#<li(.*?)>(.*)</li>#ims', $markup, $matches); $lis = "<li ".$matches[1].">".$matc...

Copy a dir from a webserver to a mapped networkdrive

Hi All, For a PHP project I'm working on, focussing on data homogenity, a certain directory structure can be managed. After a user completes a process creating an object (I won't bother you guys with all the project details;)) this directory structure should be copied to a mapped network drive. Since the users might have the networkdriv...

PHP: Effective Method for Banning Users

Okay hey guys, thanks for reading, I know a lot of scripts handle IP ban, IP range ban etc. I was trying to make a method that would block a user as best as i can, i came up with: IP block Setting a cookie But if a user has a dynamic and doesnt enable cookies this wont do much to him. I dont want to block an IP range because most of ...

how to download a file which is located inside the directory

how to download a file which is located inside the directory ...

Unable to create GD image resource from BMP with MIME type 'image/x-ms-bmp' in PHP

I'm trying to create a GD image resource from a BMP image, however I'm having no luck. The BMP image in question was created and saved with Photoshop. I've tried a couple of BMPs I found on the web too, and they gave the same results. getimagesize() tells me the BMP image has an image type of IMAGETYPE_BMP (6) and a MIME type of 'image...

PHP text-size selector within a Drupal site only working when logged in.

Hi, I have a PHP text-size select function within a Drupal site: It uses this selector...: <ul id="font-sizes"> <li class="one"><a href="<?php global $base_url; print $base_url;?>/sites/all/themes/x/resize.php?set=small">Normal Font-Size</a></li> <li class="two"><a href="<?php global $base_url; print $base_url;?>/sites...

Debugging with xdebug, netbeans and a mounted remote server

Hi, I've using Netbeans to develop on a windows machine, the files I'm editing are on a remote LAMP server. The document root is mounted on my windows machine as a drive letter (Y:). So, netbeans things I'm developing locally, whereas I'm actually developing remotely on a local mount. My problem starts when I want to use xdebug and net...

MySQL linking tables; some final issues

Firstly I want to thank all of you who have helped me understand Normalization and how I should build up my database. Now, I have some final issues left... How does LINKING of tables actually work? Say you have three tables: CATEGORY TABLE: cat_id (PK) -> 1 cat_name -> cars CATEGORY_OPTIONS TABLE: cat_opt_id (FK) -> 1 cat_id (FK) ->...

Alternative to dompdf (PHP Tool To Cnvert HTML+CSS To PDF) But in .NET?

From their site (Free Project On Google Code): http://code.google.com/p/dompdf/ dompdf is an HTML to PDF converter. At its heart, dompdf is (mostly) CSS2.1 compliant HTML layout and rendering engine written in PHP I need to have the same functionality in an ASP.NET website. Is there any good free alternative that can work wit...

How to validate multidimensional array in Zend ?

Hello ! I am wondering what is the best way to validate multidimensional array using Zend_Validate with Zend_FilterInput. Here is my current code: $filters = array( 'symbol' => array('StripTags', 'StringTrim'), 'mode' => array('StripTags', 'StringTrim'), ); $validators = array( 'symbol' => array('N...

jsonp -> json_decode()

for some reason I can't get the information out of a returned jsonp string, <?php // Created by Talisman 01/2010 ★✩ $vorto = $_GET['vorto']; // Get the Word from Outer Space and Search for it! if (isset($vorto)) { echo $vorto; } else { $Help = "No Vorto -> add ?vorto=TheWordYouWant to the end of this website"; echo $Help; } ...

How to replace text over multiple lines using preg_replace

Hi have the following content within an html page that stretches multiple lines <div class="c-fc c-bc" id="content"> <span class="content-heading c-hc">Heading 1 </span><br /> The Home Page must provide a introduction to the services provided.<br /> <br /> <span class="c-sc...

what is the best way to do that name?get=

ok assume i have php page has this name name.php?get= and has get varible named get ok how i can make it appear like that name?get= ...

Trouble with using Joomla templet with XAMPP 1.7.2 which has PHP 5.3.0 in mac os x

Hi! I am using a joomla templet with XAMPP 1.7.2 which has PHP 5.3.0 in mac os x 10.5.7 i am having lots of trouble like Deprecated: Function eregi() is deprecated in /Applications/XAMPP/xamppfiles/htdocs/templet01/plugins/system/tbox.php on line 98 Joomla itself is not functioning properly. Please help. -Daniel ...

whats wrong with this MYSQL QUERY?

$sql = "UPDATE site_ayarlar SET site_baslik = '$_POST[site_baslik]', site_slogan = '$_POST[site_slogan]', meta_desc = '$_POST[meta_desc]', meta_key = '$_POST[meta_key]', meta_auth = '$_POST[meta_auth]', meta_copy = '$_POST[meta_copy]', meta_robots = '$_POST[meta_robots]' "; and error is Parse error: syntax error, unexp...

Patterns for PHP multi processes?

Which design pattern exist to realize the execution of some PHP processes and the collection of the results in one PHP process? Background: I do have many large trees (> 10000 entries) in PHP and have to run recursive checks on it. I want to reduce the absolute execution time. ...

Filename regex extraction

Hi, I'd like to get parts of the filename filenameblabla_2009-001_name_surname-name_surname I'd like to get: 2009-001, name_surname, name_surname I've come up with this, but it's no good preg_match("/(?:[0-9-]{8})_(?:[a-z_]+)-(?:[a-z_]+)/", $filename, $matches); Any pointers? Thanks! BR ...

auto increment for simpleXML

Hi I have my simpleXML script creating new element's in a xml file but I need the attribute to be a auto incremented id for example <gig id="1"> <date>December 19th</date> <venue>The Zanzibar</venue> <area>Liverpool</area> <telephone>Ticketline.co.uk</telephone> <price>£6</price> <tim...

How to convert 2010-03-01 to Unixtime

How can i convert 2010-03-01 to unixtime like 1267452738 ...