Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables passed along after the .php filename..

Status
Not open for further replies.

sarcoise

IS-IT--Management
Jun 28, 2003
3
US
What purpose do the variables passed along in a link provide? For instance, I have a homepage of INDEX.PHP (no php scripting as far as I can tell within this page). But when you click a link to Login, it links to the same page but with an app variable at the end (i.e.index.htm?app=9995). This used to load a Login table within the same page, but has stopped working for some reason. I am coming in behind someone that passed away over the Christmas Holidays, he developed the site.
 
There should be a variable used by "index.htm" which is named $app.

One thing that might cause something like this to suddenly stop working is if the programmer was simply referencing these variables by their name. Recent versions of PHP set "register_globals" off by default, thus requiring you to reference them as $_GET["app"], or similarly, instead. This approach greatly enhances security, but will break programs written in the old style.
 
Please excuse my novice questions, but I have never had experience running a MySql/IIS server with PHP, only writing simple PHP code.

(I just seen a mistake in my original post, the APP var is passed to this way i.e. INDEX.PHP?APP=9995, and not to an index.htm file.)
Where would I set global varibales? I scanned through php.ini, nothing there.. Is there some sort of config util for php?
Igarner, thanx for the response and not giving me a hard time. I am aware that these are probably simple questions that anyone should be able to answer with a little experience, but you have to learn somehow.. ;)
In the Index.PHP file, "APP" is not referenced anywhere except in the link as mentioned above. Nothing has changed in the programming of the PHP files, as a matter of fact, nothing has changed on the site at all (I did make ONE small change to INDEX.PHP with a text editor, There was a Happy Holidays message in simple HTML and I removed it then saved the file.) I made a backup of INDEX.PHP first and once the link stopped working, I renamed the .bak file back to .PHP.. yet the link has stopped working.
 
If it is not too much code, you might post the code here. The variable could be referenced in the included files if there are any. Also, I know this is a stupid question, but you are checking the .php file through filesystem and not on the web as a view source, right?
 
If a variable isn't listed in php.ini, then its default value is used. I suspect they're documented somewhere at register_globals is the default, so you have to access GET and POST variables as $_GET["var"] and $_POST["var"] (or $_REQUEST["var"] to accommodate both).

Posting the index.php code would indeed be useful if it's not too big.
 
Yea, i'm looking at the code on the server itself via a .txt editor in the inetpub\ folder. I know that the system has to be looking for a variable "app" and when the value = 9995 it is to load logon.php within a table.. (I'm guessing?) So where would this be defined? I'll post index.php for ya to take a look at.. Thanks again..




BEGIN PASTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html>
<head>
<title>Bleakley In-House</title>
<link REL="StyleSheet" TYPE="text/css" HREF="stylesheets/ssc_layout.css" media="all">
<link REL="StyleSheet" TYPE="text/css" HREF="stylesheets/ssc_print.css" media="print">
</head>
<body marginheight="0" marginwidth="0" rightmargin="0" leftmargin="0" bottommargin="0" topmargin="0" bgcolor="#000000">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" colspan="5" bgcolor="#FFCC00" height="1"><img src="images/spacer.gif" border="0" width="1" height="1" alt=""></td>
</tr>
<tr bgcolor="#222222" height="1">
<td width="100%" colspan="5">
<div id="logo">
<table width="100%" border="0" width="100%" cellpadding="4" cellspacing="0">
<tr>
<td width="250"><img src="images/jbmh_logo.jpg" border="0" alt=""></td>
<td valign="bottom"><a href=" target="_blank">Bleakley Website</a></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%" colspan="5" bgcolor="#FFCC00" height="1"><img src="images/spacer.gif" border="0" width="1" height="1" alt=""></td>
</tr>
<tr>
<td width="100%" colspan="5" height="10"><img src="images/spacer.gif" border="0" width="1" height="10" alt=""></td>
</tr>
<tr>
<td width="100%" valign="top">
<!-- Start Content Area --> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>
<td width="125" valign="top" class="menucontent" nowrap><a href=' />
<hr><a href=" />
<a href=" Password</a><hr><a href="/helpdesk/member.php" target="_blank">Help Desk</a><br /></td>
<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>
<td valign="top" class="maincontent"><div>

<center><h1>John Bleakley Motor Homes</h1></center>
<br><br>
<p align="center" style="font-size:14pt; font-weight:bold; color:fff;">
<font style="font-size:28pt; color:0f0;">H</font>
<font style="font-size:28pt; color:f00;">a</font>
<font style="font-size:28pt; color:0f0;">p</font>
<font style="font-size:28pt; color:f00;">p</font>
<font style="font-size:28pt; color:0f0;">y&nbsp;&nbsp;&nbsp;</font>
<font style="font-size:28pt; color:f00;">H</font>
<font style="font-size:28pt; color:0f0;">o</font>
<font style="font-size:28pt; color:f00;">l</font>
<font style="font-size:28pt; color:0f0;">i</font>
<font style="font-size:28pt; color:f00;">d</font>
<font style="font-size:28pt; color:0f0;">a</font>
<font style="font-size:28pt; color:f00;">y</font>
<font style="font-size:28pt; color:0f0;">s</font><br>
</p></div></td>
<td width="10"><img src="images/spacer.gif" border="0" width="10" height="1"></td>
</tr>
</table>
<!-- End Content Area -->
</td>
</tr>
<tr>
<td width="100%" colspan="5" height="10"><img src="images/spacer.gif" border="0" width="1" height="10" alt=""></td>
</tr>
<tr>
<td width="100%" colspan="5" bgcolor="#FFCC00" height="1"><img src="images/spacer.gif" border="0" width="1" height="1" alt=""></td>
</tr>
<tr bgcolor="#222222">
<td width="100%" colspan="5" height="25" align="center">Design By: SSC Software</td>
</tr>
<tr>
<td width="100%" colspan="5" bgcolor="#FFCC00" height="1"><img src="images/spacer.gif" border="0" width="1" height="1" alt=""></td>
</tr>
<tr>
<td width="100%" colspan="5" height="10"><img src="images/spacer.gif" border="0" width="1" height="10" alt=""></td>
</tr>
</table>
<div id="PTitle">
Bleakley In-House System</div>
<script language="javascript" src="clock.js"></script>
<span id="LiveClock"></span>
<script language="javascript">
<!--
show5()
// -->
</script>
END PASTE
</body>
</html>
 
there is no php on this page.. nothing to catch the variable and nothing setting it other then hardcoding index.php?app=9555 which isn't doing anything cause there is nothing there to "catch" it.

you sure this was the whole page?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top