php

More then filtering, less than captcha

I've set up a PHP standard contact form asking for name, email, comments. The processing part of the form sanitizes the data and makes sure only a single email is entered, etc. Still, I tend to get data filled out like so... // ------------------ GARBAGE STARTS Name: PQctQCulKkDyDIWrFsP Email: [email protected] Message: 5DPKep qbkb...

PHP fixed arrays of data...performance issues

Hello I have a telephone area code to Time zone array of several hundred elements. Is this array built at run time or at compile time. John ...

JQuery - Pass variables to PHP script via AJAX call and then display file

Hiya, I'm trying to generate Outlook event files for my events, doing so on the fly as and when someone requests it by pressing a link on the page. Here's what i've got so far, but I can't find out how to get the browser to download the content which is returned. I know how I could do this if I sent everything via _GET, but I'd prefer...

Consuming PHP webservice method with a boolean return value with .NET

I have a PHP SOAP (NuSOAP) web service method that returns a boolean value. I've executed the method in a 3rd party test application, and it seems to return the value fine. If I look directly at the XML message that's returned, it looks fine as well - returns "true" and "false" when it's supposed to. However, when I write a sample appli...

Gmail removing the links tags , how to avoid this

I'm trying to send with function mail(); rich text containing links ; I'm sending this kind of code... Please, access <a href="http://www.site.md/contact/en/"&gt; Contact </a> to send all these information throw firebug i can see that link tags was removed , code becoming like this Please, access <a>Contact</a> to send all these...

PHP SimpleXML recursive function to list children and attibutes

I need some help on the SimpleXML calls for a recursive function that lists the elements name and attributes. Making a XML config file system but each script will have it's own config file as well as a new naming convention. So what I need is an easy way to map out all the elements that have attributes, so like in example 1 I need a simp...

Can I rely on mod_rewrite?

I'm building a small PHP framework for the websites I create and wanted to know if I can rely on mod_rewrite being availabe on most hosters. Is ist even a good idea using it? There are many good points already (one entry point, "beautiful", readable URLS) Where is it not availabe? Should I include an alternative in the framework if mo...

How do I pass a variable from JavaScript (Google Maps API) to my Form Input

Hi, There maybe some simlar questions to this but I can't see anything that really solves my problem. I would like to pass the contents of a variable in JavaScript either into a PHP variable or a html form value. Cheers, knowing how to do both would be very helpful. ...

how does soundcloud.com generate the waveform for their excellent mp3 player?

i would like to make a similar application but am struggling on how to generate the image of a waveform - are there any php libararies i can use, or perhaps something i can run from in linux to generate waveforms from an mp3? thanks :) ...

How to handle mysql's error on duplicate entry?

Sometimes when there's an entry about to be added to the database it failed because it's a duplicate entry, an error shows up. So, how to handle this error with the help of php? ...

Like and Where in the same MySQL query

I would like to use something like the following: SELECT city FROM cities WHERE city LIKE %D% AND country_id = '12' ...

How to remove or avoid inserting column headers when importing a separated value file into a database using PHP?

I have semicolon-separated .dat file and I want to read that file and store its contents into a database. Structure of .dat file: PARTYID;PARTYCODE;CONNECTION 256;319;234 879;435;135 SQL to import the .dat file: $sql_qry = "INSERT INTO DatTable (PARTYID,PARTYCODE,CONNECTIONID) VALUES ('$data[0]','$data[1]','$...

PHP & Mysql: optimize database

I have a database that has over 10,000,000 rows, querying it right now can take a few seconds just to find some basic information. This isn't preferable, I know that the best way to optimize is to minimize the number of rows which is possible but right now I don't have the time to do this. What's the easiest way to optimize a mysql dat...

PHP mail function, whats wrong here?

The following code sends me an email holding the following variables. One of the last if statements says if(mail) then echo "You will be contacted soon". When the script runs I get echoed back "You will be contacted soon", however, I never receive an email. I do have a smaller contact script (posted after this first and larger one) that...

how to remove a tag and its contents using regular expression?

Hi $str = 'some text <MY_TAG> tag <em>contents </em> </MY_TAG> more text '; My questions are: How to retrieve content tag <em>contents </em> which is between <MY_TAG> .. </MY_TAG>? And How to remove <MY_TAG> and its contents from $str? I am using PHP. Thank you. ...

Account email verification - what to check for?

I have it working to a point where I think it's usable and I'm quite happy with it. With that said, I noticed a few things. Most if not all places validate against email or username along with an auto-generated hash code that's X chars long. The URL I send the user looks like the following. http://www.example.com/account/confirm/bob/cbv...

How do I get started building a web app?

Hi All, I want to build a PHP web app which will start with a login page and then move from page to page, displaying data from MySQL table in a tabular format, logout, deals with session etc. Is there any reference that walksthrough/tutorial that does all these tasks? I have seen topics from each of those tasks but separate, is there an...

PHP: Proxy another url

I have a mod_rewrite rule that will send any subdomain requests to a php script which should proxy those requests to another host (internal proxy, not 302). I'm close, in that my script works with web browsers, but curl seems not like it: curl: (56) Received problem 2 in the chunky parser Here is my mod_rewrite: RewriteCond %{HTTP...

How do I solve this error? Trying to call data from a public

I'm trying to call data from the Google Calendar API with help from this tutorial and it's returning getting a php error: Fatal error: Call to undefined function: simplexml_load_file() in \NAWINFS02\home\users\web\b872\rh.urbanpromise\new\loadcalendar.php on line 9 The server is running PHP Version 4.4.8 System: Windows NT IIS015...

Why wont this sort in Solr work?

I need to sort on a date-field type, which name is "mod_date". It works like this in the browser adress-bar: http://localhost:8983/solr/select/?&amp;q=bmw&amp;sort=mod_date+desc But I am using a phpSolr client which sends an URL to Solr, and the url sent is this: fq=+category%3A%22Bilar%22+%2B+car_action%3AS%C3%A4ljes&version=1....