Jump to content

F00Baron

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.dialogs.com/index.html

Profile Information

  • Gender
    Not Telling
  • Location
    Texas

F00Baron's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This one works for me: http://www.justin-cook.com/wp/2006/03/14/php-socket_mail-an-alternative-to-mail/
  2. Here's a page with the distance calculation http://jan.ucc.nau.edu/~cvm/latlon_formula.html which I converted to SQL for a similar project: $sql="SELECT properties.*,ACOS(COS(RADIANS(latitude)) * COS(RADIANS(longitude)) * COS(RADIANS(32.85)) * COS(RADIANS($longitude)) + COS(RADIANS(latitude)) * SIN(RADIANS(longitude)) * COS(RADIANS($latitude)) * SIN(RADIANS($longitude)) + SIN(RADIANS(latitude)) * SIN(RADIANS($latitude))) * 3963.1 AS Distance FROM properties WHERE Distance <= '$distance'"; You could add latitude and longitude to your properties table, update it from the zips table, and use something like that.
  3. That looks like it should work. You could try mysql_fetch_assoc() instead of mysql_fetch_array(). The documentation says mysql_fetch_array() should do both integer subscripts and column names by default but who knows.
  4. If cookies are disabled and trans sid is on, PHP will add the session ID automatically to the end of links(long ugly URLs) and in forms. Turn it on in php.ini or .htaccess or like this: ini_set("session.use_trans_sid", "true"); It does most of the work but you still have to do things like this: header('Location: somepage.html'); you have to change to: header('Location: somepage.html' . ((defined(SID))?'?' . SID:''));
  5. I've never had occasion to use DOMDocument before but here goes: This pulls out the link sans query vars on the end like '&color1=0xe1600f' and echo's this: <?php $s = '<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/ZuwP5C-1jJU&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZuwP5C-1jJU&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>?>'; $doc = new DOMDocument(); $doc->loadHTML($s); foreach($doc->getElementsByTagName('param') as $obj) { $name = $obj->getAttribute('name'); if($name == 'movie') { $url = $obj->getAttribute('value'); } } $endpos = strpos($url,'?'); if($endpos === false) { $endpos = strpos($url,'&'); } echo substr($url,0,$endpos); ?>
  6. var_dump the $_SERVER superglobal and also $url_parts to make sure they're what you expect. var_dump($_SERVER); $url_parts = parse_url($_SERVER['REQUEST_URI']); var_dump($url_parts); if($url_parts['path'] != 'somepage.php') { // header('Location: somepage.php'); // exit(); }
  7. $url_parts = parse_url($_SERVER['REQUEST_URI']); if($url_parts['path'] != '/somepage.php') { header('Location: /somepage.php'); exit(); } Or you could do a RewriteRule in the .htaccess file and have apache do it
  8. 2010-02-25 13:32:31 is 1:32pm I suspect that the server is on the west coast.
  9. How about this: $encodeArray = array( 'claimID' => $_GET['barcode'], 'deviceNumber' => $_GET['deviceNumber'] ); $text = ''; foreach($encodedText as $k => $v) { $text .= escapeshellarg($k . "=" . $v) . '\\n'; }
  10. developerdave is right. jquery is the way to go. This should get you started: Javascript: <script type="text/javascript" src="/js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#First_SelectID").change(function() { $.ajax({ type: "POST", url: "draw_second_select.php", data: "first_value=" + $('#First_SelectID: option:selected').val(), success: function(msg){ $('#Second_SelectID').html(msg); } }); }); }); </script> HTML: <select name="First_Select" id="First_SelectID"> <option value="Test1">Test 1</option> <option value="Test2">Test 2</option> <option value="Test3">Test 3</option> </select> <div id="Second_SelectID"></div> draw_second_select.php: <?php // TODO: connect to db // TODO: select db // TODO finish select below $sql="SELECT * FROM ..."; $result = mysql_query($sql); $html = '<select name="Second_Select">' . "\n"; while($row = mysql_fetch_assoc($result)) { $html .= '<option value="' . $row['TODO']. '">' . $row['TODO']. '</option>' . "\n"; } $html .= '</select' . "\n"; echo $html; exit(); ?>
  11. If you want to change a part of the page without reloading the whole thing use AJAX. I use jquery for that: http://api.jquery.com/category/ajax it can be as simple as: $('#guestbookcontent').load('myPagingScript.php?page=2'); attach that to the 'Next' link.
  12. Make sure you have write permissions to the directory. Try touching a file and see if it shows up. touch('/var/www/downloads/somethingunique.txt');
×
×
  • 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.