php

Two drop down lists in Ajax and MySQL

I'm trying to learn some Ajax and MySQL... Basically, the code that I have right now is similar to: http://www.w3schools.com/PHP/php_ajax_database.asp I was wondering how should I modify those codes (both html, javascript and php) to create two drop down lists. The first drop list would be used for choosing the Lastname (eg. Swanson) a...

PHP functions vs includes for site template

What is the best, easiest, and fastest way to use a template for a page. Right now I have been using a function to create my template for each page. $title = "Kick Me"; <?php pageHtmlHeadStart($title)> <!-- Were Javascript would go --> <?php pageHtmlHeadEnd(); guiHeader(); ?> Content went here. <?php guiFooter; ?> I uses to ...

What's the prefix for binary in PHP?

It's neither 0x nor 0,what's it?Is there? ...

Form contents not showing in email

This is a followup to a question I posted yesterday. I thought everything was working fine, but today, I am not getting any results in the email from the drop down field. Here is the form code in question: <form method="post" action="contact.php" name="contactform" id="contactform"> <fieldset> <legend>Please fill in t...

advanced xml? multi level .. php parsing

hi my knowledge of xml and php is somewhat basic but have been able to parse a simple xml document (one level) ~ <numbers> <number>1</number> <number>2</number> </numbers> i'm attempting to parse an xml document from a website providing the latest market prices for gold bullion. I think i'm going to need a paid professional but...

javascript to print all tables and individual tables

I am retrieving values from a database and displaying it a table using php. Each table is stored inside a div tag. <div id="print"> table content 1 </div> <div id="print"> table content 2 </div> .................. Can some one please suggest a javascript where i can get a separate link/ button that will print all the tables and a lin...

Web framework for an application utilizing existing database?

A legacy web application written using PHP and utilizing MySql database needs to be rewritten completely. However, the existing database structure must not be changed at all. I'm looking for suggestions on which framework would be most suitable for this task? Language candidates are Python, PHP, Ruby and Java. According to many sources...

Jquery qtip ajax issue

Hi All, I am trying to post the value of an input box (In this case a imdb link) to my imdbgrabber.php page and have it return the info of that movie into a qtip box. EDIT: View here http://movieo.no-ip.org/ Hover the images and you will see the error. Everything works fine until i try and post the variable to the imdbgrabber page. Th...

php import utf-8 txt file to latin1 database

I have an UTF-8 encoded txt file and I want to import it to latin1_general_ci table. Problem is that some characters display as ? in database and not as they supposed to. I tried mb_convert_encoding($str, "ISO-8859-1", "UTF-8"); but that didn't do anything. What am I doing wrong? ...

Error: "Input is not proper UTF-8, indicate encoding !" using PHP's simplexml_load_string

I'm getting the error: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xED 0x6E 0x2C 0x20 When trying to process an XML response using simplexml_load_string from a 3rd party source. The raw XML response does declare the content type: <?xml version="1.0" encoding="UTF-8"?> Yet it seems that the XML is not really ...

Mysql SELECT with an OR across 2 columns

I'm creating a 'similar items' link table. i have a 2 column table. both columns contains product ids. CREATE TABLE IF NOT EXISTS `prod_similar` ( `id_a` int(11) NOT NULL, `id_b` int(11) NOT NULL ) INSERT INTO `prod_similar` (`id_a`, `id_b`) VALUES (5, 10), (5, 15), (10, 13), (10, 14), (14, 5), (14, 13); I want to select 3 ...

Google Chrome Cookie Issues

I'm testing a site I've built using the latest build of Chrome on Windows 7 and for some reason it is having issues with cookies. From what I can tell the cookies are being set correctly by the php script but then fail some basic validation in my script on the next page load and are then reset to the default setting. What is baffling is...

Problem PHP with cURL

hi i have a problem with cURL and php. I use an API and i want to display only the results. Here is my php + curl script <?php $file = "http://api.openkvk.nl/php/".rawurlencode("SELECT * FROM kvk WHERE kvks='20147376'"); $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt...

Caching one section of a CodeIgniter page

I'm using codeigniter to create a web app. I'm creating the drop down menus in the header. These are included on every page using load->view(). To populate the menus some quite complex SQL is used. The contents on the menu will change infrequently (once/twice a week), whereas the rest of the data on the page is constantly changing. Ther...

Get the timestamp of exactly one week ago in PHP?

I need to calculate the timestamp of exactly 7 days ago using PHP, so if it's currently March 25th at 7:30pm, it would return the timestamp for March 18th at 7:30pm. Should I just subtract 604800 seconds from the current timestamp, or is there a better method? ...

How to integrate Doctrine 2 (alpha release) and Zend Framework

Hi, I want to integrate doctrine 2 with zend framework 1.9. Please give me some link or some tutorial to integrate doctrine 2. I have worked doctrine 1.1. But now I want to integrate doctrine 2. I think which have some different approach to add doctrine 2. Thanks Raju Mazumder ...

Give people a price on my website when they join my facebook network

I was wondering if it is possible to give people something when they join my network on Facebook. I am working on an website where people have to buy credits to get certain services. I want to give them 3 free credits when they join the group on Facebook. Is this possible? I am also new to Facebook, so i don't know what to create. Sho...

Redirect to a page that uses basic authentication [PHP]

I'm trying to redirect to a page that uses basic authentication, with no success so far. Most examples I found online where to either use fopen or curl to request a resource, which I don't want to do. I've tried putting in the header the "Authorization: Basic" plus the encoded user:password, but it didn't work. Is it because I first ne...

CodeIgniter htaccess Redirect

Hello, I'm hoping that this will be a simple question that someone can answer. I'm looking to build a CodeIgniter application that I can build pretty easily in regular PHP. Example: I would like to go to http://locahost/gregavola and have rewritten using htaccess file to profile.php?user=gregavola. How can I do this in CodeIgniter? U...

iphone location works in simulator with local code but not on server?

so this is really weird to me but my code works properly for getting the geolocation if I run my code locally in the simulator, If I have the code on my server it does not work in the simulator, yet the same url and code on my server works on my actual iphone? It seems to not pick up on the geolocation javascript when its on my server in...