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.





I Cannot Pull Information From URL Querystrings


I just made a Gentoo box, with Apache2 and php4 so that I could learn php and a non-windows enviornment.

My problem is that I am unable to pull information from a querystring, which I thought (perhaps incorrectly ) was as simple as refrenceing the variable. Code:




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Pull Information Off An Anchor ID
I have a bunch of links that ref is the same page.  Is there any way on that second page I can tell which link was clicked if my links are structured as:

<html>
<a href="page.php" id="link1">Link 1</a>
<a href="page.php" id="link2">Link 2</a>
<a href="page.php" id="link3">Link 3</a>
<a href="page.php" id="link4">Link 4</a>

View Replies !   View Related
How To Pull Certain Information Off Of A Feed
I am trying to figure out how to pull certain information off of a feed. I know how to do the title and description, but I want the info after that which is under the <cata> array. The xml code would look like <cata:status>up</cata:status> and it displays like this:

[description] => blah blah blah
[cata] => Array
(
[status] => UP
[lastupd] => 11:22 AM
[nextupd] => 11:32 AM
...... and so on.

View Replies !   View Related
Parse An Html Page With Php To Pull Some Information
Im trying to parse an html page with php to pull some information from it and its not working correctly. I am running this to pull the ul from the page. its the only one on the page with the class directories and it doesnt stop pulling information after the end of the ul.

preg_match('/<ul class="directories">(.*)</ul>/', $postResult, $array);

View Replies !   View Related
Array Question - Pull Information From On A Bunch Of Pages.
I'm just starting in php, although I have a little programming experience in
other languages, but only on a surface level.

I have a multidimensional array that I want to pull information from on a
bunch of pages.

$county = array (
array (
key=>"adams",
name=>"Adams",
govwebsite=>"http://www.co.adams.wa.us/default.asp"
demwebsite=>"" ),
array ( name=>"Asotin",

I'm trying to write the php script for the pages to identify the sub array
by the filename, pull the rest of the information out of the array into
variables, and then use those variables to write the page. I've searched
and tried a bunch of things, and nothing is working. Here is what I have:

<?php
include("countiesarray.inc");
$path = __FILE__;
$filename = basename ($path,".php");
foreach ($county as $key => $ArrayRow)
{
if ($ArrayRow[0] == $filename)
{$countyname = $ArrayRow[name];
$govwebsite = $ArrayRow[govwebsite];
$demwebsite = $ArrayRow[demwebsite];
};
);
include ("header.html");
include ("title.html");
if ( $govwebsite != "" ) { include ("countyweb.html"); };
if ( $demwebsite != "" ) { include ("countydemweb.html"); };
include("../navigation.html");
include("../copyright.html");
?>

The error I get is Parse error:
parse error in /home/calador/public_html/wapolitics/counties/adams.php on line 12.
Line 12 is the end of the foreach loop.

View Replies !   View Related
SESSIONS - Pull Information From The Db Solely Based On The Userid Field In The Database.
i have a user management system which i want to pull information from the db solely based on the userid field in the database. When the user logs in a session is created which looks as follows: PHP Code:

session_register('userid');
$_SESSION['userid'] = $userid;
session_register('first_name');
$_SESSION['first_name'] = $first_name;
session_register('last_name');
$_SESSION['last_name'] = $last_name;

what would be the code to pull the content from the db? i'm thinking it would be something like the following, but i'm not sure as this is the first time i have ever used sessions. PHP Code:

if($_SESSION['userid'] == $userid;{
    $query = "SELECT * FROM `users";
    $result = mysql_query($query);
    $rows = mysql_num_rows($result);
...............

View Replies !   View Related
Querystrings
I am using now a php script to pass querystrings. The code is below, however the problem is that I dont know how to add a second querystring for included file. For example how to make it http://somesitename.com/index.php?page=home&num=3. Code:

View Replies !   View Related
Get Method & Querystrings
I'm having some grief with the Get method and querystrings. I have a form which processes a variety of commands all on the same page depending on which submit button is clicked. The form begins like so (with escaping slashes): PHP Code:

View Replies !   View Related
Problems With Querystrings
We all know that spiders either have trouble crawling sites with "?, &" querystrings, or they don't crawl those pages at all.

I'm about to start a dynamic site and will be writing in PHP/MySQL. Have any of you had success getting dynamic pages indexed without using mod_rewrite?

View Replies !   View Related
Removing And Adding Querystrings With Simplified Urls
I am implementing simplified URL's using apache's rewriteengine.

The Dyanimic URLs look like this:

products.php?brand=24&category=25&theme=4&price=4

The simplified URLs look like this:

products/brand/24/category/25/theme/4/price/4

I need to be able to remove and add brand, theme, category and price.

Below is the current code I use to do this with dynamic url's: Code:

View Replies !   View Related
Pass Information Through A Link That Will Tell The User That Their Login Information Is Incorrect.
i am trying to pass information through a link that will tell the user that their login information is incorrect. the link for the login page looks like this

<a href="index.php?act=login">

now on that page i have this if statement

if (isset($_GET['error'])) {
echo 'Invalid login data supplied. Please try again.'
}


I have tried to make the link
<a href="index.php?act=forgotpass&amp;error=1"> but the error will not display any thoughts?

View Replies !   View Related
Sessions - The New Information Does Not Replace The Old Information
I am new to sessions and don't really understand why something is happening. I have created a form with name and address inputs. I have created the variables as:

session_register ("name");
session_register ("address");

These variables flow to the next page just fine. However, if I go back to the form and edit the information, the new information does not replace the old information. It defaults back to the original entry. Am I doing something wrong? Code:

View Replies !   View Related
Using PHP To Pull From MS Access DB
I've been trying to create a simple (I hope) PHP application to send
emails to a membership list. I have yet to successfully connect to my
database to pull the names and email addresses. I'm running XP Pro,
PHP Version 4.3.2, Access 2000. I have created an ODBC System DNS
connection to the database file I want to access, And I get this error:

Warning: SQL error: , SQL state 00000 in SQLConnect in connecttodb.php
on line 2
Whoops! Could Not Connect to ODBC Database!

Here is my code:

<?php
$odbc = odbc_connect ('DFWMembershipDB', '', '') or die('Whoops! Could
Not Connect to ODBC Database!');
?>

View Replies !   View Related
Database Pull
im having a problem getting this syntax to work properly what i am trying to do is display the top 15 songs and when u scrollover the links of the song names that are pulled from the db it shows a title that displays there first and last name along with price pop and album name. all of these are in the same table except for firstName and lastName these are in the customer table. Code:

View Replies !   View Related
Pull All Files
I have two tables in a database. One is called 'CUSTOMER' & other 'COMPANY'. 'CUSTOMER' has address info. 'COMPANY' has info pertaining to whether the customer is active or not.

A number in an 'ID' field in 'CUSTOMER' matches the number in a 'CusID' field in 'COMPANY'. I want to pull all the files from 'COMPANY' whose 'SIGNUP' field equals 2007 and whose 'ACTIVE' field equals 'YES'.

Then, I want to pull all the files in the 'CUSTOMER' table that match the 'CusID' number in the result of the 'COMPANY' query (above).

View Replies !   View Related
Substr Pull My .jpg
I need help finding out why this isn't pulling my .jpg. I tried it with the .jpg in our out of the image tags but its not about that. The error I get says file_get_contents .jpg cannot be found. But file_get_contents is only supposed to be called when there are files other than jpgs. Please let me know why substr isn't pulling the .jpgs.

<?php ini_set('error_reporting', 8191);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
$test = Array();
$test[1]= "some.jpg";   
$test[2] = "<img src='some.jpg'/>";
$test[3] = "<img src='some.jpg'/>";
$test[4] = "somepage.txt";
$testtimer = date("s")%count($test)+1;
if (in_array(substr($test[$testtimer], -3), array('jpg')))
{$get_content = $test[$testtimer];
echo $get_content;}   
else {$get_content = file_get_contents($test[$testtimer]);
echo $get_content;}?>

View Replies !   View Related
Pull Down Menu
I need to create a pull down menu from a list of names from a database. I also need an option within the menu to add a name if it is not listed in the database without refreshing the screen. Any examples of how this is done?

View Replies !   View Related
Pull An IP Out Of String
I've been using two instances of substr to pull an IP address out of a string. I know there's a more efficient way. Anyone? The string is like this:

HOST 61.2.135.45 blocked.

View Replies !   View Related
Pull The First 2 Sentecnces From A Db
I am trying to pull the first 2 sentecnces from a db where the table is news and the field i am pulling the first 2 sentences from is body.

<?php require_once('Connections/enforsys.php'); ?>
<?php
mysql_select_db($database_enforsys, $enforsys);
$query_Recordset1 = "SELECT SUBSTRING_INDEX(body, '.', 2) FROM news ORDER BY `date` DESC";
$Recordset1 = mysql_query($query_Recordset1, $enforsys) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

View Replies !   View Related
Dynamic Pull Down
Trying to get the following code to work. Fairly simple, or should be Just trying to populate a pulldown with values from a MySQL database table. I have checked the SQL and that is working fine. not that difficult. So, why is it when I run this the pull down just contains the word Select and then a bunch of blanks?

$sqlOptions = "SELECT MEDIA_NAME, MEDIA_ID from MEDIA_TYPES";
$result = mysql_query($sqlOptions);
if (!$result) {
echo ("<P>Error performing query: " . mysql_error() . "</P>");
exit();
}

echo '<select name="Test">'
echo '<option value="">--Select--</option>'
while($opt = mysql_fetch_array($result))
{
echo '<option value="'.$opt['MEDIA_ID'].'">'.$opt['MEDIA_TYPE'].'</option>'
}
echo '</select>'

View Replies !   View Related
How Do I Use A Pull-down Menu With Or Can I?
Is there a way for PHP to see what is selected in a pull-down menu. So
that i can use a switch statement to display certain information. If
not how can I combine javascript with it to work.

View Replies !   View Related
Pull Quotes
I have a page of text on a site which sits in a table. Is there any way to pull this text out of the table and display it on another page automatically? Would I do this by calling the table a name and then "include" it's contents on the following page,

View Replies !   View Related
Displaying Information From A Database Andinsertion Information To A Database
im trying to make it so veiw_forum.php?forumid=1 displays all the information from the database that has forumid to the value passed in the varible, but my code isnt working Code:

View Replies !   View Related
Selecting Using Pull Down Menus ??
Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on.

But what i got stuck in was creating an ALL search does n e one know how to do them ?

View Replies !   View Related
Pull Data Out Off Mysql
I am making a database using mysql where i have 2 tables, one for car manufacturers and one for car models.I've already done that. I have made a php page where i have 2 drop down menus.

The first menu shows car makers(manufacturers) and the 2nd nothing. Now when a user opens the 1st menu and selects a maker , the 2nd automatically fills up with models from that car maker only and it gets its information from the database.That is every time i decide to add a new model to my database the 2nd menu (if selected) must go and search the database for all the models for that maker and show them. Code:

View Replies !   View Related
Preg_match - Pull Two Items From A Log
I'm trying to pull two items from a log with this layout:

[Fri Jan 10 06:02:38 2003] [51 Cavalier] Nasrim (Human) <Spirits of Fire> ZONE: nexus
[Fri Jan 10 06:02:38 2003] [56 Revenant] Kreelak (Dark Elf) <Spirits of Fire> ZONE: poknowledge

I'm trying to pull just the items in red to an array using preg_match_all(), but I can't seem to figure out the regex pattern to do it. If someone could help me out here I'd appreciate it.

View Replies !   View Related
How Do You Pull All Data From A Field?
How do you pull all data froma field no matter what its result.. like this..

results.php?city=$city&type=ALL&zone=$zone

so where type=all i want to get all restaurants in whatever $city in whatever $zone, meaning chinese, mexican, all rest listed in persay newyork zone 1 what is the wildcard to pull that..

View Replies !   View Related
Pull Variables From Mysql
how I can pull a specific query from a mysql database and store it in a php variable. how can i go about doing this?

View Replies !   View Related
Pull Document Out Of MySQL
I am trying to pull documents into a page using php.  The documents are stored in a mysql database.  The page works when I link to it from within a page, but when I try to drop the link in and go directly to the page, it tells me the document cannot be found.  This page requires a login, and I have tried logging in first to see if it makes a difference.

It works in Safari and Firefox when I paste the link in, but not Internet Explorer. I know this is a weird one and I am not sure whether or not to put this in the php forum or mysql, but I really appreciate any help any of you can give on this one. Code:

View Replies !   View Related
Dynamic Pull Down Menus
I was wondering if a kind person off here could point me in the right direction.

I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu?

For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.

View Replies !   View Related
Pull 1 Number From An Array
I'm trying to set an array of a series of 6 single or double digit part numbers and match it against a user input selection of part numbers.  For example, if the user is looking for part numbers 10,9,43,7,6 from an item that has part numbers 10,14,16,31,43,50 then it would highlight that part numbers 10 and 43 are a match, but so far it's only highlighting 1. Code:

View Replies !   View Related
Multiple Table Pull
$result = mysql_query("SELECT $tb1.fname FROM $tb1, $tb4 WHERE $tb1.email = '$T1' AND $tb1.pass = '$T2' AND $tb1.unum=$tb4.unum",$db) or die(mysql_error());
$_SESSION['myfname'] = mysql_result($result,0,"$fname");

The error I get is:

Warning: mysql_result() [function.mysql-result]: not found in MySQL result index 6 in /home/xratedda/public_html/loginout.php on line 39

I know, it looks like I am only grabbing one thing and don't need different tables, but I am trying to figure out how to do this with just one item, before adding the rest.

View Replies !   View Related
Pull Muliple Selection
When I try to pull mulitple selection options from a form only one value will come through. the form is in html and i use an external php processing script any one have any ideas?

View Replies !   View Related
Pull Image From Video
Does anyone know how to pull an image from a video with php or do I have to use anther language to do this.


View Replies !   View Related
Pull Random File
I am trying to get one of x amount of files from a dir. The code below works but sometimes it returns empty. PHP Code:

$files = array();
        if ($handle2 = opendir("../media/random")) {
            while (false !== ($file = readdir($handle2))) {
                if ($file != "." && $file != "..") {
                    $files[] = $file;        
                }    
            }
        closedir($handle2);
    }    
    $getRand = mt_rand(1, count($files));
    for($i = 0 ; $i < count($files) ; $i++) {
           $file2 = $files[$getRand];    
    }
    $output .="&files=".$file2;
    echo $output;
Cany oneone see why it would return empty?

View Replies !   View Related
Quantity Pull-down List
I have a field in my table called thats called quantity, for a particular record, i want the form pulldown list to go from 1 to whatever the figure in the qty field.

View Replies !   View Related
Read And Pull Bits
I would like to pull text from a text file, but at irregular positions(sort of). I would like to do this for a simple high score list from some flash games. Here is an example of the text file:
&name1=joey&score1=23453&name2=suzie&score2=21985&name3=billie&score3=2426&name4=bubba&score4=930

I simply want the first place name and score which is indicated by &name1= and &score1= to be read from the file and displayed to a webpage. Im going to repeat this function to about 6 other text files, but I think I can handle that part. Im having trouble with parsing the text of course.

View Replies !   View Related
Pull From Form And Save To Db
does anyone have a function already written that will take all the items from a form (a really long one) and put them into a database (assuming all the form names exist in the db with the same name)same for updating.

View Replies !   View Related
Querying The Db To Pull Out All The Actions.
I am querying the db to pull out all the actions.

<?php
$query = "SELECT * FROM `actions`";
?>

But, how could I change (add) my WHERE clause to only pull out actions where the date column is today OR in the future, but not yet passed? Code:

View Replies !   View Related
Pull Variables Out Of The Url Path
How can I pull variables out of the url path. lets say I have as a url

http://something.mypage.com/blah i need $variable='something'

View Replies !   View Related
Pull A Random Record
Is there a way to pull a random record from MySQL?

View Replies !   View Related
Pull Down Menu Query
I'm trying to populate the pulldown menus of a single input form
through queries from a single table. The three columns are 'name',
'type', and 'status'. The name table runs to approx row 23, the type,
to row 8, and status, row 9. . I'm using the following code to
populate the form pulldown menus:: Code:

View Replies !   View Related
Pull An Xml Element Into As A Variable
I've got a php page, process.php, and an xml page, data.xml. I need to access the element <xmltitle> from the data.xml file and bring it into process.php as a variable.

View Replies !   View Related
Preg_replace :: Pull Out Everything After A Comma
I need to search a string and pull out everything after a comma. Example: PHP Code:

$name="Shmoe, Joe";

View Replies !   View Related
Pull Down Menu Sticky
How can I make an option pull down menu sticky? I have a form that posts to itself using:

<form method="post" action="<?php echo $PHP_SELF;?>">

If the user selects "Three" I would like the "Three" to stay selected during the reloading of the page, not go back to "One".

<select name="name">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
</select>

View Replies !   View Related
Dynamic Pull-Down Menu
I'm trying to create a dynamic pull-down menu (list of part #'s) where if a user selects a part #, it prints the description to the right of it. How can I do this? I've provided the code I have below and also sample table values. PHP Code:

<?php

print "<html>";
print "<body>";
print "<form>";
include ("common_vars.php");
mysql_connect("$DB_HOSTNAME1", "$DB_USERNAME1", "$DB_PASSWORD1")
or die("Database error!");
mysql_select_db("$DB_NAME1");
// pull-down menu for products
print "<select name='product1'>";
$query = "SELECT * FROM category";
$result = mysql_query($query);
while ($item = mysql_fetch_array($result))
.........

View Replies !   View Related
Script To Pull Pagerank Code?
I will be gooogling next but hopefully I can use this as abackup. Does anyone have any good free scripts to pull the PR value and display it on a website?

View Replies !   View Related
How Do You Pull Specific Characters In From A $string
I want to create a method that will tell me the 10th and 11th character
in a string, and store it as $something. How can this be done?


View Replies !   View Related
Session Info And Pull Down Lists
i have a html pull down list (<SELECT etc etc <OPTION VALUE .....) and
i have the particular value the user last chose it to be in a
$_SESSION['value']. How do i set the selected item of the list to this
one? I can just add it in as the selected item of the list but then it
appears twice.

View Replies !   View Related
My Host Has NO PHP, Pull This Data From Another Server
I'm wondering if anyone here can point me in the right direction. My host
does not provide php, and so I need to pull this data from another server
that does support such scripting.

View Replies !   View Related
Function Or Object To Pull The Cookies?
I am going to set a cookies to user browser, what i am going to "input" the value into cookies is something like "option1=yes,option2=yes,option3=no.."and so on.

The questions are, can i set the cookies with a very long "string", let say 20 options. If yes, will it need others function or object to pull the cookies? What function to use, so that i can split the value from the cookies value..

View Replies !   View Related
Automatically Populate A Pull Down List...
What I want to do is have 2 pull down lists, for example a state pull
down list and a city pull down list. What I would like to have done is
when you select a state from the state pull down list then the city
pull down list will populate with all the cities from that selected
state. I know that is a lot of data but that is just an example. Or
something like when you are looking up cars online they have a make
pull down list and a model pull down list, and when you select the make
it will populate the model pull down list with all the models from that
make.

View Replies !   View Related
How To Pull Only Unique Items From Database?
I have a table like this: date, author, title, content

now I want to grab the 3 latest items from this table from 3 DIFFERENT authors.

I want this:
-article by jim
-article by sally
-article by john

Not this:
-article by jim
-article by jim
-article by sally

even if the two latest articles happen to be by jim, lets only grab the first one and move on.

So basically I need (in pseudo-sql/plaintext):
select title from contenttable where author=unique order by date limit 3

I've got everything code-wise except the "author=unique" part, how do I do that?

View Replies !   View Related

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