Page 1 of 2

Request

Posted: Wed Oct 26, 2005 4:09 am
by bigdavemmu
Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hello all...

I have a HTML page that sends some data to a PHP page via a form. Send method is GET.

I have tried all the combinations known to man to get the data to print to screen in the PHP page, ie $_REQUEST, $_GET and changed the HTML so it posts the data and tried $_POST in the PHP page.

All I am trying to do is get it to write the sent data to screen but it's proving very difficult. Can someone please help.

The HTML page can be found at [url]http://www.candoslimming.com/members.html[/url] and the PHP is below:

Code: Select all

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3c.org/1999/xhtml" xml:lang="en" lang="en">


<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<meta name="generator" content="Adobe GoLive">
		<title>Check Database</title>
	</head>

	<body bgcolor="#ffffff">
		<?PHP
		echo "test"
		?>
		<br><br><br>
		<?PHP

		
// Connecting, selecting database
$link = mysql_connect(':/var/lib/mysql/mysql.sock', 'root', 'abc123')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully<br><br>';
mysql_select_db('login')
or die('Could not select database<br><br>');
echo 'Connected to LOGIN database<br><br>';

// Performing SQL query

$pinID = $_REQUEST['thepin'];

echo "'$pinID'";

//echo $pinID;

$query = "select * from `keys`";

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "\t<tr>\n";
    foreach ($line as $col_value) {
        echo "\t\t<td>$col_value</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
 ?>
		
		
	</body>

</html>
Any help would be great.

Thanks

BigDave


Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Wed Oct 26, 2005 6:17 am
by shiznatix
try doing

Code: Select all

print_r($_GET);
that should give you a bit of a start. i don't see why it is not actually working though. seams strange

Not working

Posted: Wed Oct 26, 2005 6:31 am
by bigdavemmu
That isn't working either mate!

Do you have a clue whatsoever as to why this isn't working?? Could it be the server??

Thanks Again

Posted: Wed Oct 26, 2005 6:43 am
by shiznatix
make a seperate page with this in it

Code: Select all

<?
if (!empty($_POST['name']))
  echo 'Hello! You Entered '.$_POST['name'].' as your name';
else
{
  ?>
    <form action="name_of_this_page.php" method="post">
      Enter a name: <input type="text" name="name">
      <input type="submit" value="submit">
    </form>
  <?
}
just change the form action to the correct name of that page. see if that works

Good idea

Posted: Wed Oct 26, 2005 6:51 am
by bigdavemmu
Good Idea Mate...

Unfortunately...It's not picking up the name that is passed accross. I don't know what to do. I don't manage the server so could this be a setting in the PHP.ini file that needs changing???

Cheers

:(

Posted: Wed Oct 26, 2005 7:35 am
by n00b Saibot
I have a suspicion, does print_r($HTTP_REQUEST_VARS) work :?:

Nope

Posted: Wed Oct 26, 2005 7:45 am
by bigdavemmu
Nope...that gives me a parse error.

I have the file working on my local server (XP, running PHP v5.)

Is it possible that the server I'm using has an older version of PHP installed?

Thanks

Posted: Wed Oct 26, 2005 7:47 am
by Jenk
do

Code: Select all

<?php

var_dump($_REQUEST);

?>

Posted: Wed Oct 26, 2005 8:06 am
by n00b Saibot
oh sorry! change that to $HTTP_GET_VARS

Posted: Wed Oct 26, 2005 8:37 am
by bigdavemmu
That gives me the same parse error! Doh :(

Posted: Wed Oct 26, 2005 8:38 am
by bigdavemmu
variable dump returns a null

Posted: Wed Oct 26, 2005 8:41 am
by Jenk
Which version of PHP are you running?

Posted: Wed Oct 26, 2005 8:42 am
by n00b Saibot
8O

Posted: Wed Oct 26, 2005 9:23 am
by bigdavemmu
how do i check my php version?

Posted: Wed Oct 26, 2005 9:31 am
by feyd
phpversion()
phpinfo()

Your configuration may have turned off long vars...