Home » Forums » DBManager General
 
n00bie struggling with php wizard (968 previews)
n00bie struggling with php wizard Posted in 30th, 10/2004 10:36 by gogga81
I am a complete n00bie at this... a week ago I didn't know ANYTHING about MySQL/php...

I'm trying to get the php wizard to work... I created a search record form, but when I open the page in my browser I get the message...

"Error loading this page. Parameters not informed."

What have I done wrong? ( I suspect that it may be in my Apache 2.0.52 / PHP 4.3.8 / MySql 4.0.21 setup... but I have no idea where to start.

Can anyone give me bit of advice?

Thanks
fred
Re: n00bie struggling with php wizard Posted in 31th, 10/2004 12:20 by support
Hi,

Probably your script expects some parameters which are not being used when loading the script. If this is the case you may accomplish this by inserting the parameters in the URL in your browser. See the example:

- Let's suppose your script needs the variable $somecode, you can load the script in your browser like this:

http://yourhost/script.php?somecode=somedata

where:

somecode is the name of the variable,
somedata is the value you want to use.

Hope that helps,


Support / DBTools Software
Re: n00bie struggling with php wizard Posted in 31th, 10/2004 08:03 by gogga81
Thanks for the reply... but it doesn't help me much. the wizard created 2 files: connect.php and one that I named results2.php I have quoted below the whole of connect.php and the initial lines of results2.php

connect.php
-----------
$db = mysql_connect("localhost", "root", "");
if( !$db )
{
die("Error connecting to the Server");
exit;
}
$result = mysql_select_db("billing", $db);
if( !$result )
{
die("Error selecting Database");
exit;
}
?>


results2.php
------------
include("connect.php");
if( !$patient_last_name )
die("Error loading this page. Parameters not informed.");
?>

The Apache server log gives the following error message:
Undefined variable: patient_last_name in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\results2.php on line 3

Where do I go from here?

Thanks
fred
Re: n00bie struggling with php wizard Posted in 01th, 11/2004 09:28 by support
gogga81 wrote:
The Apache server log gives the following error message:
Undefined variable: patient_last_name in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\results2.php on line 3

Where do I go from here?
Thanks
fred


Just execute the following in your browser:

http://yourhost/results2.php?patient_last_name=something

This is a GET script in which you should give the parameters in order to get the results. Also you can create a form with this data and submit the results to the script.


Support / DBTools Software
Re: n00bie struggling with php wizard Posted in 01th, 11/2004 02:39 by gogga81
Thanks... I tried both suggestions and got the same error message.


fred
Re: n00bie struggling with php wizard Posted in 02th, 11/2004 09:55 by support
Hi,

I forgot to mention something in my last reply. In newer versions of PHP you need to execute the following command to get the variable and its contents:

$var_name = $_GET['var_name'];

DBManager 2.3.0 and previous versions don't insert this in your scripts.

Hope that helps,


Support / DBTools Software
n00bie struggling with php wizard (968 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » DBManager General