Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

$_server[php_self]

 
   Database Forums (Home) -> PHP RSS
Next:  Granularity issues!  
Author Message
Mikey P

External


Since: Mar 27, 2005
Posts: 2



(Msg. 1) Posted: Mon Sep 19, 2005 8:04 am
Post subject: $_server[php_self]
Archived from groups: comp>lang>php (more info?)

hi all i'm having issues with this returned function. I can get it to
delete a database but i really want it to grab the stateselect
extention and grab all the cities related to that state. I wanted to
contain this on one page instead of going over multiple pages which i
can do. Sorry if this doesn't make much sense i'm a newbie.. below is
the code. the isset($_get is where i have the issues. any help would
be appreciated.

<?php

$dbcnx = @mysql_connect('localhost', 'root', '');
if (!$dbcnx) {
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
// Select the hotel database
if (! @mysql_select_db('uniguest') ) {
die( '<p>Unable to locate the Hotel List ' .
'database at this time.</p>' );
}

$result = @mysql_query('SELECT DISTINCT state FROM hotelList ORDER by
state');
if (!$result) {
die('<p>Error performing query: ' .
mysql_error() . '</p>');
}
while ( $row = mysql_fetch_array($result) ) {
echo(' | <a href="' . $_SERVER['PHP_SELF'] . '?stateSelect=' .
$row['state'] . '">' . $row['state'] . '</a>');
}


// Select the hotel database
if (! @mysql_select_db('uniguest') ) {
die( '<p>Unable to locate the Hotel List ' .
'database at this time.</p>' );
}

if (isset($_GET['stateSelect'])) {
$state2 = $_GET['stateSelect'];
$query = mysql_query("SELECT * FROM hotelList WHERE state='$state2'
ORDER by name")
or die (mysql_error());
$name = $row['name'];
echo($name);
} else {
echo('<p>Error: ' .
mysql_error() . '</p>');
}


?>

 >> Stay informed about: $_server[php_self] 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PHP_SELF, $_SERVER, etc - Hello news group, This is a dumb question. Sorry. I would like to pass the name of the "page", along with some $_REQUEST variables. I used the $_REQUEST to send and image name (with path) to a page that displays the image referred to in the...

$_SERVER['PHP_SELF'] Question - I am attempting to use the below Select Form Element to allow users to change the category of data being viewed in a subsequent SQL statement. My problem is, from where I am at, what is my next step to be able to do an "if then else" loop ba...

use of $_SERVER['DOCUMENT_ROOT']. - I'm working on a large intranet group site with a lot of pages, file types, folders, subfolders, etc. I am using the include ('../includes/file.php') , but I would like to have a single snippet that will work for all .php/.html pages in all..

$_SERVER variables under IIS6 - Why is it that IIS6 does not provide all the $_SERVER variables, otherwise available underApache ? Examples being, SERVER_ADDR, SERVER_PORT ... Is there any way to declare server variables under IIS ? Thanks

json and special chars - Hi! In my DB table I've chars like עטלש but when I generate json file I show \u00e0\u00f2\u00e8\u00ec\u00f9 is it right this change in my char? Thanks
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]