Jump to content

timmah1

Members
  • Posts

    1,170
  • Joined

  • Last visited

Everything posted by timmah1

  1. I have looked everywhere to be able to grab a visitors information based on their IP Address. I know these show me basic information <?php $ip = $_SERVER['REMOTE_ADDR']; $hostaddress = gethostbyaddr($ip); $browser = $_SERVER['HTTP_USER_AGENT']; $referred = $_SERVER['HTTP_REFERER']; ?> But I would like to be able to show the users country, and even better yet, their city, state and zip code. Unfortunately, the only thing that I am able to find, cost hundreds of dollars. Does anybody know of anywhere, or how I could, display the users country, state, city and zip code from their IP address? Any help would be greatly appreciated. Thanks in advance
  2. If I have 20 entries in a database, and I want to show the first entry and the last entry, minus 1 entry, how would I do that? An example would be showing the current login time, and the last login time. I have a database that inputs the users info into a database upon login. I want to show them their current session, and the last time they logged in. So in essence, out of those 20 entries in the database, #20 would be the current session, and #19 would be the last, so how would I go about showing only #19 and #20? Does that make sense? Here is what I have at the moment, I'm just not sure how to get the last one. $sql1 = "SELECT * FROM quicklogin_myquicker_stats WHERE user = '$id' ORDER BY login DESC LIMIT 1"; Thanks in advance
  3. I'm trying to break down sales on a monthly basis. I want to show information for each month. So, right now I'm trying to grab everything from the database where the field 'purchase'(month) equals May (05) The purchase field type is DATE Here is what I have, and it is not working correctly $month = "05"; $sql3 = "SELECT * FROM affiliates1 WHERE purchase = '".date("m", strtotime($month))."' AND affil_id = '$code'"; How can I accomplish this? Thanks in advance
  4. I fixed it, naturally, it was my stupid mistake $price[1] was formatted this way $price1 = "$".number_format ($price, 2); So obviously, it can't add with the dollar sign Thanks
  5. Guess if Daniel would of happened to explain it that way, I would've understood what they meant, my apologies for not posting enough code. <?php while (list ($name,$val) = @each ($_POST['package_'])) { $val=substr($val,0); $price = explode(",", $val); $tmp1 = $price[1]; $total_price += $tmp1; } echo $total_price; ?> The price of $_POST['package_'] is the second value
  6. This code worked fine, but now it don't Can anybody tell me what's wrong? <?php $val=substr($val,0); $price = explode(",", $val); $tmp = number_format($price[1], 2); $total_price += $tmp; echo $total_price; ?> It use to work regardless if there was one or two values for price[1] Thanks in advance
  7. Thanks ober, but I fixed it. I was trying to get the $page_rows with nothing to show I just added an if statement $data = mysql_query("SELECT * FROM wishlist") or die(mysql_error()); $rows = mysql_num_rows($data); if($numrows == 0){ echo "<font color='#c60001'>No Items As Of Yet</font>"; } and it fixed the problem Thank you
  8. Can anybody tell me why I'm getting this error? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10,10' at line 1 This worked just fine, but now I"m getting an error. Could it be because nothing is in the database? <?php include('config.php'); if (!(isset($_GET['pagenum']))) { $pagenum = 1; } $data = mysql_query("SELECT * FROM wishlist") or die(mysql_error()); $rows = mysql_num_rows($data); $page_rows = 10; $last = ceil($rows/$page_rows); if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; $data_p = mysql_query("SELECT * FROM wishlist $max") or die(mysql_error()); while($p = mysql_fetch_array( $data_p )) { $content = stripslashes($p['content']); $item = $p['item']; $site = $p['site']; $price = $p['price']; $photo = $p['photo']; $name = $p['name']; ?> <p class="text-content"> <table border="0" cellspacing="0" cellpadding="6" class="text"> <tr> <td align="left" valign="top"><span class="user_info"><strong><?=$name;?></strong> on <i>#<?=$item?></i></span></td> </tr> <tr> <td align="left" valign="top"><span class="posts"><img src="wish/<?=$photo;?>" width="100" class="photoID" align="left" /><?=nl2br($comment);?></span></td> </tr> </table> <?php } if ($pagenum == 1) { } else { echo " <a href='test1.php?pagenum=1'> <<-</a> "; echo " "; $previous = $pagenum-1; echo " <a href='test1.php?pagenum=$previous'> <-</a> "; } echo "Page $pagenum of $last "; if ($pagenum == $last) { } else { $next = $pagenum+1; echo " <a href='test1.php?pagenum=$next'>-></a> "; echo " "; echo " <a href='test1.php?pagenum=$last'>->></a> "; } ?> Thanks in advance
  9. <?php $id = (is_numeric($_POST['id'][$i]))? $_POST['id'][$i] : 0; $date = mysql_real_escape_string($_POST['date']); $track = mysql_real_escape_string($_POST['track']); $information = mysql_real_escape_string($_POST['information']); $results = mysql_real_escape_string($_POST['results']); ?>
  10. Try this Your form <table id="schedtable" align="center"> <tr> <td width="50">Edit</td <td width="250">Date</td> <td width="250">Track</td> <td width="250">Information</td> <td width="250">Race Results</td> </tr> <!--start form--> <form method="post" action="schedule_update.php"> <?php // loop to display info from db while ( $row = mysql_fetch_array($cur_sched)) { echo "<tr>"; echo "<td width='50'>" . "<input name='id[]' type='radio' value=" . $row['id'] . " >" . "</td>"; echo "<td width='250'>" . "<input name='date[]' type='text' value=" . $row['date'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='track[]' type='text' value=" . $row['track'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='information[]' type='text' value=" . $row['other'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='results[]' type='text' value=" . $row['results'] . ">" . "</td>"; echo "</tr>"; //end loop } ?> <!--buttons for form--> <tr> <td colspan="5" align="center"> <INPUT type="submit" value="Update" name="submit" /> </td> </tr> <!--end form--> </form> </table> schedule_update.php <?php //connect to the db require_once('includes/connection.php'); //Gets the Schedule from the schedule page $id = (is_numeric($_POST['id'][$i]))? $_POST['id'][$i] : 0; $date = mysql_real_escape_string($_POST['date'][$i]); $track = mysql_real_escape_string($_POST['track'][$i]); $information = mysql_real_escape_string($_POST['information'][$i]); $results = mysql_real_escape_string($_POST['results'][$i]); //Query to insert data into database $result = mysql_query("UPDATE raceinfo SET date='$date', track='$track', other='$information', results='$results' WHERE id='$id' ") or die(mysql_error()); //here for troubleshooting echo $id; echo $date; echo $track; echo $information; echo $results; //redirect after query header("Location:schedule.php"); ?>
  11. In my database, I have a name Health & Beauty When this is pulled out of the database, I replace the spaces with - so I can use it in the url I then want to display that name on the page, but the problem I'm having is the & So this is what I've done, but no matter what I do, the only thing that shows is Health, it won't the & Beauty part. $cat = ":" . str_replace('-', ' ', $_GET['name']); $cat1 = ":" . str_replace('&', '&', $cat); echo $cat1; Can anybody show me what I'm doing wrong? Thanks in advance
  12. May be nothing, but shouldn't you have single quotes around $accountID? $query = "SELECT * FROM student WHERE accountID = '$accountID'"; As well as this? $query = "SELECT courseID,courseName from courses WHERE courseID IN (SELECT courseID from account_courses WHERE accountID = '$accountID')";
  13. Your not forwarding to that link, your including it Try this <?php $testAcct = mysql_query("SELECT * FROM `login` WHERE Pass = '$tmp'"); If (mysql_num_rows($testAcct)){ include('setstatus.php'); include('activity.php'); //Set your base directory $config_basdir = "http://www.mysite.com/dev/index.php"; //Now forward the user to the members section header("Location: " . $config_basedir . "?section=memberhome"); } else { include('AccessDenied.php'); mysql_close($con); } ?>
  14. If you want the photo to the left and the text centered, do this <html> <head> <title> Europia! </title> <meta name="author" content="Kruptein"> <link rel="shortcut icon" href="/images/favicon.ico"> </head> <body> <!--<embed src="" loop="false" hidden="true" autostart="true"></embed>--> <table border="1" width="100%" height="100%"> <tr> <td colspan = "3" height="15%"> <img src="/images/NoPact.jpg" style="float:left;" /> <img src="" style="float:right;" /> Government of SalidriE<br style="clear:both" /> </td> </tr> <tr> <td width="10%"> <iframe src="/navigation/loggedin.php?nation_id=''" frameborder="0" width="100%" scrolling="no" height="100%"></iframe> </td> <td height="80%" width="90%"> <table border="1" height="100%" width="100%"> <tr> <td width='80%'> <b><u>Last Events:</u></b><p> </td> <td width="20%" align="center"><a href="/alliance.php?alliance_id=1"><img src="/images/NoPact.jpg" border="0" align="left"></img></a><br> alliance name: <a href='/alliance.php?alliance_id=1'>You don't have an alliance</a><br># money: 500<br>Nation Song: <br>Nation Symbol: </td> </tr> </table> </td> </tr> <tr> <td colspan = "3" height="5%"> <center>Made by Kruptein</center> </td> </tr> </table> </body> </html> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-950416-50"); pageTracker._trackPageview(); } catch(err) {}</script> If you want everything centered, do this <html> <head> <title> Europia! </title> <meta name="author" content="Kruptein"> <link rel="shortcut icon" href="/images/favicon.ico"> </head> <body> <!--<embed src="" loop="false" hidden="true" autostart="true"></embed>--> <table border="1" width="100%" height="100%"> <tr> <td colspan = "3" height="15%"> <img src="/images/NoPact.jpg" style="float:left;" /> <img src="" style="float:right;" /> Government of SalidriE<br style="clear:both" /> </td> </tr> <tr> <td width="10%"> <iframe src="/navigation/loggedin.php?nation_id=''" frameborder="0" width="100%" scrolling="no" height="100%"></iframe> </td> <td height="80%" width="90%"> <table border="1" height="100%" width="100%"> <tr> <td width='80%'> <b><u>Last Events:</u></b><p> </td> <td width="20%" align="center"><a href="/alliance.php?alliance_id=1"><img src="/images/NoPact.jpg" border="0"></img></a><br> alliance name: <a href='/alliance.php?alliance_id=1'>You don't have an alliance</a><br># money: 500<br>Nation Song: <br>Nation Symbol: </td> </tr> </table> </td> </tr> <tr> <td colspan = "3" height="5%"> <center>Made by Kruptein</center> </td> </tr> </table> </body> </html> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-950416-50"); pageTracker._trackPageview(); } catch(err) {}</script>
  15. Try this [attachment deleted by admin]
  16. Try this <?php $username=($_POST['username']); echo "User selected = $username"; include ('connect.php'); mysql_select_db("a6188092") or die(mysql_error()); $sql = ("SELECT email FROM Member WHERE loginName='$username'"); $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } $row = mysql_fetch_assoc($result)) $sysmail = $row["email"]; if ($_POST['sendmessage']) { if(!isset($_POST['message'])) { $messages = "You have not entered a message. Please enter a message in the comments box below and submit.<br>"; } elseif(!preg_match("/^.*?@.*?$/", $_POST['email'])) { $messages = "You have not entered a valid email address. It must be in the format name@provider.com.<br>"; } elseif(mail($sysmail, stripslashes(trim($_POST['subject'])), stripslashes(trim($_POST['message'])), "From: " . $_POST['email'] . "\r\n")) { $messages = "Please wait for a response from the user you messaged.<br>"; } else { $messages = "Error. Please contact the administrator.<br>"; } ?>
  17. I could be wrong, but try this <?php if(isset($_SESSION['first_name']) == FALSE { // 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. } ?>
  18. http://www.google.com/search?q=rollover+links&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
  19. Anytime you use <p align="center"><img width="78" height="54" src="http://deskfun.mine.nu/1123 hooton park website/4-3_clip_image003.gif" /></p> Your going to have a space above and below. To avoid that, but still keep it centered, use <td align="center"><img width="78" height="54" src="http://deskfun.mine.nu/1123 hooton park website/4-3_clip_image003.gif" /></td>
  20. timmah1

    DOCTYPE

    Can someone please tell me what I am doing wrong with my doctype? Here is what I have <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> But when I go and validate it, it passes with 1 warning. This is the warning Warning DOCTYPE Override in effect! The detected DOCTYPE Declaration "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">" has been suppressed and the DOCTYPE for "HTML 4.01 Strict" inserted instead, but even if no errors are shown below the document will not be Valid until you update it to reflect this new DOCTYPE. Can someone tell me what I'm doing wrong? Thanks in advance
  21. Have you tried mysql_real_escape_string()
  22. I got it to work with the OR, I didn't realize that would work Thanks for your help Maq.
  23. I understand that. I can't use OR, because then it's only going to grab everything from either or, I need it to be both. But I need to try and be able to pull all of the posts from the users is, as well as the follower id.
×
×
  • 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.