Posted: Sat Apr 12, 2008 1:50 pm Post subject: the page resulting appears without any content(or error), wh
After login at:
http://www.paphoscarhire.com/login.php
the page resulting:
http://www.paphoscarhire.com/update-prices.php
appears without any content(or error), where is the problem ?
Please note the update-prices.php webpage appears data(prices:rent a car rates) in form fields to update and submit back to database ...
Some scripts from update-prices.php follow:
Code:
<?php // script: retrieve from db and show after UPDATE save to db
if ((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123")) || ($_SESSION['login'] = "yes")) {
$_SESSION['login'] = "yes";
} else {
echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>";
sleep(5);
header('Location:login.php');
}
include("dbinfo.php");
$linkid = @mysqli_connect($hostname,$username,$password);
die( "Unable to connect to Database Server. Please try again later.");
@mysqli_select_db($linkid,$database) or die( "Unable to select database. Please try again later,"); // @
$query = "SELECT * FROM updateTable";
$result = @mysqli_query($linkid,$query);
die( "Unable to execute query. Please try again later.");
// $count = @mysql_num_rows($result);
I try debug but after some time spent, appears repeately the below....
$pricesArray[$i][$j] = $row[$j+1]; // line 40
Warning: Cannot use a scalar value as an array in /home/content/l/s/f/lsfontana/html/update-prices.php on line 40
Warning: Cannot use a scalar value as an array in /home/content/l/s/f/lsfontana/html/update-prices.php on line 40
Warning: Cannot use a scalar value as an array in /home/content/l/s/f/lsfontana/html/update-prices.php on line 40
........................
........................
What to write [2 dim array] ?
if I use
$pricesArray = Array();
but I get nothing on screen[even an error] ...How I view SERVER log ? I use sharing hosting a/c from godaddy.com....
Posted: Sun Apr 13, 2008 2:19 pm Post subject: I correct script but nothing on screen even error, ...?
I correct script but nothing on screen even error, ...?
Code:
<?php // script: retrieve from db and show after UPDATE save to db
if ((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123")) || ($_SESSION['login'] = "yes") || (($_POST['username'] == "guest") && ($_POST['password'] == "guest"))) {
$_SESSION['login'] = "yes";
} else {
echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>";
sleep(5);
header('Location:login.php');
}
include("dbinfo.php");
$linkid = @mysql_connect($hostname,$username,$password) or die( "Unable to connect to Database Server. Please try again later.");
@mysql_select_db($database,$linkid) or die( "Unable to select database. Please try again later,"); // @
$query = "SELECT * FROM updateTable";
$result = @mysql_query($query,$linkid) or die( "Unable to execute query. Please try again later.");
// $count = @mysql_num_rows($result);
Posted: Sun Apr 13, 2008 9:35 pm Post subject: this script is on the resulting page(update-prices.php), aft
this script is on the resulting page(update-prices.php), after
LogIn Admin change prices: http://www.paphoscarhire.com/login.php
username="pphch123s"
password="retAsw123" ....see
<body>
<?php // script: retrieve from db and show after UPDATE save to db
if ((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123")) || ($_SESSION['login'] = "yes") || (($_POST['username'] == "guest") && ($_POST['password'] == "guest"))) {
$_SESSION['login'] = "yes";
} else {
echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>";
sleep(5);
header('Location:login.php');
}
include("dbinfo.php");
$linkid = @mysql_connect($hostname,$username,$password) or die( "Unable to connect to Database Server. Please try again later.");
@mysql_select_db($database,$linkid) or die( "Unable to select database. Please try again later,"); // @
$query = "SELECT * FROM updateTable";
$result = @mysql_query($query,$linkid) or die( "Unable to execute query. Please try again later.");
// $count = @mysql_num_rows($result);
Posted: Sun Apr 13, 2008 9:48 pm Post subject: Why it does not move to other rows ?
I use below code and I get(without quotes): "020.5123125.53127.5".
please note that digits after 0 represent prices of ONLY the first row[20.5 12 31 25.5 31 27.5] ? Why it does not move to other rows ?
Code:
<?php // script: retrieve from db and show after UPDATE save to db
/*
if ((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123")) || ($_SESSION['login'] = "yes") || (($_POST['username'] == "guest") && ($_POST['password'] == "guest"))) {
$_SESSION['login'] = "yes";
} else {
echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>";
sleep(5);
header('Location:login.php');
}
*/
include("dbinfo.php");
$linkid = @mysql_connect($hostname,$username,$password) or die( "Unable to connect to Database Server. Please try again later.");
@mysql_select_db($database,$linkid) or die( "Unable to select database. Please try again later,"); // @
$query = "SELECT * FROM updateTable";
$result = @mysql_query($query,$linkid) or die( "Unable to execute query. Please try again later.");
// $count = @mysql_num_rows($result);
Posted: Mon Apr 14, 2008 2:00 pm Post subject: seems session do not get destroyed , well ?
I make it finally work. well another thing, After the application at (http://www.paphoscarhire.com/login.php) confirm price update when I press logout and after try to login without any characters(empty) to username/password I login successfully, seems session do not get destroyed , well ?:
(http://www.paphoscarhire.com/logout.php)
Code:
<?php
session_start();
if ($_POST['logout'] == 'yes') {
$_SESSION = array();
session_destroy();
header('Location:login.php');
} else {
header('Location:update-prices.php');
}
// echo "You will be redirected in a few seconds...";
?>
from script(http://www.paphoscarhire.com/update-prices-processori.php):
Posted: Mon Apr 14, 2008 7:04 pm Post subject: all fixed now just: $query =UPDATE multiline ??? >>&
I get :Unable to execute query. Please go back and retry.
Code:
include("dbinfo.php");
$linkid = @mysql_connect($hostname,$username,$password) or die( "Unable to connect to Database Server. Please try again later.");
@mysql_select_db($database,$linkid) or die( "Unable to select database. Please try again later,"); // @
$query = "UPDATE updateTable SET L='$aL', L7='$aL7', M='$aM', M7='$aM7', H='$aH', H7='$aH7' WHERE cat='A';
UPDATE updateTable SET L='$b1L', L7='$b1L7', M='$b1M', M7='$b1M7', H='$b1H', H7='$b1H7' WHERE cat='B1';
UPDATE updateTable SET L='$b2L', L7='$b2L7', M='$b2M', M7='$b2M7', H='$b2H', H7='$b2H7' WHERE cat='B2';
UPDATE updateTable SET L='$cL', L7='$cL7', M='$cM', M7='$cM7', H='$cH', H7='$cH7' WHERE cat='C';
UPDATE updateTable SET L='$dL', L7='$dL7', M='$dM', M7='$dM7', H='$dH', H7='$dH7' WHERE cat='D';
UPDATE updateTable SET L='$eL', L7='$eL7', M='$eM', M7='$eM7', H='$eH', H7='$eH7' WHERE cat='E';
UPDATE updateTable SET L='$fL', L7='$fL7', M='$fM', M7='$fM7', H='$fH', H7='$fH7' WHERE cat='F';
UPDATE updateTable SET L='$gL', L7='$gL7', M='$gM', M7='$gM7', H='$gH', H7='$gH7' WHERE cat='G';
UPDATE updateTable SET L='$hL', L7='$hL7', M='$hM', M7='$hM7', H='$hH', H7='$hH7' WHERE cat='H';
UPDATE updateTable SET L='$iL', L7='$iL7', M='$iM', M7='$iM7', H='$iH', H7='$iH7' WHERE cat='I';
UPDATE updateTable SET L='$jL', L7='$jL7', M='$jM', M7='$jM7', H='$jH', H7='$jH7' WHERE cat='J';
UPDATE updateTable SET L='$k1L', L7='$k1L7', M='$k1M', M7='$k1M7', H='$k1H', H7='$k1H7' WHERE cat='K1';
UPDATE updateTable SET L='$k2L', L7='$k2L7', M='$k2M', M7='$k2M7', H='$k2H', H7='$k2H7' WHERE cat='K2';
UPDATE updateTable SET L='$nL', L7='$nL7', M='$nM', M7='$nM7', H='$nH', H7='$nH7' WHERE cat='N';
UPDATE updateTable SET L='$pL', L7='$pL7', M='$pM', M7='$pM7', H='$pH', H7='$pH7' WHERE cat='P';
UPDATE updateTable SET L='$sL', L7='$sL7', M='$sM', M7='$sM7', H='$sH', H7='$sH7' WHERE cat='S';
";
// P499
$result = @mysql_query($query,$linkid) or die("Unable to execute query. Please go back and retry.");
echo "<p>Rental Prices get UPDATED sucessfully,...</p>";
You cannot post new topics in this forum You cannot 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