Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Can You Ignore A GET Query String?


Hello all,

I have a recursive form that uses both GET and POST variables. After calling a GET, the string stays in the URI. When I do a POST, the scripts breaks because the GET string is still there.

I can't figure out how ignore or delete the query string after I'm done with it. unset() doesn't work.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get Value Of Query String
I am trying to get the value of a query string. The query string variable name is stored in a array value(because I need to read one particular query string) PHP Code:

String Query
I'm trying to get this query in PHP: select answer,correct from quiz_answer WHERE (qsid=28 OR qsid=29 OR qsid=30) and correct='yes'

But the thing is that when I select a wrong answer then it displays qsid=66 OR, so this depends on how many questions wrong..PHP code:

Query String ?
i have a form that accepts user info. i have to add that info to my database and redirect the user to another site and fill the form on that site with the info the user just entered in my form. i am using the query string. the other website that i am transferring to is using jsp. Code:

Query String
How do you put the value of a form field into the query string. I have a
select field named title on a submission form. I'd like the selected value
to be put on the Form line

echo "<form name='form1' method='post'
action='admin/edit.php?selectfield=what goes here? '>";

function load()
{
require_once("../login.php");
login();

mysql_select_db("db");
$options = "select id from table order by id";
$optres = mysql_query($options);

$opt_results = mysql_num_rows($optres);
echo "<select name=title>";

for ($i=0; $i <$opt_results; $i++)
{
$optrow = mysql_fetch_array($optres);
$optionval = stripslashes($optrow["song"]);
echo "<option>$optionval</option>";
echo "<br>";
}
echo "</select>";
echo "</p>";

echo "<form name='form1' method='post'
action='admin/edit_tab.php?tab='>";

echo "<input type="submit" name="edittab" value="edit tab">";
echo "</form>";

Query String
How to pass the query string when the single table to be sorted. I just want to pass the query string for each column separately when clicked on the header.

When I click the column header it should sort in ascending when again clicked it should sort descending...

<a href="abc.php?name=asc ...........Name[/url]

Session In Query String
forgotten the little code snippet that adds a user session hash into the query string, how should i do this?

Making A Query String
I'm new to Google Groups (this is my first post or topic or
whatever it's called). I'm also new to PHP. My knowledge in PHP extends
to variables, basic fuctions, etc. I have a site with a MySQL 4.1.14
database and I use phpMyAdmin 2.6.3-pl1.

Suppose there's a page called videos.php. What do I need to do to get a
page called:
videos.php?name=matrix-ping-pong

Also, it would be helpful if you tell me how to add more pages (well,
it's really not a page, is it?) such as:
videos.php?name=hamster-dance

How To Build Query String?
From a form I have a list of fields, e.g:

name
address
phone
memo

I know how I do it manually for search query but how do I do it
automatically.

select * from <table_name> where
name = %$_POST['name']% and/or
address LIKE %$_POST['address']% and/or
phone LIKE %$_POST['phone']% and/or
memo LIKE %$_POST['memo']%

but my trouble if one of them is blank.

Getting Query String Value From A Variable
I have a url which is stored in a variable. I know which query string I want to extract from that url. How do I go about getting the value of the query string. PHP Code:

Php Query String Security
Hi was asking some questions about this in alt.php but some didn't get answered.
Yes I have read an awful lot now about php security and different advisories
and Idon't mind being called a competely dimwit but I still don't understand
what prevents this from happening if register_globals is ON:

http://www.mywebsite.com/anypage.php?firststep = fopen ("../etc/passwd", "r");&secondstep=fread($firststep,filesize("../etc/passwd"));

I can't seem to get this or any variations on the above to work inlcuding someting
like thirdstep = print $secondstep , but theoretically it should work shouldn't
it ?

Really my question is not about the above specifiically but it is about this:

Say you have a script which uses no variables, say it just echos 'hello' and
thats all it does, literally:

<?php
echo "hello";
?>

No variables, no include, or file or anything done by the user. Just echo hello
and exit. Nothing else. Is it possible in that scenario to run arbitray code
by doing something like I was describing about with etc/passwd ?



Using Variables In The Query String
I have a feeling im formatting this query string wrong and thats why it is not working.
Any ideas? Code:

Passing Value To A Query String
i have a value 35 to be passed to the query string in php i tried to first include the value manually in the action tag of form and then add $_REQUEST['pi']. pi is my query string value  its not working.

Parse Query String Question
Hello, I have a querystring (&amt=138.06&opt=none), and I dont know how to read these passed variables. For example, where my querystring says "&amt=138.06" I cannot read these variables in my php script as $amt , or . $amt....these give me a parse error.

When I do this:
$data = $HTTP_SERVER_VARS['QUERY_STRING'];
echo $data;

It outputs the complete querystring-- can anybody please suggest some code to extract the value of "amt" from $data?

Simple Query String Not Passing
I've been messing with PHP for a few months now, and have some basics down. However, I thought I understood this issue, but here I am posting... <heavy sigh>.

Two files: register.php which is the form to allow a user to register with the site, and success.php which does the form validation, etc. If invalid input is found, I'm using the code below to go back to the register page.

@header("Location: http://url/register.php?id=1");

The id is examined in a switch statement on the register page to generate a message on the register form telling the user exactly what field the problem occurred in.

Here's the problem: The id value is not being passed in the redirect.

Can anyone tell me what I'm doing wrong?

Why My Query String Not Work In Php 5.2 XAMPP
I have installed the latest version of XAMPP. But now my Query string
not work . What is the solution?

Decoding The Query String Array
I am building a very simple form that takes text and inserts data in a
MySQL db.

I would like my "logic" to simply insert the value in to the field in
the database that matches the name from the query string.

Here's the question- can I do this if I do not know how many name/value
pairs are passed to the "logic" ? Can I just step through the $_POST
array and use a do while $i <= count($_POST) or something?

I have tried this but for some reason I cannot get a number back from
the $_POST array. I am also confused about how the $_POST array is
constructed. How do I reference name/value pair $_POST[0,1,2 etc...] get
their "names" and "values" in to variables so I can accomplish the
INSERT SQL(e.g. $name = $_POST[0,0]; $value = $_POST[0,1]; [INSERT
$value INTO $name];- The MySQL fields will match $name)?

Making A Variable From Query String
If I have the url of page like this: http://www.domain.com/index.php?page=home

is there an easy way to get the just the page name as variable.like: $page_name = "home";

Why Does $_GET Query String Persist?
If I go to an URL via a link that contains a $_GET query, then how can I clear the $_GET from the address bar when following later links? e.g.

I go to: index.php?action=edit_splash&view=all

... then on that page I click on a form button that self submits via $_POST - but the old $_GET query remains in the address bar.

Stripping A Query String From A Header...
I am getting headers using getallheaders() and I need to strip the referrer query string...example:

$HTTP_REFERER = http:///www.website.com/page.php?pa...s%is%the%error!

I want to strip the query and just get this: http:///www.website.com/page.php

Can't Query MySQL If An Ampersand Is In The String?
I have some comic books I am trying to query and some of the titles have and ampersand (&) symbol in them. The string cuts everything off after the ampersand.

Example:
I have a link that is 'Superman & Batman: Generation' which uses the get method to select the title via the WHERE title ='Superman & Batman: Generation', but I only get a result for Superman and everything else is cut off.

Adding Strings To A Query String?
I want to use my string $stringvar to show text in this sql query. ATM its sticking "$player, $score" into a field, I want it to instead print it out into the sql statement.

This is my code:
$stringvar="$player, $score";
$sql=mysql_query("INSERT INTO $game_db VALUES ('$new_matchid', '$opponent', '$map', $stringvar, '$result')");

This is what I want the sql query thing to look like:
$sql=mysql_query("INSERT INTO $game_db VALUES ('$new_matchid', '$opponent', '$map', $player, $score, '$result')");

Obtaining The Whole Query String From $_GET
I'm doing a complex search engine script for one of my clients.

Instead of having clumbersome code checking to see if $_GET variables are set and then setting them to pass onto the next page, do you know if there is a way of getting the WHOLE query string from the URL after ? in PHP?

Encrypt / Decrypt Query String
I would like to encrypt a query string, then decrypt it later.  What is the quickest way to do this?

Breaking Up The Query String Dynamicly?
using $Get_string = $_SERVER['QUERY_STRING']; to receive a query string such as
month=may&$day=15&year=2006

so that $Get_string = "month=may&$day=15&year=2006"

can I separate the values and turn them into variables? (like a normally would with a url get)

$month = "may"
$day= "15" etc

it would be great to just do $_GET on the url but I'm sending the string as a variable to another script... so i can't just go the easy route.

Escape Character In Query String
use the urlencode function to "escape" the special characters. After, use urldecode to get the string back to normal.

How Do You Ignore The <?xml?> Tag?
When writing proper XHTML how do you stop PHP from trying to parse the <?xml?> tag? Do you just echo the line out to page or can you get PHP to ignore it some how?

Php Doesn't Ignore The Utf-8 BOM
"When a php file is saved in utf-8 format with the UTF-8 BOM as the first
three bytes of the file (EF BB BF), PHP doesn't ignore these bytes when
loading and compiling the file, but instead considers them output coming
prior to the <?php. This causes incorrect display of the page and
failure of any http header output."

I have this problem, I'm from croatia and I must use unicode (with php) but
php have this bug.

Passing An Array Variable Through Query String ?
Is it possible for me to pass a variable which is an array like:

$highestREL[0] = "some value";
$highestREL[1] = "some value";
$highestREL[2] = "some value";
$highestREL[3] = "some value";
$highestREL[4] = "some value";
$highestREL[5] = "some value";

through a img tag like: PHP Code:

Entire Query String As Script Variable
How would I pull the query string of an URL into my PHP script for use as a variable inside the script?

For example - URL is http://www.mydomain.com/hub.php?ref...bob&lname=smith

In my hub.php script, I want to set a variable

$foo = "ref=affiliate1&fname=bob&lname=smith";
(or whatever the actual query string happens to be)

Simple Question: Query String Variable And More
suppose i have two html-formatted documents with appropriately coded <?php ?> areas.

a typical query is this: file.php?call=123.html

in 123.html i define a variable $doctitle

How can I display $doctitle in file.php (an html-formatted file as well)

Find And Replace Query Variable In URI String
I am trying to find and replace the query variable relating to the session id "sid=". This is the portion of the script that has to find out where the sid= is in the string and replace it with an updated version that contains the session id. It is not finding "?s=" nor "&s=" when I run it any of the following urls.

http://www.mysite.com/?func=home&sid=
http://www.mysite.com/index.php?func=home&sid=
http://www.mysite.com/?sid=&func=home
http://www.mysite.com/index.php?sid=&func=home

I commented out the parts which do not have a bearing on the basic string search function.
PHP Code:

Query String With Multiple Values In One Table
I'm having trouble with the syntax on a query string, and haven't been able to find any posts or tutorials that seem to address this specific type of query. I have a table named "items" with a field for "name"

In the "name" field, I have several different entries (actual data), including John, Mark, Sue, Brian, Lucy, etc. In the specific page I'm building, I want to query the database and return the data for more than one person, but not everyone. It seems the query string should be:

$query="SELECT * FROM items WHERE name='Brian' AND name='Sue' ORDER BY name ASC";
However I get errors. If I remove the "AND name='Sue'" it returns data for Brian just fine, and if I remove "name='Brian' AND" it returns data for Sue, but I can't get it to return the data for both of them.

Disable Passing Arrays In Query String?
Is there any way to stop PHP from turning a query string like this: ?var[] into an array when it is read by $_GET['var']? I have quite a few input validations that are easily screwed up by this strange (and apparently undocumented???) feature...

Can I Pass Multiple Values In A Query String
I need to pass  a couple of values in a query string. Is this possible. I have the following code but get a parse error. Code:

Insert Ignore
Are you allowed to use the following syntax in Mysql 4.0.17-nt :

INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES
("'.session_id().'", "2", ROUND(NOW()/10000) );

I am particularly interested in the delayed ignore. I want to make sure
that no matter what, the instruction is carried out and that, due to
indexes, the data is not allowed to go in, that we do not get an error.

[TEST] Please Ignore
My posts aren't showing up in the group for some reason.

Php Ignore Html
One can in Linux prefix a script as follows:-

#!/usr/bin/php -q

and then run the script from the command line & the -q tells PHP to leave all HTML out. How can this be done in Microsoft Windows.

Ignore Everything Not In A Sting
Does anyone know of a function to ignore everything that is not within 2 defined strings? for example,

'The dog [verb]jumped[/very] high'

but only display the word 'jumped'

HT://dig And Other Search Engines Wont Look At Query String In Links
I realize that this is no the HT://dig support forum but I haven't been able to get htdig to index my site properly:

It will only show one file: index.php when every other files is linked off the main page (i.e. index.php?content=page2.html ) I believe that this search engine is not looking at the QUERY_STRING properly or following the links off the main page.

Does anyone know how to get htdig to work on a dynamically generated site - or can you recommend another search engine that would help index and search such a site.

Converting Spaces To Underscores And Back In The Query String
I have a page that uses a variable in the query string to determine the output of the page. The query string will have a lot of spaces in it that look ugly when encoded to '%20' so my question is:

If the spaces in the query string were replaced with underscores, how would I replace the underscores with spaces in the page?

Manipulate Array Keys And Values For Query String
i'm creating a function where I can update my records ... but it doesnt work...I echoed my SQL query and it turned fine..but it didnt update my record! PHP Code:

Long URL With Query String For Use On Text Emails Breaks At '+'
I am trying to send members of a site periodic emails containing links back to the site.
I will use HTML and text email but in the text email I have to display the whole ugly URL in order for it to hyperlink. This is OK until I encounter a text field with more than one word. I have tried urlencoding, but the link as displayed on the email is always broken at the '+' sign between 2 words, and doesn't lead anywhere useful. Code:

Page Still Caches Even With Header() And Random Query String - HELP
I created a page that will be doing image resizing and manipulation,
which seems to work (using GD library). However, upon returning to
the page where the image has been changed, I still see the old image,
until I refresh my browser and then zappo, there it is! All changed!

I have done everything I can think of to force caching including this:

Code: ( php )

Reloading The Page With Updated Query String Values
I'm trying to build a small portfolio and instead of using several HTML pages I wanted to just use PHP. What I have is an array of each image's path (for the "src" attribute). I was thinking when I click "Next" (a text link) it increments the array and once it has reloaded itself it would simply look at the query string then display the new image. I have some questions though:

1. What line do I use which will reload the page with the new incremented variables?

2. When the page reloads itself, will it automatically get the new image to load? I already placed $thisimage = $_GET['imagenumber'] at the very top so it updates the "src" attribute for the image.

Ignore Spaces In Str_replace
Is there a code for ignoring spaces (more specifically line return) when I use str_replace() to search for and replace a specific string? This would be in instances where a word wraps around to the next line. ie

"wraps aro //this space would have been created by und"

PHP - Does It Ignore Return Val From Constructors?
I am trying to figure out how to make an object creation fail for ease
of error handling. Oddly, I can't work out how to do it.

Here's a reduced code sample of how I hoped it would work, but it
doesn't:

Php Doesn't Ignore Aborted Fileuploads
Running my uploadscript on old server, php4.1.2 ignore aborted
fileuploads.
Now, the same script on new server doesn't ignore broken uploads.
If anybody make a upload and abort this the uploaded part of file is
present on server.

I'm now running php 4.3.3 on redhat 9.

Files will be moved with move_uploaded_file($userfile['tmp_name'],
"$destination/$userfile_name")

I want to ignore broken uploads. What must i change in php.ini or which
compile-option must set.

Php Ignore Case Sensitive
is there a way to make php ignore case? my thumbnails names are lowercase, and my main images name are uppercase,

How To Ignore A File To Be Downloaded Via Ftp
I am trying to ignore specific files for download. I have this code, but it still downloads the unwanted file. Also how could I do it for more than one file to ignore?


if (file_exists($ignore)) {
} else {

ftp_get($conn_id, $dir" . basename($file), $file, FTP_BINARY);
}
}


Copyright © 2005-08 www.BigResource.com, All rights reserved