Jump to content

Prismatic

Members
  • Posts

    503
  • Joined

  • Last visited

Everything posted by Prismatic

  1. The best way to validate an email is to send an email to it.
  2. Here try this, I cleaned up your code. Make sure you close any function parentheses function("blahblah"; vs function("blahblah"); Also make sure you properly end your lines $var = $somevar vs $var = $somevar; and close any open brackets. Try running this <?php /* Program: postit.php * Desc: puts entered data in database */ Session_start(); if (@$_session['auth'] != "yes") { header("Location: login.php"); exit(); } include("caneck.inc"); switch ($_POST['do']) { case "post": /*check title, description, and location for blanks*/ if ($_POST['title'] == "") { $blanks[] = "title"; } if ($_POST['description'] == "") { $blanks[] = "description"; } if ($_POST['location'] == "") { $blanks[] = "location"; } if(isset($blanks)) { $message = "Please fill out: "; foreach($blanks as $value) { $message .= $value .", "; } extract($_POST); include("postform.inc"); exit(); /*clean data and set new variables to insert into table*/ $cnx = mysqli_connect($host,$user,$passwd,$dbname); $title = strip_tags(trim($_POST['title'])); $description = strip_tags(trim($_POST['description'])); $location = strip_tags(trim($_POST['location'])); /*check whether title already exists*/ $sql = "SELECT title FROM Post WHERE title = '$title'"; $result = mysqli_query($cnx,$sql) or die("Couldn't execute select query."); $num = mysqli_num_rows($result); if ($num > 0) { $message_new = "The title, $title, is already in use. Please choose another title."; include("postform.inc"); exit(); } /*add new event to database*/ else { if($_POST['sampm'] == "pm") { $_POST['shour'] = $_POST['shour'] + 12; } $startDT = $_POST['syear']."-".$_POST['smonth']."-".$_POST['sday']."- ".$_POST['shour'].":".$_POST['sminute'].":00"; $endDT = $_POST['eyear']."-".$_POST['emonth']."-".$_POST['eday']."- ".$_POST['ehour'].":".$_POST['eminute'].":00"; $today= date("Y-m-d h:i:s"); $_SESSION['logname'] = $logname; $_POST['eventType'] = $eventType; $sql = "INSERT INTO Post (loginName, createDate, title, description, Location, eventType, startDT, endDT) VALUES ('$logname', '$today', '$title', '$description', '$location', '$eventType', '$startDT', '$endDT')"; $result = mysqli_query($cnx,$sql) or die("Can't execute insert query."); header("Location: login.php"); } } } ?> [/code
  3. $description = strip_tags(trim($_POST['description'])); You weren't closing out the strip_tags function.
  4. If he's sharing the same connection as you then yes, he will have the same IP address.
  5. But why in the line $result = mysql_query($q, $this->connection); also $q isn't wrote in the same way as connection. Isn't also q a method? $q is the query <?php class MySQLDB { function usernameTaken($username){ if(!get_magic_quotes_gpc()){ $username = addslashes($username); } $q = "SELECT username FROM ".TBL_USERS." WHERE username = '$username'"; // <--- $q $result = mysql_query($q, $this->connection); return (mysql_numrows($result) > 0); ?> $this->connection refers to a connection variable inside the current class edit - sorry meant variable not method
  6. <?php $query = mysql_query("SELECT * FROM favorites WHERE user_name = 'username'"); while($row = mysql_fetch_row($query)) { $songInfo = mysql_query("SELECT * FROM songs WHERE song_id = '{$row['song_id']}'"); $songInfo = mysql_fetch_row($songInfo); echo $songInfo["song_title"] ." / ". $songInfo["artist"] ." / ". $songInfo["year"] ."\n"; } ?>
  7. Currency exchange rates change constantly, there's no one formula you can run. What you need to do is find a site that lists the current currency exchange rates and parse out the current going rate of INR in dollars.
  8. This means that instead of sending the message (in my case newsletter), we will send a link to the message which resides in our server. And the email receiver (in my case newsletter subscriber) will have to click that link to see the message. Am I right? No. You append to the end of your newsletter the code for the link.
  9. You simply include it as part of the mail body. The link would point to a file on your server that removes their email from the mailing list.
  10. <?php function topic($input) { $pattern[0] = ""; $pattern[1] = "/\&/i"; $pattern[2] = "/\</i"; $pattern[3] = "/\>/i"; $pattern[4] = "/\[b\](.*?)\[\/b\]/i"; $pattern[5] = "/\[u\](.*?)\[\/u\]/i"; $pattern[6] = "/\[i\](.*?)\[\/i\]/i"; $pattern[7] = "/\[code\](.*?)\[\/code\]/i"; $pattern[8] = "/\[url\](.*?)\[\/url\]/i"; $pattern[9] = "/\[img\](.*?)\[\/img\]/i"; $pattern[10] = "/\[url\=(.*)\](.*)\[\/url\]/i"; $replace[0] = "<img src='/images/smiley1.gif'/>"; $replace[1] = "&"; $replace[2] = "<"; $replace[3] = ">"; $replace[4] = "<b>$1</b>"; $replace[5] = "<u>$1</u>"; $replace[6] = "<i>$1</i>"; $replace[7] = "Code:<br><div id=\"code\"><tt>$1</tt></div>\n"; $replace[8] = "<a href=$1>$1</a>"; $replace[9] = "<img src = $1 />"; $replace[10] = "<a href=$1>$2</a>"; $bbcoded = preg_replace($pattern, $replace, $input); //return nl2br($bbcoded && $some2); return nl2br(strip_tags(stripslashes(htmlspecialchars($bbcoded)))); } ?>
  11. My idea is to use some tools to extract a frame from the stream it's self. Then compare that frame with the default non-streaming image. If the frame is different the stream is most likely active, if it's not the stream is most likely not active.
  12. There is a way. I should have a solution soon.
  13. Method 2. In method 1 you're calling explode each iteration
  14. Take a look at this ukphoto, http://www.phpclasses.org/browse/package/2540.html Also, http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm
  15. i did not get what you are asking me to do i posted the same code which i am using for making the posting into the discussion forum can you explain me in details what might be the error Code tags, when you post code on these forums it's polite to encase them within [code][/code] to preserve proper code formatting and/or code highlighting. Example: <?php function myFunction($str) { return $str; } echo myFunction("Hello world!"); ?> vs <?php function myFunction($str) { return $str; } echo myFunction("Hello world!"); ?>
  16. Can anyone verify my math? I think this would do it. I don't see a problem with this approach as long as I make sure to use a Mercator projection map (so the lat/lon lines are straight) [attachment deleted by admin]
  17. Say I had a picture of the globe, or more specifically, the USA (See attached) If I could somehow supply a script some starting points and their corrosponding coordinates, how hard would it be to have the script figure out what the rest of the coordinates would be for any given pixel? Ideas? [attachment deleted by admin]
  18. How would one go about matching the following in a string? (xxxx/yyyy) basically find anything inside a pair of quotes ( ) with a / in the middle so in this example: dfasdf asfasd : dsfasd asdfasd -.-- fhfg (40.34342/5.023424) asdf 40.34342 and 5.023424 would be matched? Solved (\s\((.*?)/(.*?)\)\s)
  19. hey guys thanks a ton for the examples. Ill check them when i get home (on my cellphone)
  20. And I connect them with a straight line, 1 pixel wide. How would I go about tracing that line, starting at point A, and going to B? I'm working on an application and will need to check certain values at each point along a line.. I'm not actually drawing a line, but if a line were there, i would need to be able to follow it. See my graphic for an example, ideas? Edit - Basically im asking how to find the coordinates of each pixel along a line between 2 coordinates [attachment deleted by admin]
×
×
  • 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.