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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





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.




View Complete Forum Thread with Replies

Related Forum Messages:
Create A Query In Order To Dynamicly Popular A Listbox
I am trying to create a query in order to dynamicly popular a listbox however I am trying to fill the listbox with years such as 2007 etc based on if they are stored in the data base. The problem is that two tables have to be checked that have no relation to eachother but this caues the problem of duplication so if both tables have 2007 it will appear in the list more than once. Code:

View Replies !
Breaking Down A String In PHP 4
I need to split a string so that each character is in its own holder within an array. I know str_split will do it, but I need something compatible with PHP v4.

View Replies !
Characters Breaking My Query
Im using encrypted data to store cc info. The PHP code encrypts and sends the result to the database. the problem is that the encrypted string contains lots of characters that will break my sql query. I can do a replace but there are lots of characters.

for example, a character will look like this:

g%$^'GDF$%^//"@#$%/||''$#"/|#dfsa.

how can I put this information in a different format... and then retrieve the data to decrypt the string?

View Replies !
Breaking Up A String Into Individual Words
I have a text box that I will use to search a database. I would like
to use it so that it will not use a whole string (ie. 'red striped
top') but instead break it up into individual words (ie. 'red',
'striped', 'top') and maybe put it into and array. I will then use the
words in the array to search the database.

How do I break a string up this way?

Also, is this the most common way of creating a means of searching a
database?

View Replies !
Function For Breaking A String Up Into Tiny Parts
I've been searching high and low to find a function for breaking a string up into tiny parts. For example, I would like "hello.php" to become...

h
e
l
l
o
.
p
h
p

I have checked out the explode function and various other string handling functions. HOWEVER, all of the functions I've looked at require you to declare a character to trigger each breaking up point. I don't want to do that. I want it to break up every single character (not whenever there is a space, as most demos seem to do).

View Replies !
Checkboxes Dynamicly Generated
I have a form with 3 checkboxes wich have all the same name:

<input type=checkbox name=test value=val1>
<input type=checkbox name=test value=val2>
<input type=checkbox name=test value=val3>

now on the target page i need all values that are checked, so if they are all 3 ckecked i need to get val1, val2 and val3 on the target page. With ASP you get the varaible test = val1;val2;val3 (the values are all put in one variable, separated with a ";"

But when i use PhP i only get the last value in this case "val3". What do i need to do to get all values? I have named them all the same because those checkboxes are dynamicly generated. I dont know how many there will be.

View Replies !
Changing Upload_tmp_dir Dynamicly
Is there a way to change the upload_tmp_dir directive dynamicly in the script.
As i know this is a system directive and is possible to be changed only manualy from php.ini.

View Replies !
Populating A List Dynamicly
Is there an easy way to populate a list dynamicly? It stinks javascript here, but I don't know how to do it with that either. I have one list A that contains enteries with ID's as values.

List B should then fill with information from a database according to wich ID is choosen in list A. Since alot of otherthings is entered on the page to I would like to nopt have to deal with sending all the data and loading the same page again.

Is there a way in PHP to link to the same page and have all the filled textfields stay as they were? Or do I have to use post?

I have the thought of loading all the data from the database and having it in an array or something and having a javascript picking and writing the choosen ones to the list. But that would be alot of excess data so getting it "live" from the db would be better.

View Replies !
Displaying Dynamicly Created Images
I'm working on the registration page of my website, and am building in a system where the user has to read something out of a dynamically created image. I can create the image just fine, but how do I get it to display in a web page? Code:

View Replies !
Dynamicly Created Page, With Refereing Url Shown
I have loads of domain names but none have any hosting space associated. They are however all entered into my DNS, so when any of them are visited, the visitor ends up at the (unused) home page of my dns server.

I would like to put a php (or perl, or whatever else is suitable) page here so the visitor is shown a more freindly page.

So, for example, a "Welcome to domain.com, this page is under construction / for sale" type page is what I would want. So all I would need to do for each domain to have it's own page would be to enter the domains in to my DNS and the rest would be automatic.

View Replies !
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:

View Replies !
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:

View Replies !
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:

View Replies !
Using Query String
I do understand you can use get, post and session(maybe cookie as well?) to pass the variables. But I would like to know whether you can just create url manually, without having a submit button to generate the url in a form. Because I if I do this in a form it will always direct to only one webpage.

What I want to do is create multiple links which could link to different pages,(not a single page) on just one form, so each link will direct to differnt page, with variables' values specified(set). I tried to search for a function which does this job on google, but I couldn't find it. Another question is, once the target page sees this url, can we retrieve the values nicely?

View Replies !
Query String
Is it possible that you could send multiple values in one query string value like

<a href somepage.php?category=style,art,music>Add</a>

Or could we send an array like

$category = array("style","art","music");
<a href somepage.php?category=$category>Add</a>

Is this possible or am i totally out of track,or is there anyway of doing it.

View Replies !
Via Query String
I have used the following url format to build a template site with a fair bit of success: page.php?content=whatever The only problem is that with many pages the directory becomes quite messy due to all the content pages being in the same root folder.
Is there a way to keep all the content pages in folders and still access them via a query string? I have tried this before: page.php?content=about/whatever (where about is a subfolder in the site).

View Replies !
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 Replies !
Session In Query String
forgotten the little code snippet that adds a user session hash into the query string, how should i do this?

View Replies !
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

View Replies !
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.

View Replies !
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:

View Replies !
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 ?



View Replies !
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:

View Replies !
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.

View Replies !
Format Of Query String
whats the correct format of query string below:
$query = 'Select * from datersv where $ci BETWEEN datersv.date_in AND datersv.date_out OR $co BETWEEN datersv.date_in AND datersv.date_out';

View Replies !
Regex For Query String
I'm creating an email marketting manager for work and we want to be able to track links in from the email so I want to find links in the plain Text and HTML parts of an email and append ?m=emailID&l=linkid but preferably not add them on if they're already there and add &m=emailID&l=linkid if there is already a query string on the link. Originally when I thought about it it seemed simple, but now thinking about the smaller details it seems much more difficult.

View Replies !
Redirecting A Query String
I built a new site, but the browsers and other websites link to my product pages using a query string link with old filenames. I need to redirect the queries to use the new filenames. How would I create this redirect?

View Replies !
Problem With Big String Query
I'm having a problem when i try to get a big string field [varchar(2000)] with mssql_fetch_row... the field return only the first 256 characters from database. Can someone help me?

View Replies !
Validate Query String
I was trying to find a slick way to do validation of the URL's Query String

I only use a few special chars for my query strings and I was thinking about automating the whole sanatization of my url base query strings with something like this.

I only use '_', '&', '=' and of course Alpha Numberic.

I thought I could come up with some ereg tester to validate that it's within my format.

I found .....

View Replies !
Sanitize Query String
I'm looking a regex to sanitize a query string but I'm not able to build the regex. For instance: (fake code )PHP Code:

function ParseQuery(){
    $result = array();
    foreach(explode('&', (string)$_SERVER['QUERY_STRING']) as $arg){
        if(preg_match(REGEX, $arg, $matches)){
            $result[$matches[1]] = (string)$matches[2];
        }
    }
    return $result;
} ................................

View Replies !
Query String Security
I would like to make content available on a page that requires authentication, but they would be accessing this page from another website, or a desktop application.

This means they could not use a sign-in form to authenticate. I am thinking of passing the user name and password through the query string when the page is called. The page would be accessed through SSL on a dedicated server. Code:

View Replies !
How To Clear A Url Query String
my url is in this form: http://www.mysite.com?user=zen

what to do to remove the query string (..?user=zen) and make my url to
this form: http://www.mysite.com

View Replies !
Query String Disguise
I'm trying to disguise the values of a query string when using GET to send the data across to another page. I have seen the long greek words that appear in hotmail and other websites.

View Replies !
Getting Plus (+) Symbols In Query String
I'm trying to grab a query string value for "search" where there are multiple values separated by plus symbols e.g. index.php?search=one+two+three. in index.php I have the following

$action = $_GET['search'];

and I use this to do this

require("http://www.mysite.com/cgi-bin/search.pl?search=$action");

It works fine if there is only one search term. However when there is more than one the "require" breaks because it replaces the "+" with a blank space

require("http://www.mysite.com/cgi-bin/search.pl?search=one"); (works)

require("http://www.mysite.com/cgi-bin/search.pl?search=one two three");

View Replies !
Specify String Length In Query
Is it possible to specify a string length when doing a MySQL query? I have a dictionary and want to select words that are only 5 characters long. I could always loop through the results in PHP and weed out words that don't meet the specified length, but I was just wondering if that can be done in the initial query.

View Replies !
How Can I Break Up A Query String
I have a script that receives user input from a form. Something like this...

$query=this+is+the+query

What I need to so is break up the entire string so that each word has it's own variable.

$1="this"
$2="is"
$3="the"
$4="query"

etc etc

one problem is the query lenghth will not always be the same.

Is this possible?

View Replies !
Losing Query String
On my site if there are no images with a location a link is displayed so users can add images for that location. I use a query string that has the location name and location id in it. So when the user is on the addimages.php page it displays the name of the loaction and has the correct id to insert into the database. This all works fine but when I add in my script that will redirect a user if they are not logged in I lose the query string after they have logged in. The login process works fine and returns the user to addimages.php like it is supposed to but no query string. I use $_SERVER['self'] for the redirection after the user has logged in.

View Replies !
Query String Mysql $id
While I've got the script up and running - I am stuck on the last part - trying to get a backend page working. I have an admin page calling a table from the database, and I've added a column with a link to the id ($id) for each row and I want that link to go to the update.php?id=x page for the relevant row. Code:

View Replies !
Query String Punctuation
I have a looping insert string, below. I keep getting an error message that I have 'unexpected T string". What am I doing wrong? I've tried all the combinations of punctuation I can think of.

$sql = 'INSERT INTO cat_relations(relation_user_id,relation_cat) VALUES($ID,$_POST['categories'][$x])'

View Replies !
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?

View Replies !
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?

View Replies !
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?

View Replies !
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)?

View Replies !
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";

View Replies !
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.

View Replies !
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

View Replies !
Value Of A Form Field Into The 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>";

View Replies !
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.

View Replies !
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')");

View Replies !
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?

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

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

View Replies !

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