Jump to content

rasheedn

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rasheedn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey i just uploaded my validation file and when i tested on my pc it works fine on the host it doesn't! any idea y? here's the validation code: <?php session_start();?> <?php extract($_POST); $_SESSION['user_name'] = "no"; if ($user_name=="admin") { if ($password=="password"){ $_SESSION['user_name'] = "yes"; header("Location: atool.php"); } else{ echo "Wrong password or Username"; $_SESSION['user_name'] = "no"; } } else { echo "Wrong password or Username"; $_SESSION['user_name'] = "no"; } ?>
  2. hey i built my site on local host with apache and myphpadmin everything was fine! didn't know that for some reason register_globals was on NOT off!! i even uploaded it on a friends server and it worked fine! (could only keep it there for a few hours) now uploaded it to the host and bang! they got the off!! and wont' change them of course for security reason! i've read the onlnie help but still don't get what else i need to do everything works fine except when i load some1's data the buttons stop working here's the website u can see what i mean [a href=\"http://www.fisk.me.uk/rasheed/\" target=\"_blank\"]http://www.fisk.me.uk/rasheed/[/a] i have used the extract and all that and still the buttons dont' work after i load some1's data!! here's some of my code (the part to do with the buttons. <? session_start(); ?> <html> <body> <?php include("filledforms.php"); include ("service_page.php"); //ini_set('error_reporting', E_ALL); $_SESSION['History_id']; $_SESSION['Cust_id']; extract($_POST);extract($_GET); if($_POST['Save']){ //this Save is not the one on the main page its on the service page extract($_POST);extract($_GET); sp($PHP_SELF); } else if ($_GET['History_id']) { // this will display the history details extract($_POST);extract($_GET); $History_id = $_GET['History_id']; $result = mysql_query("SELECT `History_id` , `Serv_date` , `Short_desc` , `Mot` , `Serv_details` , `Part_charge` , `Labor` , `Mot_charge` FROM `service` WHERE 1 AND `History_id` = '$History_id'"); $myrow = mysql_fetch_array($result); $Serv_date = $myrow[Serv_date]; $Short_desc = $myrow[Short_desc]; $Mot = $myrow[Mot]; $Serv_details = $myrow[Serv_details]; $Part_charge = $myrow[Part_charge]; $Labor = $myrow[Labor]; $Mot_charge = $myrow[Mot_charge]; $Total = 0 + $Part_charge + $Labor + $Mot_charge; $VAT =0.175*$Total; $GTOTAL = $VAT + $Total; service_page(&$PHP_SELF , $Serv_date,$Short_desc,$Mot,$Serv_details,$Part_charge,$Labor,$Mot_charge,$Total,$VAT,$GTOTAL); }else if($_GET['Cust_id']){ // this will display the search results extract($_POST);extract($_GET); $Cust_idd= $_GET['Cust_id']; $result = mysql_query("SELECT `Cust_id` , `First_name` , `Last_name` , `Address` , `Post_code` , `Phone_number` , `Mobile_number` , `Number_plate` , `Car` , `Model` , `Year` , `Mot_exp` FROM `customer` WHERE 1 AND `Cust_id` = '$Cust_idd' "); $myrow = mysql_fetch_array($result); $Cust_id = $myrow[Cust_id]; $First_name = $myrow[First_name]; $Last_name = $myrow[Last_name]; $Address = $myrow[Address]; $Post_code = $myrow[Post_code]; $Phone_number = $myrow[Phone_number]; $Mobile_number = $myrow[Mobile_number]; $Number_plate = $myrow[Number_plate]; $Car = $myrow[Car]; $Model = $myrow[Model]; $Year = $myrow[Year]; $Mot_exp = $myrow[Mot_exp]; $_SESSION['Cust_id'] = $Cust_id; main_page_wv(&$PHP_SELF , $First_name , $Last_name , $Address , $Post_code , $Phone_number , $Mobile_number , $Number_plate , $Car , $Model , $Year , $Mot_exp); $result2 = mysql_query("SELECT `Cust_id` , `History_id` , `Serv_date` , `Short_desc` , `Mot` , `Serv_details` , `Part_charge` , `Labor` , `Mot_charge` FROM `service` WHERE 1 AND `Cust_id` = '$Cust_id'"); $howmanyrows2=mysql_num_rows($result2); $myrow2 = mysql_fetch_array($result2); if ($myrow2 > 0){ echo "<b>History:</b> ","<br />\n" ; do { //print the history for the current user echo "<a href=\"".$PHP_SELF."?History_id=".$myrow2["History_id"]."\">".$myrow2["Serv_date"]." - ".$myrow2['Short_desc']."</a><br>"; echo "<br />\n"; } while ($myrow2 = mysql_fetch_array($result2)); }
  3. any1?? i still can't figure it out:(
  4. Sanfly Thanks that " " worked perfect :) as for 2 here's some code that i hope will explain.... i have 4 files 2 normal php files and 2 files that have the code to display the forms and page its a 2 page website (main page and service page) ***********1st file (main_page_forms.php)********** ..... function m_p((&$PHP_SELF, $First_name, $Last_name, $Address, $Post_code ...){ here i have a couple of these <input type="text" name="First_name" size="27" value = "<? echo $First_name;?>"></td> and 4 buttons like this <form name ="otherbuttons" action="<?php echo ($PHP_SELF)?>"METHOD=POST> <input name="Service_details" type="submit" style="color: #FF0000" value="Service Details"></td> <td width="70" height="27"> <input type="submit" value="Save" name="save"></td> <td width="314" height="27"> <input type="submit" value="Search" name="search"> <input name="clear" type="reset" onClick="MM_goToURL('parent','testing5.php');return document.MM_returnValue" value="Clear"></td> } *******2nd file is the main page itslef (main_page.php)********** include("main_page_forms.php"); include("dbinfo.inc.php"); ..... if($_GET['Cust_id']){// this will display the search results $Cust_idd= $_GET['Cust_id']; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $sql = ("SELECT `Cust_id` , `First_name` , `Last_name` , `Address` , `Post_code` , `Phone_number` , `Mobile_number` , `Number_plate` , `Car` , `Model` , `Year` , `Mot_exp` FROM `customer` WHERE 1 AND `Cust_id` = '$Cust_idd' "); $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $Cust_id = $myrow[Cust_id]; $First_name = $myrow[First_name]; $Last_name = $myrow[Last_name]; $Address = $myrow[Address]; $Post_code = $myrow[Post_code]; $Phone_number = $myrow[Phone_number]; $Mobile_number = $myrow[Mobile_number]; $Number_plate = $myrow[Number_plate]; $Car = $myrow[Car]; $Model = $myrow[Model]; $Year = $myrow[Year]; $Mot_exp = $myrow[Mot_exp]; $_SESSION['Cust_id'] = $Cust_id; $temp = main_page_wv(&$PHP_SELF , $First_name , $Last_name , $Address , $Post_code , $Phone_number , $Mobile_number , $Number_plate , $Car , $Model , $Year , $Mot_exp); $result2 = mysql_query("SELECT `Cust_id` , `History_id` , `Serv_date` , `Short_desc` , `Mot` , `Serv_details` , `Part_charge` , `Labor` , `Mot_charge` FROM `service` WHERE 1 AND `Cust_id` = '$Cust_id'"); $howmanyrows2=mysql_num_rows($result2); $myrow2 = mysql_fetch_array($result2); do { //print the history for the current user echo "<a href=\"".$PHP_SELF."?History_id=".$myrow2["History_id"]."\">".$myrow2["Serv_date"]." - ".$myrow2['Short_desc']."</a><br>"; echo "<br />\n"; } while ($myrow2 = mysql_fetch_array($result2)); }else if($_POST[search]){ //if clicked on the search button extract($_POST); mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query(" SELECT `Cust_id` , `First_name` , `Last_name` , `Address` , `Post_code` , `Phone_number` , `Mobile_number` , `Number_plate` , `Car` , `Model` , `Year` , `Mot_exp` FROM `customer` WHERE 1 AND `First_name` LIKE '$First_name' OR `Last_name` LIKE '$Last_name' OR `Post_code` LIKE '$Post_code' OR `Number_plate` LIKE '$Number_plate'"); $howmanyrows =mysql_num_rows($result); if ($howmanyrows == 1){ $myrow = mysql_fetch_array($result); do { $Cust_id = $myrow[Cust_id]; $First_name = $myrow[First_name]; $Last_name = $myrow[Last_name]; $Address = $myrow[Address]; $Post_code = $myrow[Post_code]; $Phone_number = $myrow[Phone_number]; $Mobile_number = $myrow[Mobile_number]; $Number_plate = $myrow[Number_plate]; $Car = $myrow[Car]; $Model = $myrow[Model]; $Year = $myrow[Year]; $Mot_exp = $myrow[Mot_exp]; main_page_wv(&$PHP_SELF , $First_name , $Last_name , $Address , $Post_code , $Phone_number , $Mobile_number , $Number_plate , $Car , $Model , $Year , $Mot_exp); $result2 = mysql_query("SELECT `Cust_id` , `History_id` , `Serv_date` , `Short_desc` , `Mot` , `Serv_details` , `Part_charge` , `Labor` , `Mot_charge` FROM `service` WHERE 1 AND `Cust_id` = '$Cust_id'"); $howmanyrows2=mysql_num_rows($result2); $myrow2 = mysql_fetch_array($result2); do { //print the history for the current user echo "<a href=\"".$PHP_SELF."?History_id=".$myrow2["History_id"]."\">".$myrow2["Serv_date"]." - ".$myrow2['Short_desc']."</a><br>"; echo "<br />\n"; } while ($myrow2 = mysql_fetch_array($result2)); } while ($myrow = mysql_fetch_array($result)); $_SESSION['Cust_id'] = $Cust_id; }else if (($myrow = mysql_fetch_array($result))and ($howmanyrows >1)) { main_page_wv(&$PHP_SELF , $First_name , $Last_name , $Address , $Post_code , $Phone_number , $Mobile_number , $Number_plate , $Car , $Model , $Year , $Mot_exp); echo "Search Results :<br /><br /> "; do { echo "<a href=\"".$PHP_SELF."?Cust_id=".$myrow["Cust_id"]."\">".$myrow["First_name"]." ".$myrow['Last_name']." "." - ".$myrow['Address']." - ".$myrow['Post_code']." - ".$myrow['Car']." - ".$myrow['Model']."</a><br>"; echo "<br />\n"; } while ($myrow = mysql_fetch_array($result)); }else{ //nothing found main_page_wv(&$PHP_SELF , $First_name , $Last_name , $Address , $Post_code , $Phone_number , $Mobile_number , $Number_plate , $Car , $Model , $Year , $Mot_exp); echo "Sorry but nothing is found!"; } }else if($_POST[Service_details]){ and here a couple of validation things to make sure all items have been entered and the last one i want it to load (service_details.php) !! i can't find a function to do that! }} ******3rd file is the service page forms(service_page_forms.php)****** function service_page(&$PHP_SELF , $Serv_date,$Short_desc,.....) and a few inputs like <td width="283" colspan="2"><input type="text" name="Serv_date" size="20"value = <? echo $Serv_date;?>></td> and forms... <form action="<?php echo ($PHP_SELF)?>"METHOD=POST> <input type="submit" name="Save" value="Save"> <input name="p_invoice" type="submit" onClick="MM_callJS('javascript:print()')" value="Print Invoice"> <input name="clear2" type="reset" onClick="MM_goToURL('parent','servicedetails2222.php');return document.MM_returnValue" value="Clear"></td> <td height="50" width="134"> <input name="mainpage" type="submit" onClick="MM_goToURL('parent','testing5.php');return document.MM_returnValue" value="Main Page"></td> } **************4th file is the Service page itself(service_page.php)*************** include ("service_page_forms.php"); deals with the service page buttons... in the 2nd file as you can see if i click on the search button and 2 items are found then i display the results as a link to the main page with ?custid=id! and i got another if statement at the top to load the page to load the main page using the custid! once the page is loaded tho non of the button work!!(except the clear!!) and this is the problem i have! i hope this makes sense!!
  5. hi, i've built a website with a mysql db i;ve got a few problems that i need some help with 1. <input type="text" name="Post_code" size="26" value = <? echo $Post_code;?>></td> in the above code, if $Post_code has a space it won't echo anything after the space! cant' figure out why! example, if $Post_code = "sw1 4ts" , then the output will be only "sw1" without the rest!! 2. is there a function like echo but instead of outputting something on the screen i want it to move to another page! without me having to click on anything ! i've got like a validation on an entry, and if its valid i want it to load a new page (loaclhost/newfolder/testing1.php) as an example i've done it in a different way for now and it works but with a slight problem !!hehe i've created a function to output testing1.php! and once the validation is complete i just call the function. now this works fine except the buttons dont' work anymore!(the buttons on testing1.php) (they work fine if i open testing1.php) i've been trying to fix this for a whole day and i've lost hope!! any help would be greatly appreciated sorry if my english is crap! hope u understood what i mean:) thanks Rasheed
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.