Lee-Bartlett
Members-
Posts
225 -
Joined
-
Last visited
Never
Everything posted by Lee-Bartlett
-
i get these error messages Warning: Cannot modify header information - headers already sent by (output started at /home/nexodom/public_html/website/popup.php:5) in /home/nexodom/public_html/website/popup.php on line 12 Warning: Cannot modify header information - headers already sent by (output started at /home/nexodom/public_html/website/popup.php:5) in /home/nexodom/public_html/website/popup.php on line 13
-
Still only opens row 1, it broke it when my WHERE id='id' had the ''' arround it, took it away it only opened one row, the array broke + the header, but i think that cause i didnt exit the header.
-
Ok im fairly new to this, the top code is the pop up, wifi.php is the database where a button is which creats the pop up. If im reading correct, im probally not, in popup.php i need to use $_GET to get my ID from wifi.php?
-
Help with PHP/MySQL code, needs to be done soon
Lee-Bartlett replied to skiingguru1611's topic in PHP Coding Help
Im not a good php person just learning and wouldnt know how to code this but couldnt you do somthing like, if $varible is inputed echo $varible else echo, no data inputted. Could be wrong but thats what i think, if i read your problem right -
I am trying to select the row in my db which is echoed on a page. This code makes the button work on the page, a little pop up of a map with specific cords. Only problem is it only goes to the first entry and not the row it is in. Heres the code for both pages. -- The php popup page. -- <?php $link = mysql_connect('localhost','root', 'password'); if($link && mysql_select_db('nexodom_test')) { $sql = "SELECT * FROM tblbasicform WHERE id='id'"; $res = mysql_query($sql); $row = mysql_fetch_array($res); $addr = 'http://maps.google.com/staticmap?center='.$row[latitude].','.$row[longitude].'&zoom=12&size=400x400&key=ABQIAAAAgnVrcDn5i-V_BsqvXy3j8RRle8Rt1EK93-n5qGMjk9aCuGqlpBQ2sCqItCc79KzQksp90dVmLGk45w'; header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); header("Location: $addr"); //echo "We will call this URL: <b>$addr</b>"; //exit(); } echo 'Cannot connect to database'; ?> -- Page where the db and the button which makes the pop up work. -- <?php require_once("includes/db_connection.php"); ?> <html> <head> <script language='javascript' type='text/javascript'> <!-- function openWindow() { popupWin = window.open('popup.php', 'popup', 'width=550,height=400,resizable=no,scrollbars=yes,toolbar=no,screenX=0,screenY=0,Top=0,Left=0') } // --> </script> </head> <body onLoad="load()" onUnload="GUnload()" > <table width="802" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td colspan="2" bgcolor="#0099FF"><p> </p> <p align="center" class="style1">Nexodom.com</p> <p> </p></td> </tr> <tr> <td width="102" height="318" align="left" valign="top"><p><a href="index.html">Home</a><br> <a href="wifi.php">WIFI Hot Spots</a></p> </td> <td width="674" align="left" valign="top"><p align="center">WIFI Hot Spot List</p> <?php $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); echo "<table border=2>"; echo "<tr> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Location</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>New</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; echo "<form>"; echo "<td><input type=\"button\" onClick=\"openWindow(); return false;\" value=\"Pop Up Map\">"; echo "</td></tr>"; echo "</form>"; } ?> </table><br> <a href="userform.php">Submit a WIFI hotspot</a> <br /> <br /> </body> </html>
-
[SOLVED] Using varibles creating unesscary space.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
nah it was fine, it was my db, it was text instead of varchar -
My varibles are creating a space in the url and ofc that breaks the url, how do i solve this? My db also has no spaces in the collums name to This is my code. <?php $link = mysql_connect('localhost','root', 'prodr192664'); if($link && mysql_select_db('nexodom_test')) { $sql = "select * from tblbasicform limit 1"; $res = mysql_query($sql); $row = mysql_fetch_array($res); $addr = 'http://maps.google.com/staticmap?center='.$row[longitude].','.$row[latitude].'&zoom=12&size=400x400&key=ABQIAAAAgnVrcDn5i-V_BsqvXy3j8RRle8Rt1EK93-n5qGMjk9aCuGqlpBQ2sCqItCc79KzQksp90dVmLGk45w'; header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); header("Location: $addr"); //echo "We will call this URL: <b>$addr</b>"; //exit(); } echo 'Cannot connect to database'; ?>
-
This is my code so far, i was woundering how i could add a varible to this small piece of code, say i named a varible images, so it went to google.com/images. <?php echo "<form>"; echo "<td><INPUT type=\"button\" value=\"New Window!\" onClick=\"window.open('http://www.google.com','mywindow','width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')\">"; echo "</td></tr>"; echo "</form>"; ?>
-
Using varibles to change the url...[about google map]
Lee-Bartlett posted a topic in PHP Coding Help
Ok im not sure if this is right, im trying to when my button is pressed it will take that row in the db the long and lat collums and put them into the url so it goes to that bit on the map. Here is all my codes from my page. <?php require_once("includes/db_connection.php"); ?> <html> <head> </head> <body onLoad="load()" onUnload="GUnload()" > <table width="802" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td colspan="2" bgcolor="#0099FF"><p> </p> <p align="center" class="style1">Nexodom.com</p> <p> </p></td> </tr> <tr> <td width="102" height="318" align="left" valign="top"><p><a href="index.html">Home</a><br> <a href="wifi.php">WIFI Hot Spots</a></p> </td> <td width="674" align="left" valign="top"><p align="center">WIFI Hot Spot List</p> <?php $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); echo "<table border=2>"; echo "<tr> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Location</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>New</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; ; } ?> <?php $sql = "select * from tblbasicform where id='id'"; $result = mysql_query($sql); $row = mysql_fetch_array($res); echo "<form>"; echo "<td><INPUT type=\"button\" value=\"New Window!\" onClick=\"window.open'(www.nexodom.com/website/map.php?='.$row['longitude']'.'['latitude']','mywindow','width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')\">"; echo "</td></tr>"; echo "</form>" ?> </table><br> <a href="userform.php">Submit a WIFI hotspot</a> <br /> <br /> </body> </html> -
[SOLVED] Missing somthing...
Lee-Bartlett replied to Lee-Bartlett's topic in Editor Help (PhpStorm, VS Code, etc)
im not sure this is a editor problem actually, might need to break my "" up not sure tho -
Im pretty sure its simple but my editor pushes it onto 2 lines on on the input form line, what do i need to do? <?php $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); echo "<table border=2>"; echo "<tr> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Location</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>New</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; echo "<form>"; echo "<td><INPUT type="button" value="New Window!" onClick="window.open('http://www.google.com','mywindow', 'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')"></td></tr>"; echo "</form>"; } ?> my editor makes it look like that error message Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/nexodom/public_html/website/wifi.php on line 142
-
I want a button when clicked to open a new page, i was looking at somthing like <script language=JavaScript> <!-- window.open("/templates/weekend.html", "w3adIAYJAAII", "width=650,height=400"); //--> </script> but wasnt sure how to get the to be on click on a button in a form.
-
everytime i look at google gives like 4 differnt ways to do it and im not sure the best way to do it. anyone?
-
Ok i have google map on my site, not sure if i can link to it, if i get told i can i will if not i wont. Ok i have a long + lat collum, but instead user putting it in search bar below, id like it to automaticaly search the map below with them 2 db entries. Code so far, <?php require_once("includes/db_connection.php"); ?> <?php $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); echo "<table border=2>"; echo "<tr> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Location</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</tr>"; } echo "</table><br>"; ?><a href="userform.php">Submit a WIFI hotspot</a> <br /> <br /> Wanna find your destination, simple enter the latitude and longitude from the entries below. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Find out your location with geographic coordinates (lat/long) with Google Maps API</title> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAgnVrcDn5i-V_BsqvXy3j8RRle8Rt1EK93-n5qGMjk9aCuGqlpBQ2sCqItCc79KzQksp90dVmLGk45w" type="text/javascript"></script> <script type="text/javascript"> function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var center = new GLatLng(51.50015, -0.12624 ); map.setCenter(center, 15); geocoder = new GClientGeocoder(); var marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); document.getElementById("lat").innerHTML = center.lat().toFixed(5); document.getElementById("lng").innerHTML = center.lng().toFixed(5); GEvent.addListener(marker, "dragend", function() { var point = marker.getPoint(); map.panTo(point); document.getElementById("lat").innerHTML = point.lat().toFixed(5); document.getElementById("lng").innerHTML = point.lng().toFixed(5); }); GEvent.addListener(map, "moveend", function() { map.clearOverlays(); var center = map.getCenter(); var marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); document.getElementById("lat").innerHTML = center.lat().toFixed(5); document.getElementById("lng").innerHTML = center.lng().toFixed(5); GEvent.addListener(marker, "dragend", function() { var point =marker.getPoint(); map.panTo(point); document.getElementById("lat").innerHTML = point.lat().toFixed(5); document.getElementById("lng").innerHTML = point.lng().toFixed(5); }); }); } } function showAddress(address) { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { document.getElementById("lat").innerHTML = point.lat().toFixed(5); document.getElementById("lng").innerHTML = point.lng().toFixed(5); map.clearOverlays() map.setCenter(point, 14); var marker = new GMarker(point, {draggable: true}); map.addOverlay(marker); GEvent.addListener(marker, "dragend", function() { var pt = marker.getPoint(); map.panTo(pt); document.getElementById("lat").innerHTML = pt.lat().toFixed(5); document.getElementById("lng").innerHTML = pt.lng().toFixed(5); }); GEvent.addListener(map, "moveend", function() { map.clearOverlays(); var center = map.getCenter(); var marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); document.getElementById("lat").innerHTML = center.lat().toFixed(5); document.getElementById("lng").innerHTML = center.lng().toFixed(5); GEvent.addListener(marker, "dragend", function() { var pt = marker.getPoint(); map.panTo(pt); document.getElementById("lat").innerHTML = pt.lat().toFixed(5); document.getElementById("lng").innerHTML = pt.lng().toFixed(5); }); }); } } ); } } </script> </head> <body onload="load()" onunload="GUnload()" > <form action="#" onsubmit="showAddress(this.address.value); return false"> <p> <input type="text" size="50" name="address" value="Henderson Nevada USA" /> <input type="submit" value="Search!" /> </p> </form> <p align="left"> <table bgcolor="" width="333"> <tr> <td width="60" align="center"><font color="#0000FF"><b>Latitude:</b></font></td> <td id="lat" width="90" align="center"> <p align="left"></td> <td width="72" align="center"><font color="#0000FF"><b>Longitude:</b></font></td> <td id="lng" width="90" align="center"> <p align="left"></td> </tr> </table> </p> <p> <div align="center" id="map" style="width: 1000px; height: 700px"><br/></div> </p> </div> </body> </html>
-
Ah ty, didnt know this existed
-
I got the map but it doesnt give you a text box for example, which allows you to put a longitude and latitude, if i does i must missed it but i searched google for a while to try find it. There map they give you, you have to zoom in drag it to country to country etc...
-
anyone know? tutorial, guide somthing like that if possible
-
Please Advice and Help for a simple Membership site...
Lee-Bartlett replied to unixsus's topic in PHP Coding Help
Wouldnt it be simpler to do somthing like, if they pay you, they get a messaging saying your will recive an email in 48 hours. Ofc your have a database storing the details etc. -
Please Advice and Help for a simple Membership site...
Lee-Bartlett replied to unixsus's topic in PHP Coding Help
Or pay someone to make it -
Is db connection case sensitive? if so might be that.
-
Got no idea if this question belongs here or not. How would i got about getting a search function + a longitude and latitude search function to search my embeded google map on my site.?
-
Thank you , im still learning so im not quite sure whats the quickest ways to go about stuff:P thanks for your help
-
I didnt see that, must be late, ok thats got all of the form showing, how would i go about making the update button actually take the record in the row and go to my update page. I really appreciate all the effort here, i know i must be a pain
-
If i do it in html, how do i get it to automatically enter all these submit buttons so when a new entry is put in, there is one in that row to. now im getting this error message, Parse error: syntax error, unexpected '[' in /home/nexodom/public_html/website/admin/du.php on line 58 i cant see these ending. How would you add an update button to a echoed database? so when i click that button, it pulls the data from the row it is and alows me to update it on my update page
-
Now i got Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/nexodom/public_html/website/admin/du.php on line 58 maybe i should chaqnge that line all together? its this line here echo "<input type=\"hidden\" name=\"id\" value=\" . $row['id'] . \">";