marcus Posted October 5, 2006 Share Posted October 5, 2006 ...to echo the viewers Town/City and State on a page? Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/ Share on other sites More sharing options...
HuggieBear Posted October 5, 2006 Share Posted October 5, 2006 Yes, if they've already provided you with the details.You can ask the user for those details and let them submit them, you can then save them somewhere, like inside a database, then recall them when the user returns.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104633 Share on other sites More sharing options...
marcus Posted October 5, 2006 Author Share Posted October 5, 2006 but i've seen places that havent gathered information and have posted my town and state Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104640 Share on other sites More sharing options...
HuggieBear Posted October 5, 2006 Share Posted October 5, 2006 ok, in that case they're psychic websites... Can you provide an example site, I'll check it out.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104646 Share on other sites More sharing options...
marcus Posted October 5, 2006 Author Share Posted October 5, 2006 hmm, i can't recall the site name Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104648 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 IP database (maxmind, ip2location) or other!me! Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104651 Share on other sites More sharing options...
HuggieBear Posted October 5, 2006 Share Posted October 5, 2006 OK, pretty much the only information they can get from you is what your browser provides. They maybe looking at your IP address and seeing where it's registered or something slightly more advanced, but it's unlikely.Huggie Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104652 Share on other sites More sharing options...
redarrow Posted October 5, 2006 Share Posted October 5, 2006 I do it with users ip's.But i can not remember the site i got the database dump. Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104655 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 I have a old dump from last year that I bought, if you want it, tell me I'll post a link to it. It comes with a image script so you can write the city on to a image file!me! Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104666 Share on other sites More sharing options...
marcus Posted October 5, 2006 Author Share Posted October 5, 2006 that would be great! Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104667 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 It will be another 20 minutes before I can get on my server that has the database, I'm doing a backup now so i don't want to login when it running. I will post the download after that...Here is a simple example, you can use any image, the script uses an array() that sets the writing method (size, center, angles (hoz, vert)!http://www.dinningoutoftown.com/test.phpexample of the script![code]<? /* protect the include files */ define ( 'SYSTEM_REQUESTED', 1 ); /* the back end */ include_once ( '/home/vhost_27/no_access/ip/geo.php' ); /* begin the image display process */ // the image we are going to write to (must be a PNG) $img = '/home/vhost_27/no_access/images/example.png'; // the write text array /* * see the example image * /geo/example.png * to understand each array value top => array ( 0 => font size, 1 => the text write angle, 2 => text start vertical position 3 => text start writing position (from left edge of image) 4 => the font path and name }, bottom => array ( 0 => font size, 1 => the text write angle, 2 => text start vertical position 3 => text start writing position (from left edge of image) 4 => the font path (full_path) and name ); * */ $ta = array ( 'top' => array ( 10, -10, 250, 0, '/home/vhost_27/no_access/fonts/arabolic.ttf' ), 'bottom' => array ( 10, -10, 270, 0, '/home/vhost_27/no_access/fonts/arabolic.ttf' ) ); // the top text $top = 'I love'; // if a country name needs * the * before it we use this /* ~ explained! (only used if no city is found and a country is found) * countries that are a single word -> Canada, do not use $add * countries that contain more than one word with a space -> United States, use $add */ $add = ' the'; // other result /* * when no city or country is found we use this */ $other = 'you'; // ending for the (bottom) line of text $end = '!'; /* check for city, if we don't have one, check for a country */ if ( empty ( $data['city'] ) ) { /* now check for a country, if no country we use $other */ if ( empty ( $data['country'] ) ) { $text = $other . $end; } else { /* check if we need to add ($add) or strip (-) */ if ( str_word_count ( $data['country'] ) > 1 ) { $top .= $add; $text = $data['country'] . $end; } if ( strpos ( $data['country'], '-' ) !== false ) { $text = str_replace ( '-', ' ', $data['country'] ) . $end; } else { $text = $data['country'] . $end; } } } else { $text = $data['city'] . $end; } /* load the image and set the text colors for writing */ $image = imagecreatefrompng ( $img ); //$backg = imagecolorallocate ( $image, 255, 255, 255 ); $color = imagecolorallocate ( $image, 131, 110, 92 ); /* get the exact position to write our (top) text */ $center = imagettfbbox ( $ta['top'][0], $ta['top'][1], $ta['top'][4], $top ); $horzp = ( ( imagesx ( $image ) - abs ( $center[4] ) ) / 2 ) - $ta['top'][3]; /* write the (top) text */ imagettftext ( $image, $ta['top'][0], $ta['top'][1], $horzp, $ta['top'][2], $color, $ta['top'][4], $top ); /* get the exact position to write our (bottom) text */ $center = imagettfbbox ( $ta['bottom'][0], $ta['bottom'][1], $ta['bottom'][4], $text ); $horzp = ( ( imagesx ( $image ) - abs ( $center[4] ) ) / 2 ) - $ta['bottom'][3]; /* write the (bottom) text */ imagettftext ( $image, $ta['bottom'][0], $ta['bottom'][1], $horzp, $ta['bottom'][2], $color, $ta['bottom'][4], $text ); /* write it out to the browser */ header ( 'Content-Type: image/jpeg;' ); imagejpeg ( $image ); imagedestroy ( $image );?>[/code]me! Quote Link to comment https://forums.phpfreaks.com/topic/23121-is-it-possible/#findComment-104689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.