Jump to content

harristweed

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by harristweed

  1. Here is a function I use for replacing new line breaks with p tags. Perhaps you could expand on this. function nl2p($text){ // Return if there are no line breaks. if (!strstr($text, "\n")) { return $text; } // put all text into <p> tags $text = '<p>'.$text.'</p>'; // replace all newline characters with paragraph // ending and starting tags $text = str_replace("\n", "</p>\n<p>", $text); // remove empty paragraph tags & any cariage return characters $text = str_replace(array('<p></p>', "\r" ,"\n"), '', $text); $text = trim($text); return $text; } // end nl2p
  2. I use: if(!isset($_SESSION[email]) it seems to work for me.
  3. I think you mean something like this: <?php function between($price){ $Maxprice = 200 ;// set maximum $Minprice = 100 ;// set minimum if($price <= $Maxprice && $price >= $Minprice){ echo" In range "; }else{ echo" Out side Limit "; } } between(150) ; between(500) ; ?>
  4. Like this: <?php $week=date("W"); switch ($week) { case "20": // it's easter break; case "30": //summer holiday break; case "51": //Christmas break; default: if($week % 2){ //its week a $display = "week a"; }else{ //it's week b $display = "week b"; } } ?>
  5. My thoughts are: If you only have week=a or week=b, get he week number using the date() function and if it'a an odd number week = a even week = b (or vise versa). Include the holiday weeks in a switch statement.....
  6. try something like this: <?php $query = mysql_query("SELECT tblLodges.strLodgeName, tblOfficers.strFirstName, tblOfficers.strLastName FROM tblLodges LEFT JOIN tblOfficers ON tblLodges.lngLodgeID = tblOfficers.lngLodgeID WHERE $metode LIKE '%$search%' LIMIT 0, 50"); $results=mysql_query($query); echo "<table border='1'> <tr> <th>Officer Lodge Name</th> <th>Officer Lodge ID</th> <th>Officer City</th> <th>Officer zip</th> <th>Officer County</th> <th>Officer First</th> <th>Officer last</th> </tr>"; while ($row = mysql_fetch_array($query)) { $variable1=$row["strLodgeName"]; $variable2=$row["strLodgeID"]; $variable3=$row["strDistrictName"]; $variable4=$row["strLodgeLocationCity"]; $variable5=$row["strLodgeLocationZip"]; $variable6=$row["strLodgeCounty"]; $variable7=$row["strFirstName"]; $variable8=$row["strLastName"]; //table layout for results print ("<tr>"); echo "<td class=\"td_id\"><h3>$variable1</h3></td>\n"; echo "<td class=\"td_id\">$row[strLodgeID]</td>\n"; echo "<td class=\"td_id\">$row[strDistrictName]</td>\n"; print "<td class=\"td_id\">$row[strLodgeLocationCity]</td>\n"; print "<td class=\"td_id\">$row[strLodgeLocationZip]</td>\n"; print "<td class=\"td_id\">$row[strLodgeCounty]</td>\n"; print ("</tr>"); } ?> <p class="style1">Roster of Officers </p> <hr width=75% align=center size=4> <p> <?php echo "<table border='1'> <tr> <th>Officer First Name</th> <th>Officer Last Name</th> <th>Officer Business Phone</th> <th>Officer Email</th> </tr>"; while ($row = mysql_fetch_array($query)) { echo "<tr>"; echo "<td>" . $row['strFirstName'] . "</td>"; echo "<td>" . $row['strLastName'] . "</td>"; echo "<td>" . $row['BusinessPhone'] . "</td>"; echo "<td>" . $row['PersEmail'] . "</td>"; echo "</tr>"; } echo "</table>"; ?>
  7. try: <?php header( 'Location: http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=31666&merchantID=$_GET[merch]&programmeID=$_GET[prog]&mediaID=0&tracking=GFC&url=' ) ; ?>
  8. RTFM http://es.php.net/sleep
  9. I don't know if this will help but i've had issues with code working on one server and not on another; quotes causing the problem. The reason was 'magic quotes' was set on one and not the other. The good news is that this sillyness will disappear with PHP6
  10. I think is the form type that needs an addtion, try: <form id="form1" enctype="multipart/form-data" name="form1" method="post" action="process.php">
  11. This won't work because: <input type="hidden" name="return" value="http://192.168.1.38/lennoxhillsitedemo/index.php?option=com_pricecal&task=payment_success"> references your local server, not available from the internet
  12. You can use inbuilt mysql functions to extract timestamp dates in different formats: select date_format('your field name', ' %M %e, %Y') AS readable_date........WHERE.... http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
  13. http://es.php.net/function.array-unique
  14. I've no idea but the Manual says... session_unregister (PHP 4, PHP 5) session_unregister — Unregister a global variable from the current session might be worth swapping 'unset' for 'session_unregister'
  15. please post the code for Kontakt2.php
  16. Try <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  17. <?php $calc_date = mktime(0, 0, 0, date("m"), date("d")-15, date("Y")); $datez=date("Y-m-d",$calc_date); ?>
  18. I think your script has added all the 3,717 Ladder users to the Forum Users: Before Update-1,762 Forum users After Update-5,479 Forum Users 3,717+1,762=5,479
  19. Export from excel as a csv file. Upload the csv file to your server Read the file and update the database as necessary This is how you read the file <?php $filename = "your_file.csv"; $handle = fopen($filename, "rb"); $data = fread($handle, filesize($filename)); //each row will be in array called $data $rows=explode("\r", $data); $count=count($rows); for ($i=0;$i<$count;$i++) { //set $number_columns= columns in spread sheet $sub_data=explode(",", $rows[$i]); for($x=0;$x<=$number_columns;$x++) { // update datbase here //data in column one = $sub_data[$x]; //data in column two = $sub_data[$x]; //data in column three = $sub_data[$x]; } } ?>
  20. I have tried your original code on my computer and it works as it should, therefore the problem is elsewhere. Sorry can't help more.
  21. I'd do this: while ($row = mysql_fetch_array($query)) { echo "<p>".$row['author']."</p>\n"; echo "<p>".$row['date']."</p>\n"; echo "<p>".$row['content']."</p>\n"; }
  22. I didn't know about shopping carts either I started by reading this http://www.adobe.com/devnet/dreamweaver/articles/php_cart.html Then used it to produce this http://www.solpooltables.com/ The advantage for me is that by coding it myself I know exactly (more or less ) what's going on!
  23. I think (not sure ) that a tab produces a line break in excel: Try '" \t "
  24. Have a link from each row in the display page that has the id of the data that will be displayed on the new page... <a href="new_page.php?item_id=432">new page</a> In the new page have the code: $data_key=$_GET['item_id']; Then the sql query, something like: $select ="select * from table name where id_field = '$data_key' "; Display results!
  25. I think a better way is to use CSS look at http://www.starvillasjavea.com/rental_villa_availability.php Find how to do it here http://www.cssplay.co.uk/layouts/frame.html
×
×
  • 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.