This topic is locked

My page

12/4/2006 6:35:30 AM
PHPRunner General questions
M
matteor author

Hi, i've a very great problem!
i'd like to use the "login" system used by phprunner with some my .php pages...
i copy this part of code into my pages:
[code]

<?

ini_set("display_errors","1");

ini_set("display_startup_errors","1");

set_magic_quotes_runtime(0);
include("include/dbcommon.php");
// check if logged in

if(!@$_SESSION["UserID"] || !CheckSecurity(@$_SESSION["OwnerID"],"Add"))

{

$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];

header("Location: login.php?message=expired");

return;

}
$filename="";

$message="";

$error_happened=false;

$readavalues=false;
//connect database

$conn = db_connect();
//here my code...........
?>

[code]
here the problem... i obtain several errors about definied or undefined costant i use into my private scripts, as this:
Informazioni tecniche

Errore di tipo 8

Errore di descrizione Use of undefined constant rigo_unico - assumed 'rigo_unico'

URL localhost/vemapla/admin/matteo_prova.php?id_cat1=6&id_cat2=18&id_prodotto=4

Errore di file c:\programmi\easyphp1-8\www\vemapla\admin\matteo_prova.php

Errore di linea 131

Query SQL
what's the problem?????
thanks for your help!
ps. i receive error too if i use the $php_self variable....

Alexey admin 12/4/2006

Hi,
the way you chose to combine PHPRunner login form with your pages is very complicated.

You need to have a strong knowledge of PHP to get this working.
I recommend you to just put a Login form to your pages and use PHPRunner-created login.php to check the username and password.
Here is the sample code for the login form.

Just put it to your page.

<form method="POST" action="login.php">

Username: <input name=username size=20>



Password: <input type=password name=password size=20>



<input type=hidden name=btnSubmit value="Login">

<input type=submit value="Submit">

</form>



Add a relative path to action="login.php" if needed.

M
matteor author 12/4/2006

Hi,

the way you chose to combine PHPRunner login form with your pages is very complicated.

You need to have a strong knowledge of PHP to get this working.
I recommend you to just put a Login form to your pages and use PHPRunner-created login.php to check the username and password.
Here is the sample code for the login form.

Just put it to your page.
Add a relative path to action="login.php" if needed.


thanks, but it isn't my problem!
problem n. 1: use other pages in my "phprunner created" area (i solve it using the previous code i posted here)
problem n. 2 - very important: several errors about variable undefined
example:
if i use

$query1="SELECT * FROM _griglie WHERE id_prodotto='$id_prodotto' ORDER BY ordine ASC";

$risultato1=mysql_query($query1);

while($row1=mysql_fetch_array($risultato1))

{

$id_griglia=$row1[id];

$valore_a=$valore[$id_griglia];

$query2="INSERT INTO _righe (id_griglia, valore, id_prodotto, rigo_unico) VALUES ('$id_griglia', '$valore_a', '$id_prodotto', '$id_rigo_unico');";

mysql_query($query2);

print "<br>";

}


i've a number 8 error (Use of undefined constant rigo_unico - assumed 'rigo_unico')
instead i use

$query1="SELECT * FROM _griglie WHERE id_prodotto='$id_prodotto' ORDER BY ordine ASC";

$risultato1=mysql_query($query1);

while($row1=mysql_fetch_array($risultato1))

{

$id_griglia=$row1['id'];

$valore_a=$valore[$id_griglia];

$query2="INSERT INTO _righe (id_griglia, valore, id_prodotto, rigo_unico) VALUES ('$id_griglia', '$valore_a', '$id_prodotto', '$id_rigo_unico');";

mysql_query($query2);

print "<br>";

}


everything is ok!
why??

Alexey admin 12/5/2006

I'm afraid we can not help you to fix errors in the code not created by PHPRunner.

M
matteor author 12/5/2006

I'm afraid we can not help you to fix errors in the code not created by PHPRunner.


it's ok, but i want to ask you if phprunner modify the error_reporting variable of php.ini?

Sergey Kornilov admin 12/5/2006

No, PHPRunner don't modify php.ini file.
PHPRunner uses Smarty engine that increases error_reporting level.

I recommend you to fix this error in your code.

M
matteor author 12/6/2006

No, PHPRunner don't modify php.ini file.

PHPRunner uses Smarty engine that increases error_reporting level.

I recommend you to fix this error in your code.


these lines?
ini_set("display_errors","1");

ini_set("display_startup_errors","1");
what are?

Alexey admin 12/6/2006

Yes,
you can remove these lines to disable error reporting