get

PHP safe $_GET or not

We have url: http://site.com/index.php?action=show $_GET['action'] is used in templates to check value of ?action=: switch ($_GET['action']) { case = "show" { $match_show = true; } } and in other place: echo $_GET['action']; Is it absolutely safe to use this constructions? How to make them safe? Thanks. ...

using php to populate textarea with css file

Hi I'm sure this is possible in php. I have several css files located in a folder on my server. I wish to list these files in a drop down menu located on a php page. When the user selects one of these files in the dropdown, a textarea on the same page is populated with the source code of that css file. Struggling with this one, any he...

Android - Read an XML file with HTTP GET

I need to explore for my project use of web services on Android. I know that there is no official library for XML - RPC web service. But there is for REST XML and i need to test it. I would like to read XML on my web page (Where i have to pass username and Password) from Android with HTTP GET. OR Suppose, i follow This link, then...

Get content within a tag using Javascript from HTML

I want a javascript code which will go through all the html file in my root folder and sub-folders and gets the content which are within a particular tag, eg: <div id="content"> !!this content!! </div> It should check for a comment at the top of html and only get the content if it exist. <!--Allowed--> It should only get if thi...

Get content within a html tag using php and replace it after processing

I have an html (sample.html) like this: <html> <head> </head> <body> <div id="content"> <!--content--> <p>some content</p> <!--content--> </div> </body> </html> How do i get the content part that is between the 2 html comment '<!--content-->' using php? I want to get that, do some processing and place it back, so i have to get and p...

How to create a Profile URL for a user using $_GET['id']

Hello, Can someone advise me if I am performing the below steps correctly: When a user wants to register on the website, register.php handles his/her request. Below is some of the code from register.php: $sql="INSERT INTO Members (fldFullName, fldEmail, Password, Gender, DOB) VALUES ('$fname','$email','$pass', '$gender', '$date')"; ...

how to check if $_GET is empty?

Hi , how check if $_GET is empty ? ...

Perl equivalent of PHP's get_file_contents() ?

The following PHP code does exactly what I want to do. The problem is I need to re-create it in Perl and I've been playing around with the open() and sysopen() Perl functions but can't do it. Does anyone have any help or know of any links that might help? Thanks. $URL = "http://example.com/api.php?arguments=values"; echo file_get_conten...

getting pixel data/modifying it

Ok so what I am trying to do is get an image from the camera roll, displaying it through the image view, and then getting some pixel data and modifying it (change brightness levels through the RGB values of the pixels). I'm a beginning dev and I can't seem to really get the hang of CGImage to actually get the pixel data. Could anyone hel...

My navigation won't get &type=, what's wrong?

I have this for navigation, and when I switch to page 2, it will lose the &type= Let's say I select "checked", the first page it shows fine, as it het the whole string, but when I switch pages it loses... here's the code: // navigation if($_GET['start'] && is_numeric($_GET['start'])) { $start=$_GET['start']; $start=((int)($s...

PHP foreach($_POST as $key => $value) windows server 2003 IIS 6 problem

In my database connection include I use the code foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } foreach ($_GET as $key => $value) { $_GET[$key] = mysql_real_escape_string($value); } This runs fine on my linux testing server (Cent OS 5.5) however, when it is transferred to the productio...

Java - Sending a GET or POST request

Just like you would with a regular form using XHTML... can someone give me an example of sending a POST or GET request using PHP? Like game.php?user=Dan&lvl=43&coins=54 and then the game.php page would do it's magic with the $_GET tag and do Mysql stuff. :P Thanks, ...

Sending ampersand in GET

I have a drop box which is populated by information from a database. Some of the items have ampersands in them. When the drop box is changed, there is some ajax done, and this includes sending the info from the drop box in a GET. An ampersand in the name of the item from the drop box messes up the URL for the GET. For example, here is a...

HEAD request receives "403 forbidden" while GET "200 ok"?

Hello, after several months having the site disappear from search results in every major search engine, I finally found out a possible reason. I used WebBug to investigate server header. See the difference if the request is HEAD or GET. HEAD Sent data: HEAD / HTTP/1.1 Host: www.attu.it Connection: close Accept: */* User-Agent: WebBug/...

$_GET is empty when the url has variables

Hi. I have a url that look like this reg.php?lang=no_NO&passkey=testand im trying to get the passkey variable, but it keeps showing up blank. When I try print_r($_GET); it prints Array ( ) ?! How can this happen? The site look something like this <?php print_r($_GET); include('..\libs\Smarty.class.php'); ?...

Saving a file using libcurl in C

I'm expanding from perl to C and I'm trying to use curl's library to simply save a file from a remote url but I'm having a hard time finding a good example to work from. Also, I'm not sure if I should be using curl_easy_recv or curl_easy_perform ...

$_GET shows up blank when called from a php file within iframe

Hi. I have a a login in script that is a little to complicated for my own good. I have a php file that calls a javascript based on the $_GET variable. The javascript/jquery makes html that uses iframe to call another php file, but I need the $_GET variable in that php code or I need to pass the $_GET variables to the other php file withi...

Git Merge Recursive Ours - Command Syntax Example

What is the right format for a git merge with a strategy of recursive ours? (not to be confused with the git merge ours strategy) http://www.kernel.org/pub/software/scm/git/docs/git-merge.html I tried a bunch of ways and it doesn't seem to work. git merge foo -s recursive-ours // doesn't work git merge foo -s recursive ours // doesn...

GPS: loc.getLatitude/Longitude always results in 0.0

Hello, I used this tutorial to write my app. I use the DDMS Location Manager to change my location virtually. Unfortunally I always get a location of 0.0 for long and lat. Even if I switch them later in the prog with locationchanged-method I get 0.0. Code is this: @Override public void onCreate(Bundle savedInstanceState) { supe...

What is the difference between POST and GET?

I've only recently been getting involved with PHP/AJAX/jQuery and it seems to me that an important part of these technologies is that of POST & GET. First, what is the difference between POST and GET? Through experimenting, I know that GET appends the returning variables and their values to the URL string but POST doesn't: website.com/...