PHP - How To Get Users Ip Address?
I would get the ip address of the user that is on the site. I used $ip = $_SERVER['REMOTE_ADDR']; and it doesn't show my actual ip. Is it because im using an apache server on my computer.
Similar TutorialsHi. my browser ist telling me there are errors on line 3 and 4 for my code. It says summin like Notice: HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR are unidentified: below is the code see if you can spot anything btw i copied down the code from beginner php tutorial 66 if you type that into youtube . Code: [Select] <?php $http_client_ip = $_SERVER['HTTP_CLIENT_IP']; $http_x_forwarded_for = $_SERVER['HTTP_X_FORWARDED_FOR']; $remote_addr = $_SERVER['REMOTE_ADDR']; if (!empty($http_client_ip)){ $ip_addr = $http_client_ip; }else if(!empty($http_x_forwarded_for)){ $ip_addr = $http_x_forwarded_for; }else{ $ip_addr = $remote_addr; } echo $ip_addr; ?> Thanks MOD EDIT: code tags added. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=359217.0 I have a mysql table which will store users email addresses (each is unique and is the primary field) and a timestamp. I have added another column called `'unique_code' (varchar(64), utf8_unicode_ci)`. What I would very much appreciate assistance with is; a) Generating a 5 digit alphanumeric code, ie: 5ABH6 b) Check all rows the 'unique_code' column to ensure it is unique, otherwise re-generate and check again c) Insert the uniquely generated 5 digit alphanumeric code into `'unique_code'` column, corresponding to the email address just entered. d) display the code on screen. What code must I put and where? **My current php is as follows:** Code: [Select] require "includes/connect.php"; $msg = ''; if($_POST['email']){ // Requested with AJAX: $ajax = ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'); try{ if(!filter_input(INPUT_POST,'email',FILTER_VALIDATE_EMAIL)){ throw new Exception('Invalid Email!'); } $mysqli->query("INSERT INTO coming_soon_emails SET email='".$mysqli->real_escape_string($_POST['email'])."'"); if($mysqli->affected_rows != 1){ throw new Exception('You are already on the notification list.'); } if($ajax){ die('{"status":1}'); } $msg = "Thank you!"; } catch (Exception $e){ if($ajax){ die(json_encode(array('error'=>$e->getMessage()))); } $msg = $e->getMessage(); } } i wanting users to be able to update there email address and check to see if the new email already exists. if the email is the same as current email ignore the check. i have no errors showing up but if I enter a email already in the db it still accepts the new email instead of bringing the back the error message. Code: [Select] // email enterd from form // $email=$_POST['email']; $queryuser=mysql_query("SELECT * FROM members WHERE inv='$ivn' ") or die (mysql_error()); while($info = mysql_fetch_array( $queryuser )) { $check=$info['email']; // gets current email // } if($check!=$email){ // if check not equal to $email check the new email address already exists// $queryuser=mysql_query("SELECT * FROM members WHERE email='$email' "); //$result=mysql_query($sql); $checkuser=mysql_num_rows($queryuser); if($checkuser != 0) { $error= "0"; header('LOCATION:../pages/myprofile.php?id='.$error.''); } } cheers I have a form with PHP validation and also a mysqli query checking for duplicates in the database for mailing address and email address in mysql.
It works fine but the customers are adding spaces in the mailing address for example 111 mailing address A V E, 1 1 1 ma iling address A V E etc. and my sql query doesn't see that as an address that's a duplicate.
Their alslo adding email address like my@emailaddress.com and m.y@emailaddress.com, m.y.2@emailaddress.com etc to bypass that comparision also.
Is there anyway to stop this from happening?
Hello
I am trying to work out how many regular users I have to my site and how long those users tend to be users..
So, I have a table that logs every time a user visits my site and logs in, it stores the date / time as a unix timestamp and it logs their user id.
I started by getting the id's of any user who logs in more than 5 times in a specified period, but now I want to extend that...
SELECT userID as user, count(userID) as logins FROM login_history where timestamp > UNIX_TIMESTAMP('2014-06-01 00:00:00') and timestamp < UNIX_TIMESTAMP('2014-07-01 00:00:00') group by user having logins > 5; I just discovered that I have a major security flaw with my website. Anyone who logs in to the website can easily access other users information as well as delete and edit other users information just by changing the ID variable in the address bar. I have user ID Session started on these pages but still people can do anything they like with other users information just by editing the address bar. For example if your logged in in the address bar of www.mywebsite.com/delete_mystuff.php?id=5 and change the "5" say to a "9" then you will have access to user#9 information. Every important page that I have has this code: Code: [Select] session_start(); if (!isset($_SESSION['user_id'])) { // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } // Add the page. $url .= '/index.php'; ob_end_clean(); // Delete the buffer. header("Location: $url"); exit(); // Quit the script. } else { //Else If Logged In Run The Script if((isset($_GET['id'])) && (is_numeric($_GET['id']))) { $id = (int) $_GET['id']; } elseif ((isset($_POST['id'])) && (is_numeric($_POST['id']))) { $id = (int) $_POST['id']; } else { echo ' No valid ID found, passed in url or form element'; exit(); } What am I doing wrong? Please help if you know how to correct this. Many thanks in advance. Okay, so I know how to get an IP address using $_SERVER['REMOTE_ADDR'], however, I need to get an IP a little different. How would I get the IP of the visitor on a remote site loading MY site using file_get_contents()? It just returns that remote websites server IP... :/ Thanks! I have problem with # char in address and jquery, or any address with #. When i put this code in my php: <a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a> .. my link on that button is still same like link that i am on it, it do not add "#" in address, but if i, instead of href="#", put href="#some_text", that link shows nice, link.php#some_text, but without text in # it doesn't work :S Why is that happening, and how can i fix that? Hello, Please let me know what is the wrong with the following lines of code. I am trying to find the MAC Address of the user who is logging. When I am running the code in localhost it is working. But the same code is not working when I upload it in the server. <?php function getMac(){ exec("ipconfig /all", $output); foreach($output as $line){ if (preg_match("/(.*)Physical Address(.*)/", $line)){ $mac = $line; $mac = str_replace("Physical Address. . . . . . . . . :","",$mac); } } return $mac; } $mac = getMac(); $mac = trim($mac); echo $mac; ?> Please help. Thanks a lot in advance. Regards & Thanks. Hey guys, is there any way to get the IP address of people accessing my website using PHP? I'm trying to get a statistics area to work for my website. If there isn't a way using PHP, what would be an application which can get the IP address? Thanks a lot, Noid im new , and ... i hate tutorials .. books .. anything that does not make u part of the deal - .. thats why i started by creating something and learning from my mistakes at the same time .. i like this way of learning .. soo , while im building and trying things out .. i started thinking how the server know the person with this link is really U ? .. when u start just linking pages to each other its just a matter of finding out what is the link to do what ever u want with the users personal pages ! .. i know my questions r stupid but i just hate to go and write lessons without any effort im confused with the concept of SESSIONS and COOKIES , r they the unswer to this security problem ? how u can work with them .. ? im not asking for codes .. just general ideas about users and how they control their profiles and stuff with full security ? ill be very thankful if i get any answer ^^ I was getting help with my script and I just noticed this was added. What does it mean? Code: [Select] /*** a rfc compliant web address ***/ $url = "http://www.phpro.org"; /*** try to validate the URL ***/ if(filter_var($url, FILTER_VALIDATE_URL) === FALSE) { /*** if there is no match ***/ echo "Sorry, $url is not valid!"; } else { /*** if we match the pattern ***/ echo "The URL, $url is valid!<br />"; } Hi, I have a second website under the same domain www.lucyeleanorbrown.com/weddings.html which I wanted to change to www.weddings.lucyeleanorbrown.com, I have been looking around for PHP for this but am unsure of what to search for, could anyone give me a suggestion? Thank you Hi, Guys Im tring to have a website which redirects users from each country to a diiferent directory For example if user visiting the page from UK should be directed mysite.com/UK I have following questions I don't know how to start: 1- Is there any FREE api I can use, if yes can you please tell me how? 2- How to redirect user? so if users loggsin from UK IP how should i redirect it in php? thanks in advance OK, I just want to extract the agency name, complete address, and phone number from this mess : {"facilities": [ { "fclt_name":"BEACH & O'NEILL IN", "fclt_addr":"7520 GREENBACK LN", "fclt_city":"CITRUS HEIGHTS", "fclt_state":"CA", "fclt_zip":"95610", "tel_no":"916.676.0844", "fax_no":"916.676.0860", "fclt_url":"null", "fclt_lattd":"38.6781788", "fclt_longtd":"-121.289615", "fclt_ctgy_cd":"2", "fclt_distance":"3.26341268894218446122718887944106659512" }, { "fclt_name":"AMERICAN AIM AUTO", "fclt_addr":"5341 SAN JUAN AVE", "fclt_city":"FAIR OAKS", "fclt_state":"CA", "fclt_zip":"95628", "tel_no":"916.962.0401", "fax_no":"916.962.0414", "fclt_url":"null", "fclt_lattd":"38.6625015", "fclt_longtd":"-121.2922782", "fclt_ctgy_cd":"2", "fclt_distance":"3.50675708898608342216618250068171298694" }, { "fclt_name":"INSZONE INSURANCE", "fclt_addr":"7200 FAIR OAKS BLVD STE 210", "fclt_city":"CARMICHAEL", "fclt_state":"CA", "fclt_zip":"95608", "tel_no":"916.503.8784", "fax_no":"916.486.4335", "fclt_url":"null", "fclt_lattd":"38.631717", "fclt_longtd":"-121.327626", "fclt_ctgy_cd":"2", "fclt_distance":"4.01207784800582596431030369642981690151" }, { "fclt_name":"PARK FAMILY INS &", "fclt_addr":"801 RIVERSIDE AVE STE 100", "fclt_city":"ROSEVILLE", "fclt_state":"CA", "fclt_zip":"95678", "tel_no":"888.723.7275", "fax_no":"866.772.2912", "fclt_url":"null", "fclt_lattd":"38.732289", "fclt_longtd":"-121.289295", "fclt_ctgy_cd":"2", "fclt_distance":"4.47210016333570016664044149856001806252" }, { "fclt_name":"RK JACOBS INSURANC", "fclt_addr":"4777 SUNRISE BLVD STE B", "fclt_city":"FAIR OAKS", "fclt_state":"CA", "fclt_zip":"95628", "tel_no":"916.966.3733", "fax_no":"916.966.0177", "fclt_url":"null", "fclt_lattd":"38.6525671", "fclt_longtd":"-121.2728244", "fclt_ctgy_cd":"2", "fclt_distance":"4.75887214653382230652493164121477832758" }, { "fclt_name":"BERTOLINO INSURANC", "fclt_addr":"2985 FULTON AVE", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95821", "tel_no":"916.384.9621", "fax_no":"877.553.0066", "fclt_url":"null", "fclt_lattd":"38.6190831", "fclt_longtd":"-121.4015452", "fclt_ctgy_cd":"2", "fclt_distance":"5.50381610176691043722708919483708216851" }, { "fclt_name":"THE PEXA GROUP", "fclt_addr":"1221 PLEASANT GROVE BLVD", "fclt_city":"ROSEVILLE", "fclt_state":"CA", "fclt_zip":"95678", "tel_no":"916.788.4200", "fax_no":"916.788.4204", "fclt_url":"null", "fclt_lattd":"38.772237", "fclt_longtd":"-121.308503", "fclt_ctgy_cd":"2", "fclt_distance":"6.25871993199859278950600593840623920844" }, { "fclt_name":"PARAMOUNT EQUITY I", "fclt_addr":"8781 SIERRA COLLEGE BLVD", "fclt_city":"ROSEVILLE", "fclt_state":"CA", "fclt_zip":"95661", "tel_no":"877.284.2424", "fax_no":"888.811.2910", "fclt_url":"null", "fclt_lattd":"38.7424319", "fclt_longtd":"-121.2511908", "fclt_ctgy_cd":"2", "fclt_distance":"6.50250135161509994547872070619122902873" }, { "fclt_name":"PETERSON & GRANTHA", "fclt_addr":"1508 EUREKA RD STE 175", "fclt_city":"ROSEVILLE", "fclt_state":"CA", "fclt_zip":"95661", "tel_no":"916.431.0400", "fax_no":"916.431.0221", "fclt_url":"null", "fclt_lattd":"38.749593", "fclt_longtd":"-121.250556", "fclt_ctgy_cd":"2", "fclt_distance":"6.83036958706746253088617532680453999753" }, { "fclt_name":"INDEPENDENT SOL UN", "fclt_addr":"2723 ZINFANDEL DR", "fclt_city":"RANCHO CORDOVA", "fclt_state":"CA", "fclt_zip":"95670", "tel_no":"916.635.6760", "fax_no":"916.635.9804", "fclt_url":"null", "fclt_lattd":"38.5967846", "fclt_longtd":"-121.2894781", "fclt_ctgy_cd":"2", "fclt_distance":"7.03267554456276560054938083160853750814" }, { "fclt_name":"MORE CHOICES INS A", "fclt_addr":"1474 STONE POINT DR # 131", "fclt_city":"ROSEVILLE", "fclt_state":"CA", "fclt_zip":"95661", "tel_no":"916.899.6600", "fax_no":"916.647.0522", "fclt_url":"null", "fclt_lattd":"38.755322", "fclt_longtd":"-121.249216", "fclt_ctgy_cd":"2", "fclt_distance":"7.14043819089449986827741629585808532375" }, { "fclt_name":"ALBANO DALE DUNN &", "fclt_addr":"9197 GREENBACK LN", "fclt_city":"ORANGEVALE", "fclt_state":"CA", "fclt_zip":"95662", "tel_no":"916.988.0214", "fax_no":"916.989.4719", "fclt_url":"null", "fclt_lattd":"38.678737", "fclt_longtd":"-121.212147", "fclt_ctgy_cd":"2", "fclt_distance":"7.40385556560869808878938590652772224486" }, { "fclt_name":"MCGEE & THIELEN IN", "fclt_addr":"3780 ROSIN CT STE 120", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95834", "tel_no":"916.646.1919", "fax_no":"916.646.0995", "fclt_url":"null", "fclt_lattd":"38.636195", "fclt_longtd":"-121.473132", "fclt_ctgy_cd":"2", "fclt_distance":"7.57412262483417036891911065525086823482" }, { "fclt_name":"AGENTS RESOURCES I", "fclt_addr":"11190 SUN CENTER DR", "fclt_city":"RANCHO CORDOVA", "fclt_state":"CA", "fclt_zip":"95670", "tel_no":"916.443.4221", "fax_no":"916.443.5559", "fclt_url":"null", "fclt_lattd":"38.597237", "fclt_longtd":"-121.267659", "fclt_ctgy_cd":"2", "fclt_distance":"7.61684981655654181229982085243856553867" }, { "fclt_name":"STEVE C LUTH INS", "fclt_addr":"9480 MADISON AVE STE 1", "fclt_city":"ORANGEVALE", "fclt_state":"CA", "fclt_zip":"95662", "tel_no":"888.597.8383", "fax_no":"916.989.9102", "fclt_url":"null", "fclt_lattd":"38.6735726", "fclt_longtd":"-121.2007054", "fclt_ctgy_cd":"2", "fclt_distance":"8.053760009460164598304836725423812559" }, { "fclt_name":"MCDOWALL & KEENEY", "fclt_addr":"865 HOWE AVE STE 200", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95825", "tel_no":"916.567.3233", "fax_no":"916.567.3155", "fclt_url":"null", "fclt_lattd":"38.581372", "fclt_longtd":"-121.41588", "fclt_ctgy_cd":"2", "fclt_distance":"8.16424077949136484737583499892043887019" }, { "fclt_name":"SIERRA OAK INS SER", "fclt_addr":"9700 BUSINESS PARK DR STE 105", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95827", "tel_no":"916.364.7380", "fax_no":"916.364.7381", "fclt_url":"null", "fclt_lattd":"38.568104", "fclt_longtd":"-121.334623", "fclt_ctgy_cd":"2", "fclt_distance":"8.27507991633456734395325050580063137134" }, { "fclt_name":"RICHARD CHRISTOPHE", "fclt_addr":"5842 LONETREE BLVD", "fclt_city":"ROCKLIN", "fclt_state":"CA", "fclt_zip":"95765", "tel_no":"916.626.3305", "fax_no":"916.471.0311", "fclt_url":"null", "fclt_lattd":"38.8065456", "fclt_longtd":"-121.293125", "fclt_ctgy_cd":"2", "fclt_distance":"8.76951297025304552186130788422901665504" }, { "fclt_name":"ADEPT INSURANCE SE", "fclt_addr":"101 PARKSHORE DR STE 30061", "fclt_city":"FOLSOM", "fclt_state":"CA", "fclt_zip":"95630", "tel_no":"916.944.2192", "fax_no":"866.529.5303", "fclt_url":"null", "fclt_lattd":"38.6570589", "fclt_longtd":"-121.186783", "fclt_ctgy_cd":"2", "fclt_distance":"8.9960609261835699863946424309422450653" }, { "fclt_name":"PARAGON INSURANCE", "fclt_addr":"301 NATOMA ST STE 104", "fclt_city":"FOLSOM", "fclt_state":"CA", "fclt_zip":"95630", "tel_no":"916.353.1023", "fax_no":"916.353.1370", "fclt_url":"null", "fclt_lattd":"38.678047", "fclt_longtd":"-121.168827", "fclt_ctgy_cd":"2", "fclt_distance":"9.73781780936977222523189878525699239046" }, { "fclt_name":"CLINTON POLLEY GRO", "fclt_addr":"1675 CREEKSIDE DR STE 100", "fclt_city":"FOLSOM", "fclt_state":"CA", "fclt_zip":"95630", "tel_no":"916.984.3000", "fax_no":"916.984.3100", "fclt_url":"null", "fclt_lattd":"38.6716438", "fclt_longtd":"-121.1446657", "fclt_ctgy_cd":"2", "fclt_distance":"11.07358533782419719432038848742812184727" }, { "fclt_name":"ALPHA BOND INSURAN", "fclt_addr":"3918 60TH ST", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95820", "tel_no":"866.313.3077", "fax_no":"916.429.7974", "fclt_url":"null", "fclt_lattd":"38.5393731", "fclt_longtd":"-121.4344591", "fclt_ctgy_cd":"2", "fclt_distance":"11.21762941497442801416098309046154379963" }, { "fclt_name":"HEBARD INSURANCE A", "fclt_addr":"3837 TAYLOR RD", "fclt_city":"LOOMIS", "fclt_state":"CA", "fclt_zip":"95650", "tel_no":"916.652.0404", "fax_no":"916.652.9123", "fclt_url":"null", "fclt_lattd":"38.81657", "fclt_longtd":"-121.197889", "fclt_ctgy_cd":"2", "fclt_distance":"12.08374482196660408349940289432841322946" }, { "fclt_name":"PILCHER INSURANCE", "fclt_addr":"3805 TAYLOR RD STE 1", "fclt_city":"LOOMIS", "fclt_state":"CA", "fclt_zip":"95650", "tel_no":"916.660.1670", "fax_no":"916.660.1672", "fclt_url":"null", "fclt_lattd":"38.817032", "fclt_longtd":"-121.197206", "fclt_ctgy_cd":"2", "fclt_distance":"12.13211505726556203701939114285606195057" }, { "fclt_name":"RUSSELL VANG INS &", "fclt_addr":"2751 FRUITRIDGE RD STE 15", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95824", "tel_no":"916.428.2267", "fax_no":"916.428.2341", "fclt_url":"null", "fclt_lattd":"38.517011", "fclt_longtd":"-121.4513314", "fclt_ctgy_cd":"2", "fclt_distance":"13.00258097375703227426814846084345607012" }, { "fclt_name":"PC INSURANCE AGENC", "fclt_addr":"6333 STOCKTON BLVD STE A", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95824", "tel_no":"916.391.5990", "fax_no":"916.391.5993", "fclt_url":"null", "fclt_lattd":"38.5111875", "fclt_longtd":"-121.4360945", "fclt_ctgy_cd":"2", "fclt_distance":"13.04926930736758364287316544823571444809" }, { "fclt_name":"GOLDENBEST INSURAN", "fclt_addr":"6830 STOCKTON BLVD # 100", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95823", "tel_no":"916.231.9955", "fax_no":"916.231.9954", "fclt_url":"null", "fclt_lattd":"38.502632", "fclt_longtd":"-121.43303", "fclt_ctgy_cd":"2", "fclt_distance":"13.54608070539524090996150854589636455506" }, { "fclt_name":"EDWARD C BRODIE IN", "fclt_addr":"2379 GATEWAY OAKS DR STE 150", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95822", "tel_no":"916.927.6343", "fax_no":"916.927.8848", "fclt_url":"null", "fclt_lattd":"38.5128714", "fclt_longtd":"-121.4970294", "fclt_ctgy_cd":"2", "fclt_distance":"14.46565232261373440674810015002201060961" }, { "fclt_name":"LINH DO INSURANCE", "fclt_addr":"6511 SAVINGS PL STE 115", "fclt_city":"SACRAMENTO", "fclt_state":"CA", "fclt_zip":"95828", "tel_no":"916.393.8383", "fax_no":"916.393.8382", "fclt_url":"null", "fclt_lattd":"38.4739858", "fclt_longtd":"-121.3884671", "fclt_ctgy_cd":"2", "fclt_distance":"14.89569563450147516294105371450235166475" }, { "fclt_name":"STRATTON AGENCY", "fclt_addr":"957 INDUSTRIAL RD STE C", "fclt_city":"SAN CARLOS", "fclt_state":"CA", "fclt_zip":"95762", "tel_no":"650.508.0124", "fax_no":"650.508.0121", "fclt_url":"null", "fclt_lattd":"38.6637192", "fclt_longtd":"-121.067907", "fclt_ctgy_cd":"2", "fclt_distance":"15.24924065635783489201051962237991277729" }, { "fclt_name":"PACIFIC INTERSTATE", "fclt_addr":"5072 HILLSDALE CIR STE 110", "fclt_city":"EL DORADO HILLS", "fclt_state":"CA", "fclt_zip":"95762", "tel_no":"916.941.0518", "fax_no":"916.941.0547", "fclt_url":"null", "fclt_lattd":"38.621938", "fclt_longtd":"-121.062804", "fclt_ctgy_cd":"2", "fclt_distance":"16.0891004210135393693458563137933030129" }, { "fclt_name":"AMAZING INSURANCE", "fclt_addr":"8398 LAPORTE WAY", "fclt_city":"ELK GROVE", "fclt_state":"CA", "fclt_zip":"95624", "tel_no":"916.719.6449", "fax_no":"916.258.6679", "fclt_url":"null", "fclt_lattd":"38.445406", "fclt_longtd":"-121.394576", "fclt_ctgy_cd":"2", "fclt_distance":"16.89751994304863412037777682922840849653" }, { "fclt_name":"WAHLA INSURANCE &", "fclt_addr":"4809 LAGUNA BLVD STE 100", "fclt_city":"ELK GROVE", "fclt_state":"CA", "fclt_zip":"95758", "tel_no":"916.429.4741", "fax_no":"916.429.4743", "fclt_url":"null", "fclt_lattd":"38.424506", "fclt_longtd":"-121.449703", "fclt_ctgy_cd":"2", "fclt_distance":"18.95918985420010413223068782438653209117" }, { "fclt_name":"MOTHER LODE INS SE", "fclt_addr":"2514 CAMEO DR STE A", "fclt_city":"CAMERON PARK", "fclt_state":"CA", "fclt_zip":"95682", "tel_no":"530.677.8755", "fax_no":"530.677.8314", "fclt_url":"null", "fclt_lattd":"38.6578609", "fclt_longtd":"-120.999481", "fclt_ctgy_cd":"2", "fclt_distance":"18.96331840626573060295348092634463597585" }, { "fclt_name":"WOODEL INSURANCE", "fclt_addr":"8788 ELK GROVE BLVD STE P", "fclt_city":"ELK GROVE", "fclt_state":"CA", "fclt_zip":"95624", "tel_no":"916.714.5122", "fax_no":"916.714.5123", "fclt_url":"null", "fclt_lattd":"38.408374", "fclt_longtd":"-121.377051", "fclt_ctgy_cd":"2", "fclt_distance":"19.33537262024884176605153693999802777133" }, { "fclt_name":"AMAN INSURANCE AGE", "fclt_addr":"8788 ELK GROVE BLVD BLDG 3", "fclt_city":"ELK GROVE", "fclt_state":"CA", "fclt_zip":"95624", "tel_no":"916.213.1900", "fax_no":"800.714.6082", "fclt_url":"null", "fclt_lattd":"38.408374", "fclt_longtd":"-121.377051", "fclt_ctgy_cd":"2", "fclt_distance":"19.33537262024884176605153693999802777133" }, { "fclt_name":"MULHOLLAND INSURAN", "fclt_addr":"2358 MARITIME DR STE 100", "fclt_city":"ELK GROVE", "fclt_state":"CA", "fclt_zip":"95758", "tel_no":"916.691.5555", "fax_no":"916.691.0555", "fclt_url":"null", "fclt_lattd":"38.413727", "fclt_longtd":"-121.483123", "fclt_ctgy_cd":"2", "fclt_distance":"20.24810658073937047943171540052851815376" }, { "fclt_name":"SILLECT INSURANCE", "fclt_addr":"100 KENTUCKY AVE", "fclt_city":"WOODLAND", "fclt_state":"CA", "fclt_zip":"95695", "tel_no":"530.662.9050", "fax_no":"888.613.5849", "fclt_url":"null", "fclt_lattd":"38.691387", "fclt_longtd":"-121.781223", "fclt_ctgy_cd":"2", "fclt_distance":"23.3148181263597264149496516029276053035" }, { "fclt_name":"VAUGHT WRIGHT & BO", "fclt_addr":"533 MAIN ST", "fclt_city":"PLACERVILLE", "fclt_state":"CA", "fclt_zip":"95667", "tel_no":"530.622.1835", "fax_no":"530.622.3860", "fclt_url":"null", "fclt_lattd":"38.7298", "fclt_longtd":"-120.798354", "fclt_ctgy_cd":"2", "fclt_distance":"29.83338181060752344743347837235784856168" }, { "fclt_name":"DARR INSURANCE AGE", "fclt_addr":"550 MAIN ST", "fclt_city":"PLACERVILLE", "fclt_state":"CA", "fclt_zip":"95667", "tel_no":"530.217.6002", "fax_no":"530.626.4590", "fclt_url":"null", "fclt_lattd":"38.728995", "fclt_longtd":"-120.797821", "fclt_ctgy_cd":"2", "fclt_distance":"29.85673424682092359769083672633797070566" } ] } Hello i just spent my hour finding way to get XML attribute using PHP via URL i wanted to know is it possible or not like http://myurl.com/index.php?$xml=link1 link1 in my XML is some text can we get attribute like this via using URL on address bar Code: [Select] <?xml version="1.0" encoding="ISO-8859-1"?> <note> <link1>www.2advanced.com</link1> <link2>www.hotmail.com</link2> <link3>www.gmail.com</link3> <link4>www.twitter.com</link4> </note> Just want to ask..if i use $_SERVER['REMOTE_ADDR'] to get user IP address, will it also come up with result when they use blackberry or mobile phone?? thanks I have about 7 fields in one of my tables. Some of the fields are null or blank since they arent required (like address2) Is their a better way of formatting an address rather than doing something like: <?php while ($row = mysql_fetch_array($query)) { if ($row['address2'] != "") { echo $row['address2'] . "<br/"; } if ($row['otherField'] != "") { echo $row['otherField'] . "<br/"; } if ($row['anotherField'] != "") { echo $row['anotherField'] . "<br/"; } } ?> I have more fields than just address2, I just don't want a bunch of if statements Hi, firstly sorry if its a stupid question or if it is in the wrong section of the forum
I just wanted to know how this is achieved
If you go onto the website reed.co.uk and do a search lets say
Fabricator in Derby
How do you get the address bar to say
webaddress/jobs/fabricator-in-derby
Thanks for any help or advice you can give
|