php

SQL wont work? It doesn't come up with errors either

Hey there, I have php function which checks to see if variables are set and then adds them onto my sql query. However I am don't seem to be getting any results back!? $where_array = array(); if (array_key_exists("location", $_GET)) { $location = addslashes($_GET['location']); $where_array[] = "`mainID` = '".$location....

PHP/Javascript limiting amount of checkboxes

Hi everyone Im trying to limit the amount of checkboxes that can be checked, in this case only 3 can be checked. When using plain HTML this works fine. The code can be seen below. HTML example <td ><input type=checkbox name=ckb value=2 onclick='chkcontrol()';></td><td>Perl</td> Javascript Function <script type="text/javascript"> ...

Display swf from another website into a div.

I’m trying to display a swf from another site into mine. I’ve got permission from the other side to do so I’m just having problems figuring it all out. I’d like to display just the swf not the entire page that swf is on. I’ve tried this – but it only seems to work with content and I haven’t had any luck getting the swf to appear. <?p...

PHP and MySQL - posting double entries

Hello, I am trying to post a form with two fields (name and email) into a MySQL table. On local server (my laptop), it works just fine. But on production server, it is posting twice! I can't figure out why. Here is the code: $name = ucwords(strtolower(trim($_POST['name']))); $email = strtolower(trim($_POST['email'])); $mysqli = ...

mysqldump generating an empty file

Hello all! Im trying to use mysqldump like below: mysqldump -hlocalhost -uadmin -padmin shop> D:\b2\shop3.sql When i execute it in command prompt, the file shop3 is generated with all the tables from the shop database. But, when I use it in my php file like below, it generates an empty file. $cmd = 'mysqldump -hlocalhost -uadmin -pad...

How to implement this cache control policy in PHP?

Serve the new content only if the file has changed since last visit. How do I implement that? UPDATE Sorry not to mention it earlier,but the requested resource is web page which is requested directly,not an image. ...

How do I go up a level in a doc root?

I have a folder admin that has config.php, admin.php. I want to get navmenu.php in the includes folder. How do I go up a level from admin.php then to navmenu.php? admin config.php, admin.php includes navmenu.php easy question but I forgot what the name is so i can't seem to google it... ...

(Pathinfo vs fnmatch part 2) Speed benchmark reversed on Windows and Mac

On a previous question the pathinfo and fnmatch functions were benchmarked and the answers all came out opposite to my benchmark results. You can read the different results with the benchmark code here: http://stackoverflow.com/questions/2693428/pathinfo-vs-fnmatch I couldn't work it out until I ran the same code on a machine running v...

How to prepare Cyrilic and other variables for storing into MySql DB? (PHP)

How to prepare Cyrilic and other variables for storing into MySql DB? (PHP) So I need realy simple way to prepare recived from browser $_GET[string] variables for storing into DB. How to do such thing? ...

how to set the background image property of a div to a dynamically generated image

I have some divs and each one has its own background image. The base images as stored is just a black silhouette. What I would like to do is use the PHP GD package to modify the color of those images somewhat randomly and have the modified randomly coloured images be the background images of the divs. One way to do it is just crea...

Displaying Array in Select - FORM API Drupal

Hi: I want to add key(type_id) and value(type_description) to select in drupal form API $result_x->product_types->RPMProductType is array result from Database :- array(4) { [0]=> object(stdClass)#18 (2) { ["type_description"]=> string(10) "Calendered" ["type_id"]=> int(1) } [1]=> object(stdClass)#19 (2) { ["type_description"]=> s...

WML And Downloads

I'm now playing with WML and WMLScript, but I'm doing a site that will have some content to download(some txt, doc, bmp, mpg, avi and jpg files), but some of my friends(that never developed in this language, just used the technology on the beginning) said that it's impossible. Then here are my questions: It's possible? How to do it? ...

How do I convert html pages into a single .chm file using PHP?

Is there a library for this task? ...

Warning: sprintf() [function.sprintf]: Too few arguments in /home/inrunitc/public_html/chek/chek.php on line 132

Warning: sprintf() [function.sprintf]: Too few arguments in /home/inrunitc/public_html/chek/chek.php on line 132 Query was empty I am new to PHP and mysql and I have like 88 fields in my form - what should I do ? ...

Adding a date every few days

I have some code that generates fixtures, I am looking to add a fixture date to the code. $totalRounds = $teams - 1; $matchesPerRound = $teams / 2; $rounds = array(); for ($i = 0; $i < $totalRounds; $i++) { $rounds[$i] = array(); } for ($round = 0; $round < $totalRounds; $round++) { for ($match = 0; ...

Rookie PHP question

I am hacking together a theme for wordpress and I am using the following code to pull out data from a custom field with several values: <?php $mykey_values = get_post_custom_values('services'); foreach ( $mykey_values as $key => $value ) { echo "<span>$value, </span>"; } ?> I use a comm...

adding additional items in a ecommerce application to save in session.

hi, i want to use this site as a reference to explain what im trying to figure out. http://www.shop-script.com/demo/store/index.php?lang=eng if you select a product then enter a value higher than 1 for the quantity of a product that you want then press add to cart. i know that this information goes into a session but how is it added? ...

Why is Safari and Chrome not displaying my gif, but a blue question mark?

I am displaying the following html to my browser (firefox works, however chrome and safari are not). What is displayed below in firefox is working as intended, but safari and chrome are displaying a blue question mark with a box around it. <html> <head> <title>test</title> </head> <body> <img src='pixel.php' /> </body> ...

How to delete drupal's unused core modules correctly?

Hi I want to delete the unused drupal modules like ( blog, Forum, taxonomy ...) but I'm worried if I delete the modules from the modules directory I might cause an error (now or in the future) . is it safe? and if I deleted the corresponding tables what will happen? the reason for this is because I want to deliver the site to my clien...

SEO friendly url on php

i need to convert this type of url yourdomain.com/username/listings/id1/ to this yourdomain.com/username/listings/listing-name Can i get some advice? Thank you! ...