Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. what type are 'topics' and 'posts'? are they integers?
  2. yea could change that to whatever you want.
  3. the function.php file is needed as that is where you define your get_xml_ functions as well as include the template.php file. basically you are now passing in the variable you need to call the specific get_xml_ function. so face.php passes "face" into the function. "face" which is now defined as $area in the function gets concatenated to get_xml_$area = get_xml_face and therefore calls the appropriate function defined in the function.php file. hope that makes sense. i'm not the best at explaining.
  4. see my file. [attachment deleted by admin]
  5. Just do everything in your query. $sql = "UPDATE bidding SET status = 'OPEN' WHERE acc_rej = 'accepted' AND acc_rej_timestamp <= DATE_SUB(NOW() INTERVAL 24 HOUR)"; that should work.
  6. this wont work: echo(" <link href="/stylesheet/main.css" media="all" rel="stylesheet" type="text/css"/>"); you need to escape your quotes or use single quotes inside double quotes. see my first post. change that line then see what error you get.
  7. looks like your form isn't posting as all your variables are empty. add print_r($_POST); at the top to make sure you actually have form data coming in. you probably also want to put that block in an if statement so it doesn't execute when there is no form data. if($_POST['submit_button_name']){//form code here}
  8. you have an email address in the $to variable and also your $headers variable. if you look at the headers of your email you will see two TO: fields.
  9. ah k i see it now in functions.php. looks good.
  10. it should. where are you including templates.php in face.php? [attachment deleted by admin]
  11. you need to escape your quotes change echo(" <link href="stylesheet/main.css" media="all" rel="stylesheet" type="text/css"/>"); to echo(" <link href=\"stylesheet/main.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\"/>"); or echo(" <link href='stylesheet/main.css' media='all' rel='stylesheet' type='text/css'/>");
  12. crap your right. i usually have my counter at the start of the loop so it does work. your code however, isn't exactly what he wants as you only get one column per table. also for even rows you will get a double closing table tag. mjdamato's looks nice though. might have to steal =)
  13. because you close off and add the table data every two rows, if you have an odd number of rows the table won't be completed. you need another loop after your main loop to check for this case. $i=1; foreach($listAI as $ai) { echo $i . ':'; $ai_name .= '<td width="175">' . $ai->ai_name . '</td>'; $ai_nie .= '<td width="175">' . $ai->ai_nie . '</td>'; $ai_address .= '<td width="175">' . $ai->ai_address . '</td>'; $ai_loc .= '<td width="175">' . $ai->ai_city. ' '.$ai->ai_state. ', ' .$ai->ai_zip . '</td>'; if($i==1){ $aiOutput .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size:8pt;">'; } if ($i%2==0) { $aiOutput .= '<tr>'. $ai_name . '</tr> <tr>' . $ai_nie .'</tr> <tr>'. $ai_address . '</tr> <tr>' . $ai_loc . '</tr>'; $aiOutput .= '</table><hr />'; $i=1; $ai_name = ''; $ai_nie = ''; $ai_address = ''; $ai_loc = ''; } $i++; } while($i %2 != 0){ $aiOutput .= '<tr>'. $ai_name . '</tr> <tr>' . $ai_nie .'</tr> <tr>'. $ai_address . '</tr> <tr>' . $ai_loc . '</tr>'; $i++; } $aiOutput .= '</table>';
  14. ah good call. grucker give that a try. should work.
  15. can't you add a variable into the function name to make it a dynamic function call?
  16. are you getting an sql error? echo $update in that for loop so you know what you're updating. can you post a print_r of the $_POST array?
  17. The $area variable depends on whatever page you are calling the function. instead of <?= render_products_from_FACE();?> just use <?= render_products('face');?> just make sure to include the function before the call.
  18. function render_products($area) { $output = "<table class='products'><tr>"; $i = 0; foreach (get_xml_$area() as $product) { $output .= ' <td valign="top"> <b class="b1h"></b><b class="b2h"></b><b class="b3h"></b><b class="b4h"></b> <div id="' . $product->id . '" class="product"> <div class="productdescription_face"> <h3>' . $product->title . '</h3> <br/> <p style="text-align:center;"> <img src="' . $product->img . '" alt="'.$product->alt.'" /></p> <p>' . $product->description . '</p> </div> <div style="margin-bottom:15px"> <p><b>' . $product->info . ' </b></p> </div> <div class="price"> <p><b>' . $product->size . ' £' . $product->price .'</b></p> </div> <div class="addToCart"> <form action="../addToCart.php" method="post"> <p> <input type="hidden" name="id" value="'.$product->id.'" /> <input class="red" type="submit" value="Add To Shopping Basket" /> </p> </form> </div> </div> <b class="b4bh"></b><b class="b3bh"></b><b class="b2bh"></b><b class="b1h"></b> </td> '; if ($i >= 2){ // start new row $output .= "</tr><tr>"; // reset loop $i = 0; } else $i++; } if ($i == 1) $output .= '<td></td><td></td>'; else if ($i == 2) $output .= '<td></td>'; $output .= '</tr></table>'; return $output; } that should work. pass in the variable depending on what page it's on. ie. render_products("face"); now you can put the whole function in an include.
  19. check the data in the db. if it has too many slashes to escape quotes etc then there is a problem when you are entering the data into the db.
  20. put a count in your while and name each textfield accode$count. also add a hidden with some kind of identifier for that row. name='hidden$count' and value='$mobile_id'. then when you submit cycle through the post array. check for any accode fields and update according to the hidden field id.
  21. ok so the only difference is the function name and the xml call?
  22. you mean like function render_products_from_BODY() { $output = "<table class='body'><tr>"; $i = 0; foreach (get_xml_face() as $body) {
×
×
  • 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.