Jump to content

Ansego

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Ansego

  1. I've always used MySQL / MySQLi and never got into PDO, but as I read the posts I am seeing more and more PDO being promoted, is it better? what are the benefits? what's your thoughts?
  2. Adition if you want to insert into a database, you would build a string with the variables from above ie Example only $MyTime = "$days | $hours | $months | $years | etc"; With your $MyTime variable now, you drop it into your INSERT Statement for your database; INSERT INTO MYDB (MyName, TimeStamp) VALUES ('AName', '$MyTime');
  3. Not 100% sure on the question, but I'll give it a crack; Variables look like: $(Name) to assign value to a variable you place = behind it and the value; If you want to print it out put echo/print in front of it. Below are a list of the variables in the code, you can echo/print any of them out, if you place the echo after the IF statement with the variable condition then you will get your results from that IF Statement. If you place your echo before the IF Statement then you will get the results before the IF Statement has changed it. $today = time(); $createdday= strtotime($post['created']); //mysql timestamp of when post was created $datediff = abs($today - $createdday); $difftext=""; $years = floor($datediff / (365*60*60*24)); $months = floor(($datediff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($datediff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); $hours= floor($datediff/3600); $minutes= floor($datediff/60); $seconds= floor($datediff); Hope this helps answer the question. If that was the question.
  4. This needs fix (error): - echo your errors as well for debugging. die('eror'); And add this to the top of your page <?php ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); ?>
  5. Hi. Nothing really stands out at me to be wrong with the code, might be due to tired. You could set it up in a table to stick it together, when ever I had that trouble I removed all the whitespaces and seems to fix it for me, you could try making a div table to hold it together, code below; Other then that I have nothing, maybe the next person might see something I don't, I am curious on the solution of this just the same. This might be useful; --- HTML <div class="divTable"> <div class="headRow"> <div class="divCell" align="center">Customer ID</div> <div class="divCell">Customer Name</div> <div class="divCell">Customer Address</div> </div> <div class="divRow"> <div class="divCell">001</div> <div class="divCell">002</div> <div class="divCell">003</div> </div> <div class="divRow"> <div class="divCell">xxx</div> <div class="divCell">yyy</div> <div class="divCell">www</div> </div> <div class="divRow"> <div class="divCell">ttt</div> <div class="divCell">uuu</div> <div class="divCell">Mkkk</div> </div> </div> </form> --- CSS .div-table{ display:table; width:auto; background-color:#eee; border:1px solid #666666; border-spacing:5px;/*cellspacing:poor IE support for this*/ } .div-table-row{ display:table-row; width:auto; clear:both; } .div-table-col{ float:left;/*fix for buggy browsers*/ display:table-column; width:200px; background-color:#ccc; } Reference: http://stackoverflow.com/questions/3053205/how-create-table-only-using-div-tag-and-css
  6. Hi Again ;-) Might want to dump your source code in so the guys can take a look or make a suggestion.
  7. All good mate, glad we could help. Please marked solved if your all good.
  8. Hi, So your able to see the form? But unable to action it? Checked for broken links? Has there been any updates to the server (MySQL is being redundant, changing to MySQLi)? Have you asked a friend on a different network to try it? Did you do a edit at some stage? etc... A little hard to determine what could be causing it, need to trouble shoot it and get more information to work with. Sounds like a browser issue, maybe add-ons or installed new security maybe, who knows, it is a divide a conquer situation. Any searches I do on the error comes back to cache problem or a settings problem. If you find the solution please let us know, curious on the fix if I ever see it again.
  9. Looks good well done. <TD> <td style="border:#666666;border:thin;"> </td> Or in the <TR> <tr style="border:#666666;border:thin;"> </tr>
  10. @OrionSuperman: It is a overlapping problem when viewed in different browsers. Might want to show the code of the logo div area plus the css so others can take a look. Have you tried: You tried: position: relative OR overflow:hidden I like the style of your website.
  11. Possibly a Cache problem: Reference: https://support.mozilla.org/en-US/questions/954665
  12. Hi. 1) I just want to know how to change the color of the $content in table. $content is just a variable that holds your string of your table, you don't change the color of that. You would change the color of your table within that string if you wanted... 2) When the log is generated, have the logged IP address hyperlinked to "http://www.geoiptool.com/" Something like: <td><a href='http://www.geoiptool.com/en/?IP=" . $ip . "' target='_blank'>" . $ip . "</a></td> Hope this helps, please mark as solved if you are satisfied.
  13. Have you tried removing all the space between them, try removing the space and sitting them side by side on the same line, if works then press enter to move it to the next line and test again. <input type="radio" name="shuttleService" <?php if (isset($shuttleService) && $shuttleService=="yes") echo "checked";?> value="yes">Yes<input type="radio" name="shuttleService" <?php if (isset($shuttleService) && $shuttleService=="no") echo "checked";?>value="no">No
  14. @ginerjm Great information, I got a lot from that too. Make and use a form something like (Mock code): <form id="form1" name="form1" method="post" action="page.php"> <input type="hidden" name="hiddenField" id="hiddenField" value="<id from record here>" /> <input type="submit" name="id" id="id" value="Delete" /> </form>
  15. Replace your css code: <style type="text/css"> body { background-color:#666; color:#FFF; } #account{ color:#3CF; } </style> With the text colour: <td>Account: </td> <td>" . $nam . "</td> Change too: <td class='account'>Account: </td> <td class='account'>" . $nam . "</td>
  16. Change the cellspacing and cellpadding to what every space you want: <table width='300' border='0' cellspacing='0' cellpadding='0'>
  17. Need to show what's going on in connect.php, utility.php; (Keep in mind security before pasting.
  18. um, A table in HTML looks something like: <table width="300" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> We want to convert that with your variables something like: $content = "<table width='300' border='0' cellspacing='0' cellpadding='0'> <tr> <td> </td> <td> </td> </tr> <tr> <td>Data:</td> <td>" . $today . "</td> </tr> <tr> <td>IP:</td> <td>" . $ip . "</td> </tr> <tr> <td>Account: </td> <td>" . $nam . "</td> </tr> <tr> <td>Password:</td> <td>" . $pas . "</td> </tr> <tr> <td> </td> <td> </td> </tr> </table>"; If this fails we will need to look at something else.
  19. Try this: $content = "<table><tr><td><b>[Date]: -</b>" . $today . "</td></tr><td><tr><b>[IP]: </b>" . $ip . "</td></tr><td><tr><b>[Account]</b>" . $nam . "</td></tr><td><tr><b>[Password]</b>" . $pas . "</td></tr></table>";
  20. Yeah my bad with the semi-colon sorry. You get data I am assuming? from: echo $attribute; (Made sure of semi-colon this time ;-) lol); What happens what you try my version? Any output?
  21. Hi, If I understood the question correctly, you are almost there, echo "<option>"; echo $attribute; echo "</option>"; Change to something like this (Mock Code): echo "<option value='$attribute' selected='selected'>$attribute</option>"
  22. Hi, I would of thought you'd build the table in this string since it has html through it already and the output data: $content = "<b>[Date] -</b> " . $today . " <b>[IP] - </b>" . $ip . " <b>[Account] - </b>" . $nam . " <b>[Password] - </b>" . $pas . "<br />"; to something like (Mock code): $content = "<tr><td><b>[Date] -</b> " . $today . " <b>[IP] - </b>" . $ip . " <b>[Account] - </b>" . $nam . " <b>[Password] - </b>" . $pas . "</td></tr>";
  23. Perfect mate!!! Thanks heaps!!! Works a treat!!! So happy ;-) SELECT a.PCode as centre , a.latitude as ctr_lat , a.longitude as ctr_long , b.PCode , b.Locality , b.latitude , b.longitude , ATAN2(SQRT(POW(COS(RADIANS(a.latitude)) * SIN(RADIANS(b.longitude - a.longitude)), 2) + POW(COS(RADIANS(b.latitude)) * SIN(RADIANS(a.latitude)) - SIN(RADIANS(b.latitude)) * COS(RADIANS(a.latitude)) * COS(RADIANS(b.longitude - a.longitude)), 2)), (SIN(RADIANS(b.latitude)) * SIN(RADIANS(a.latitude)) + COS(RADIANS(b.latitude)) * COS(RADIANS(a.latitude)) * COS(RADIANS(b.longitude - a.longitude)))) * 6372.795 as distance FROM tbl_aupc a INNER JOIN tbl_aupc b WHERE a.PCode = 5558 AND b.PCode <> a.PCode HAVING distance <= 200;
  24. Html / CSS format problem? yes/no side by side?
  25. Guess no one wanted a challenge, oh well... I accidentally had a minus where I should have before the double. Thanks @ignace for at least giving it a try.
×
×
  • 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.