php

Pass a php variable to dynamically generated div's onclick event

hi, how to pass a php variable to dynamicaly generated div's onclick event? here is my code while($rowset = mysql_fetch_array($result)) { $idTT1++; $editTT='b'.$idTT1; $hidTextTT='t'.$idTT1; $hidSubIdTT='s'.$idTT1; echo "<tr><td>".$rowset[1]." ".$rowset[2]."</td><td> &nbsp; </td> <td class='table_label'> <...

Insert HTML to DB via form using php

Greetings, I'd like to insert html via a form into my database using php. Can anyone please tell me what function I can use to ensure something such as <p>This is a test</p> <h1>Turns up correctly</h1> Turns up in the database correctly. Right now when I do an insert the special characters are replaced with the HTML special charact...

How to handle Frameset, POST & Re-Direct

I am using FrameSets to divide screen into two panes. The left pane displays links whereas the right pane displays the actual pages. I want to know how to handle the issue when an entry Form is opened on the right-pane and submitted. When I submit a Form, the action is passed to another .php file, which saves the records into MySQL data...

CakePHP dropping session between pages

Hi, I have an application with multiple regions and various incoming links. The premise, well it worked before, is that in the app_controller, I break out these incoming links and set them in the session. So I have a huge beforeFilter() in my *app_controller* which catches these and sets two variables in the session. Viewing.region and...

Linked pulldown lists using MySQL, PHP/JavaScript/Ajax/jQuery

I am quite new to web development and have a task to develop a web application that will basically show the user 5-15 pull down lists on one page, where each selection will limit the choices in all other lists. The user should be able to start with any one of the lists (so no set selection order) and when the user have selected something...

How to POST without using Submit?

I want to post the Form but don't want to use the Submit method. If I use JQuery, how to handle the Form input controls? ...

PHP simple translation approach - your opinion

I am doing a PHP web site, without using any framework. I need that the site is available in several languages, and I was reading about it and it seems to be a little bit confusing. There are several solutions but all seem to depend on a specific framework. What you think of using a simple translation function like the one shown below? ...

access namespace element/attribute in xml/atom document with simplexml

Hello, I may have a simple question, I need to know how to get to nested namespace attributes/elements like below <gf:marketValue> <gd:money amount='150990.0' currencyCode='USD'/> </gf:marketValue> this is from the google-api Also, I am now not sure wich one I should use the url .../portfolio or portfolio/1/positions to get t...

Getting started with PHP and Expression Web

I want to build a basically interactive website with these tools. I need to make a navagation bar with a submenu. Ex: Services then when mouse is over Services it looks like: Services boo foo I'm familiar with adding css styles, i'm just not sure about sub menus. On the php side of things, I want people to select from the ...

Best update query for mysql table

Hello, I have a file hosting site where I provide a point for every unique download to user. Sample of my table These points can be redeemed by user. So for example if a user redeems 100 points than what is the best query to reduce points available from each row till 100 points are reduced. Thank You. ...

Properly Matching a IDN URL

I need help building a regular expression that can properly match an URL inside free text. scheme One of the following: ftp, http, https (is ftps a protocol?) optional user (and optional pass) host (with support for IDNs) support for www and sub-domain(s) (with support for IDNs) basic filtering of TLDs ([a-zA-Z]{2,6} is enough I thi...

Mysql ucfirst doesn't work.

Hello everyone, I have this table: CREATE TABLE IF NOT EXISTS `events` ( `evt_id` int(11) NOT NULL AUTO_INCREMENT, `evt_name` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT 'ucfirst', `evt_description` varchar(100) DEFAULT NULL, `evt_startdate` date NOT NULL, `evt_enddate` date DEFAULT NULL, `evt_starttime` time DEFAULT NU...

php header() problem

here is my code if($register){ header("Location: http://mydomain.com/userarea"); exit(); } that if user is registered successfully it is redirected to userarea but after registering it stay on signup page but if i refresh the page it is redirecting me to userarea but i want to redirect the user on signup automatically.....how can i so...

PHP preg_replace or str_replace

I have some text, something like this: Paragraphs of text (SOME KNOWN TEXT)Unknown Text(SOME OTHER KNOWN TEXT) Some additional paragraphs of text What I want is to keep the Unknown Text, but get rid of the (SOME KNOWN TEXT) and (SOME OTHER KNOWN TEXT). I think the preg_replace will give me what I want, but I need the regular expressi...

get_headers() Redirection limit reached, aborting. failed to open stream: Operation now in progress

hello. trying to write a functional php script to detect charset retrieve web pages. My script works, but if I enter get_headers () for webtrh.cz/66997-fakturace-ramci-dph?p=416206 get_headers(http://webtrh.cz/66997-fakturace-ramci-dph?p=416206); the result: get_headers() [function.get-headers]: Redirection limit reached, aborting. i...

Basic authentication and session management library for PHP?

I know questions like this have been asked numerous times, but not quite this one. Forgive me if I overlooked an obvious duplicate. In the core of many of my web applications is a self-written user/session management class that in its origins dates back to 2002. I have decided that it is time for a fundamental re-write or, preferably, t...

jQuery autocomplete special character (Norwegian) problems

I'm using jQuery's autocomplete function on my Norwegian site. When typing in the Norwegian characters æ, ø and å, the autocomplete function suggests words with the respective character, but not words starting with the respective character. It seems like I've to manage to character encode Norwegian characters in the middle of the words, ...

Wordpress: wp_get_attachment_thumb_url

There seems no way of referring to the "big size" "mid size" or "small size" image in a theme. Compounding that problem is their naming convention of 100 x ??? file name format, preventing hard coding a reference. Does anyone know of any solutions? ...

Put a function in an XML field

Is it possible to put a function in an XML field? For example i have the following xml file: <?xml version="1.0" encoding="utf-8" ?> <prova> <prova> <continente>Europa</continente> <stato>Italia</stato> <societa>SSC Napoli</societa> <actual>1.09769</actual> <estimate>0.447969</estimate> </prova> <prova> .... </prova> </prova> I...

Trying to understand the "Vary" HTTP header

I use PHP to generate dynamic Web pages. As stated on the following tutorial (see link below), the MIME type of XHTML documents should be "application/xhtml+xml" when $_SERVER['HTTP_ACCEPT'] allows it. Since you can serve the same page with 2 different MIMEs ("application/xhtml+xml" and "text/html") you should set the "Vary" HTTP header ...