Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,464 members, 7,816,089 topics. Date: Friday, 03 May 2024 at 03:54 AM

Php Help! Urgent - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php Help! Urgent (788 Views)

Html Audio Help......urgent / Php Help / Email Retrieval With Php - Help Anyone? (2) (3) (4)

(1) (Reply) (Go Down)

Php Help! Urgent by joomlaguru: 11:11am On Aug 19, 2011
Here is the code but i think there something wrong with it.

<?php foreach($rexzs as $rexz){
$i++;
$rexzs=explode("|",$rexz);
$database->setQuery("SELECT * FROM `jos_bookman_extras` WHERE `id`=".$rexzz[0]);
$exts=$database->loadObjectList();
echo "<tr><td align='center'>";
foreach($exts as $ext){
echo $ext->name;
} echo "<input type='hidden' value='".$ext->name."' name='ext_name".$i."' /></td><td align='center'>";
if($rexzs[1]==1)echo "Daily";else echo "One Time";
echo "<input type='hidden' value='".$rexzs[1]."' name='chargetype".$i."' /></td><td align='center'>";
echo "<select name='quantity".$i."'>";
for($j=0;$j<=$rexzs[3];$j++){
echo "<option ";
if($_POST['quantity'.$i]==$j)echo "selected";
echo " value='".$j."'>0".$j."</option>";
}
echo "</select>";
echo "</td><td align='center'>";
if($rexzs[1]==1){
echo "<select name='days".$i."'>";
for($j=0;$j<=$days;$j++){
echo "<option ";
if($_POST['days'.$i]==$j)echo "selected";
echo " value='".$j."'>0".$j."</option>";
} echo "</select>";
}else echo "<input type='hidden' value='' name='days".$i."' />";
echo "</td><td align='center'> $ ".$rexzs[2];
echo "</td><td align='center'> $ ";
if(!empty($_POST['quantity'.$i])) {
if($_POST['days'.$i]=='') echo ($_POST['quantity'.$i]*$rexzs[2]);
else echo ($_POST['days'.$i]*$_POST['quantity'.$i]*$rexzs[2]);
$total_ext+=$_POST['days'.$i]*$_POST['quantity'.$i]*$rexzs[2];
} else echo "0";
echo "<input type='hidden' name='cost".$i."' value='".$rexzs[2]."' />";
echo "</td></tr>"
}
?>

Thank you in anticipation.
Re: Php Help! Urgent by farouqzaib: 11:24am On Aug 19, 2011
Hello, I haven't really scanned ur code fully yet but I noticed a typo. U used $rexzz in the mysql statement insted of $rexzs.
Re: Php Help! Urgent by joomlaguru: 11:38am On Aug 19, 2011
ok, thanks.
I have done that but still has issues.
Re: Php Help! Urgent by farouqzaib: 11:48am On Aug 19, 2011
What issues? What error(s) do u get?
Re: Php Help! Urgent by joomlaguru: 11:58am On Aug 19, 2011
It is actually a joomla site for booking, when click on submit, this page is suppose to display information filled and you can also modify but when submitted it brings a blank page.
Re: Php Help! Urgent by farouqzaib: 12:02pm On Aug 19, 2011
set error reporting to all so u can view all php's insults(Don't ask me how). I'm sure there is a fatal error that is y it is blank.
Re: Php Help! Urgent by joomlaguru: 12:23pm On Aug 19, 2011
Thank you for your help, i have modified the error reporting.
I am filling the form now and i will get back to you as per the error.

Thank you once again.
Re: Php Help! Urgent by farouqzaib: 12:42pm On Aug 19, 2011
No worries mate. I hope I can be of help.
Re: Php Help! Urgent by Fayimora(m): 12:33am On Aug 20, 2011
Try posting an INDENTED code next time! Am sure others ddnt reply this cause ur code was jumble mumble.
Re: Php Help! Urgent by Nobody: 12:51am On Aug 20, 2011
Re: Php Help! Urgent by joomlaguru: 4:58pm On Aug 20, 2011
Thank you for the advise
Re: Php Help! Urgent by joomlaguru: 2:06pm On Aug 24, 2011
Tag has been added, pls can u help now;

   1.   <?php $obj = new Unit();
   2.   {
   3.   global $database;
   4.   $Unit = $obj->select_row_query
   5.   ("SELECT `reservation_extras` FROM `".$obj->get_table_name()."`
   6.   WHERE `id` = '".$_GET['PropertyId']."' AND `published` = 1", 1);
   7.   $rexzz=explode(",", $Unit->reservation_extras);
   8.   $i=0;
   9.   $total_ext=0;
  10.  if(!empty($Unit->reservation_extras)||$Unit->reservation_extras=='[end]');
  11.  }
  12.  foreach($rexzz as $rexz)
  13.  {
  14.  $i++;$rexzz=explode("|",$rexz);
  15.  $database->setQuery("SELECT * FROM `jos_bookman_extras` WHERE `id`=".$rexzz[0]);
  16.  $exts=$database->loadObjectList();
  17.  echo "<tr><td align='center'>";
  18.  foreach($exts as $ext)
  19.  {
  20.  echo $ext->name;
  21.  }
  22.  echo "<input type='hidden' value='".$ext->name."' name='ext_name".$i."' /></td>
  23.  <td align='center'>"; if($rexzz[1]==1)echo "Daily";else echo "One Time";
  24.  echo "<input type='hidden' value='".$rexzz[1]."' name='chargetype".$i."' /></td>
  25.  <td align='center'>"; echo "<select name='quantity".$i."'>";
  26.  for($j=0;$j<=$rexzz[3];$j++)
  27. {echo "<option ";
  28. if($_POST['quantity'.$i]==$j)echo "selected";
  29.  echo " value='".$j."'>0".$j."</option>";
  30.   }
  31.  echo "</select>";
  32.  echo "</td>
  33.  <td align='center'>";
  34.   if($rexzz[1]==1)
  35.   {
  36.  echo "<select name='days".$i."'>";
  37.  for($j=0;$j<=$days;$j++)
  38.  {
  39.  echo "<option ";
  40.  if($_POST['days'.$i]==$j)echo "selected";
  41.  echo " value='".$j."'>0".$j."</option>";
  42.   }
  43.  echo "</select>";
  44.   }
  45.  else echo "<input type='hidden' value='' name='days".$i."' />";
  46.  echo "</td><td align='center'> $ ".$rexzz[2];
  47.  echo "</td><td align='center'> $ ";
  48.   if(!empty($_POST['quantity'.$i]))
  49.   {
  50.  if($_POST['days'.$i]=='') echo ($_POST['quantity'.$i]*$rexzz[2]);
  51.  else echo ($_POST['days'.$i]*$_POST['quantity'.$i]*$rexzz[2]);
  52.  $total_ext+=$_POST['days'.$i]*$_POST['quantity'.$i]*$rexzz[2];
  53.  }
  54.  else echo "0";
  55.  echo "<input type='hidden' name='cost".$i."' value='".$rexzz[2]."' />";
  56.  echo "</td></tr>"
  57.   }
  58.  ?>
Re: Php Help! Urgent by Fayimora(m): 10:47am On Aug 26, 2011
lmao your code is still not indented properly! Please remove those numbers! Makes it difficult copying ur code, Just post a plane version and I would indent it for you and what is it you need help with?
Re: Php Help! Urgent by farouqzaib: 10:55am On Aug 26, 2011
@OP, this here is what they mean by indentation;

<?php

foreach($rexzs as $rexz){

     $i++;

     $rexzs=explode("|",$rexz);

     $database->setQuery("SELECT * FROM `jos_bookman_extras` WHERE `id`=".$rexzz[0]);

     $exts=$database->loadObjectList();

     echo "<tr><td align='center'>";

     foreach($exts as $ext){

          echo $ext->name;

     }

     echo "<input type='hidden' value='".$ext->name."' name='ext_name".$i."' /></td><td align='center'>";

     if($rexzs[1]==1)  echo "Daily";else echo "One Time"; //This is bad, one liners are kinda evil

     /** it should be
     *
     *if($rexzs[1]==1) {
     *
     *   echo "Daily";else echo "One Time";
     *
     *}
     */


     echo "<input type='hidden' value='".$rexzs[1]."' name='chargetype".$i."' /></td><td align='center'>";

     echo "<select name='quantity".$i."'>";

     for($j=0;$j<=$rexzs[3];$j++){
,
Beautiful he. It's your code, it just got a whole new makeover. Finish it up yaself.
Re: Php Help! Urgent by Fayimora(m): 11:11am On Aug 26, 2011
hahaha. I think we should start using Gist or pastebin or pastie for code now cause NL doesn't have a SH. Moving this to the webmasters section!

(1) (Reply)

Ways To Promote My Blog / Online Payment Made Easy / How Can Nairaland Or Any Other Nigerian Website Supplant The Big 4 In Nigeria?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 29
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.