php

IE warning workaround? Page w/Secure and insecure items

I have a page that is viewed secured with 'https' in the URL, that also contains youtube urls to play video from youtube. Since the youtube URL contains 'http' with no 's' IE is giving an a warning dialog of "This page contains both secure and non-secure Items." Is there a way I can workaround this in Javascript? Maybe after the page...

Differences among the methods of loading an extension in PHP

extension="ext.so" zend_extension="/usr/lib/php4/ext.so" zend_extension_ts="/usr/lib/php4/ext.so" What are the differences? ...

php dropdown menu population

I'm trying to write a php script that will populate a second drop down menu based on the selection of the a primary drop down menu. i would like to use jquery to do all the non-page refresh stuff. but every thing that i find that exists out there is hard to understand and modify, do you know of anything that was well written and easy to ...

How do I do URL rewriting in php?

This is a double question: The correct answer will go to "How you do it in PHP" explaining if there is any advantage goes also counts if possible. I'm just curious because I really don't know and I see it a lot in webpages. Edit: I don't know the technical name, but for example here in stackoverflow: http://stackoverflow.com/posts/edit...

Google maps api database interaction

I am currently working on a project where users need to be able to enter geological data (such as a certain street name) into a website which will be put into a database and then retrieved and displayed on a Google map for all users to see. I've done a little research and so far it looks like the best way to do this is to use a php scri...

Cookies PHP

How would I "build-in" an autologin to this script? if (isset($_POST['login'])) { $query = mysql_query(" SELECT * FROM users WHERE user_name = '".mysql_real_escape_string($_POST['username'])."' AND user_password = '".mysql_real_escape_string($_POST['password'])."' "); /* wrong login information? terminate t...

Base 64 encode vs loading an image file.

So I am working on something in php where I have to get get my images from a sql database where they will be encoded in base64. The speed of displaying these images is critical so I am trying to figure out if it would be faster turn the database data into an image file and then load it in the browser, or just echo the raw base64 data and...

get pointer position in a php while mysql_fetch_array function

I've got a fairly standard while mysql_fetch_array statement in php, and I'm trying to figure out which row in the result set is being printed. I figured this should be pretty simple, but I've put a fairly standard $i=0; $count=mysql_num_rows($getResults); while($resultArray=mysql_fetch_array($getResults)){ $i++ if($i==$count){ ech...

php - auto select drop down menu based on parameters in browser link

If in the browser I have parameters like: http://localhost/specials.php?year=2009&amp;make=honda&amp;model=civic and the dropdown looks something like this: <select name="year"> <?php $query = mysql_query("select distinct year from tbl_content where year = '$year'"); while($row = mysql_fetch_assoc($query)) { echo "<option value=\"{$...

Regex http/www to links

How would a regex look that makes text that starts with either http or www clickable? My current bbcode: function bbcode($text) { $text = htmlspecialchars($text); $text = nl2br($text); $find = array( "'\[b\](.*?)\[/b\]'is", "'\[i\](.*?)\[/i\]'i", "'\[url\](.*?)\[/url\]'i" ); $r...

PHP No response Issue

I have this piece of code I'm trying to get to display but no matter how I do it I just don't get any response or error whatsoever. <?php $day = array("Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"); //$month[]= array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre"...

simple php script using 1MB+ memory

I have a really simple PHP script here,which simply loads several libraries (6 or 7 small classes) and initialize some variables then generate a very small amount of html code. But seeing from the memory_get_usage() function, I see 1.21MB memory usage. Is that normal or something is wrong? ...

Python or php which language would be better for web development?

Python or php which language would be better for web development? ...

PHP Arrays, appending count of array items recursively to an array

Pointless Dribble Okay This is another weird one from me, i want to thank OIS for helping me out on my last question... which deals with this same kind of funky array manipulation... i studied that code in depth and i feel it has helped me become better with recursive array manipulative functions. However, once again i find my self in ...

retrieve a multi-column PK in MySQL

How do I retrieve a multi-column PK in MySQL? For example I have my primary key setup as PRIMARY KEY (donor_id,country_id) Now if I want to get the primary key value without concatenating those 2 fields in a select query, how do I do that? I want to use this in a view (or better yet, directly in phpmaker). ...

C# & PHP: Simple example of PHP Web Service used by C#

Could anyone give me a small and simple example of how to do this? Or some good pointers on how to get started. I would like to create a C# client that can send a file or some text or xml or whatever, to a web service or something similar written in PHP, where the PHP Web Service stores it in a file or a database or something like that....

Tips on signed cookies instead of sessions

I'm considering ditching PHP's $_SESSION (i.e. the server-side session handling, to add some language-agnostic flavor) and using signed cookies instead, since I've heard so much good about them (Flickr uses them, so they ought to be good enough for me too). I understand the basic context of the technique: Use cookies freely to pass key-...

Is my understanding of PHP sessions correct?

I've been interested in how sessions work internally, but I have little knowledge of C (and am unsure where to look in the PHP source for this). This is what I understand of sessions at the moment: When you start a session the user gets assigned a session id which is stored in a cookie. When session data is saved (via $_SESSION) it is...

Checking to see if one array's elements are in another array in PHP

Hi, I have two arrays in PHP as follows: People: Array ( [0] => 3 [1] => 20 ) Wanted Criminals: Array ( [0] => 2 [1] => 4 [2] => 8 [3] => 11 [4] => 12 [5] => 13 [6] => 14 [7] => 15 [8] => 16 [9] => 17 [10] => 18 [11] => 19 [12] => 20 ) How do I check if any of the People...

Zend Framework, run query without a view?

Hello, I am currently building a small admin section for a website using Zend Framework, this is only my second time of using the framework so I am a little unsure on something things. for example are I have an archive option for news articles where the user will hopefully click a link and the article will be archived however I cannot w...