php

how to pass array variables based on condition to php using post method

I have an array: $k[23]='something'; $k[44]='something more'; If a user enters 2,3 and presses 'go' in a virtual 10 digit keypad (will look like a calculator), I need to pass 'something' to browse.php. If the user press 4,4 and press go, then i have to pass 'something more' to browse.php. Any ideas? I am new to javascript/php ...

Extracting images from RTF using PHP?

Hello, I'm just wondering if anyone has any experience doing this? All of the resources I have seemed to find on the internet deal with doing the opposite (inserting images into RTFs), but it seems like extraction isn't that popular of a notion? Basically, I'm just wondering if it's possible to upload an RTF file using a form, and dump...

What security problems could come from exposing phpinfo() to end users?

If a phpinfo() dump is shown to an end user, what is the worst that a malicious user could do with that information? What fields are most unsecure? That is, if your phpinfo() was publicly displayed, after taking it down, where should you watch/focus for malicious exploits? I'm wiki'ing this up, so that we can compile answers. ...

mySQL images upload

I need a simple code to upload images to mySQL using PHP... short! snippet... and is it possible to upload an html, css file to mySQL?... its reason is complicated but all answers are appreciated!... EDIT:: say I have 1000 users.. and they each have their own layout for their page.. So inside their MYSQL record will be a html file, css f...

Reverse order on output of custom values

I am pulling out values from a series of custom fields named thumb: <?php $mykey_values = get_post_custom_values('preview'); foreach ( $mykey_values as $key => $value ) { echo "<img src='$value' width='590' />"; } ?> How do I reverse the order of the output? ...

Is there a way to add Facebook Like buttons to lots of products?

I know how to add a Facebook like button for a group or page, but is it possible to add a like button to every product in a web store without having to create a group or page for each product? This was originally asked on StackExchange Web Apps Private Beta here. ...

PHP/HTML Show dropdown of country calling codes

I need to show a dropdown menu with the international calling codes for each country. Where can I find such a drop down???? ...

Magento multi-currency w/multiple stores

Hi, We've got a Magento store setup with prices in USD. We need to set it up so that people can also buy in CAD. Problem is CAD prices need to be specific prices, they can't just use the exchange rate and USD. So I believe we would have to setup multiple stores to do this, correct? Any help docs or advice on how to do this? tha...

Using the same salt for multiple fields

I have a field in a row that I'm hashing and salting. The salt for each row is different. I decided to hash/salt a couple of more fields in each row. Would using the same salt for those new fields in the same row make the data more susceptible to rainbow attacks compared to if I were to generate a new salt for each field? My logic is t...

Wordpress Update Version

Hi, Wordpress checks periodically to make sure that the version of Wordpress being used is the most up to date available... If it's not, the latest version number is displayed in the footer and in a notice below the header. Does anyone know the variable/constant/option I can use to get this number? Thanks. ...

Need to remove ASCII character

I'm pulling some text from a database, which contains some carriage returns. When I put them straight into html, they get interpreted as � . I've tried a bunch of different ways to remove them, but haven't seemed to have any luck. Any thoughts? ...

How do i have Apache to do further handling of the error status set within the PHP script?

Hello! My environment is: shared hosting with PHP 5.2 installed as apache2handler I have ErrorDocuments configured: ErrorDocument 404 "Simply Not Found" # OR ErrorDocument 404 /errors/fancy-not-found.php # both variants works as expected However, most simple example from PHP manual doesnt want to cooperate with Apache2 and perform ...

Is it possible to dynamically merge one PDF with another using dompdf?

I am trying to take the raw data from a previously made PDF, and append it to a new PDF using DOMPDF. Is this possible? Thanks for any help,Metropolis ...

How to append _thumb to all media uploaded and media that is already uploaded to my wordpress blog

Hello guys, I was hoping to get some help on this one. I am looking to have appended to all images and media that get applied to a post via the upload tool in WordPress _thumb to the src of the media object. Thanks, Matt ...

GPS Info Sent to port 5556

Hi Everyone! I'm not sure if this is relevant to this site or not, if not I apologize. I have a GPS device that's transmitting its coordinates to my server on port 5556. I know that its succeeding at doing this because I installed netcat and its monitoring this port, it does return a string. How can I capture whats returning and utili...

Un-encrypting / re-encrypting a ColdFusion encrypted string in PHP

Hi there, I'm in the unenviable position where I have to maintain functionality with an existing ColdFusion application. As part of it's login process the Coldfusion app stores a cookie with an encrypted string. encrypt(strToEncrypt, theKey, "AES", "Base64") I can successfully decrypt this string in PHP using MCrypt and the followi...

Reasoning for alternate PHP syntax for conditional HTML

So, why does this work: <?php if (condition): ?> <!--html code here--> <?php endif; ?> But not simply this: <?php if (condition) { ?> <!--html code here--> <? } I figured it was just style preference, but I actually can't seem to get it to work the second way. Am I just doing something completely wrong? I can't see the ...

Is there a JavaScript function to serialize and unserialize arrays like PHP?

I'm making a PHP model to store a serialized array in a database. The array is then accessed via AJAX through an HTTP request. Is there a JavaScript function to serialize and unserialize arrays like PHP? EDIT: This is the php function http://uk.php.net/manual/en/function.serialize.php ...

if statement in php form and form output

I am creating a order form for a meat locker company that sends the form to their email. There is a lot of where if you select one item you can not select another item; such as t-bone and New York Strip, you can have one or the other, but not both. Here is what my code looks like. <P>T-bone steak <input type="radio" name="T-bone and NY"...

Replace a string from a submission with an empty string if string is present

I have tried many combinations and a few different PHP functions, but I still can't figure out why it doesn't work. Here's the deal.. If someone uses the form and the (in this case) "Title" field ends with " (Part 1)", I want to delete that string, and if it doesn't contain " (Part 1)" I want to set a variable to the Title as it was sub...