-
Posts
1,903 -
Joined
-
Last visited
-
Days Won
3
Everything posted by mrMarcus
-
if ($row['activated'] == 0) { should be: if ($rows['activated'] == 0) {
-
Show the code that runs when the user "activates" their account.
-
Firefox explicitly? Can you post your (relevant) view-source?
-
You've encapsulated the variable names with quotes. Remove the quotes and will display as expected: Thanks! <?php echo $name; ?> your question: <?php echo $question; ?> was sent successfully! We will contact you with this email address: <?php echo $email; ?> Better yet, just swap out everything from $query down with the following: $query = "INSERT INTO contact_us (name, email, questions) VALUES ('" .$name. "', '" .$email. "', '" .$question. "')"; if ($result = mysql_query($query)) { echo 'Thanks! '. $name .' your question: '. $question .' was sent successfully! We will contact you with this email address: '. $email; } else { if (!empty($error_message)) { echo $error_message .'<br/>'; } trigger_error(mysql_error()); }
-
For the sake of testing the form and its functionality, get rid of the header() redirect for the time being (just comment it out). What is happening when you submit the form? Details please. Consider breaking up your conditions so they can be more easily addressed and handled: /* validate contact name */ if (!isset($_POST['name'])) { $error_message .= "You must enter a valid contact name<br>"; } if (strlen(trim($_POST['name'])) < 5) { $error_message .= "Valid names are min 5 characters and use letters, numbers and underscores only.<br>"; } if (preg_match('/[^a-zA-Z0-9\s\-\'\,\.\_]/', trim($_POST['name']))) { $error_message .= "Your invalid contact name was: <font color=\"red\">" . $_POST['name'] . "</font><hr>"; } And so on...
-
Wonder how Kim Dotcom would respond to that? I'm sure you'll be enough under the radar that it won't matter. But ya, scratch the idea of receiving images via email and having to insert manually and do as was suggested with a backend control panel where images can be moderated more efficiently. As for filenames, I generally hash the filename with time(): $filename = md5($_POST['image'] . time()); So as to avoid improper filenames (unwanted wording, spaces in filename, etc). Then just store that in a table. Also, you can, but is not entirely necessary (all depending on expected growth of site and knowledge of file/directory handling), create folders for each user and store their images in there (assuming a user must be registered to upload an image). But hashing will suffice, I'm sure. Never store the path of the file in the table. Simply the filename, as directories/folders can be changed over time, and you don't want to have to update every file in the table.
-
Do as what has been said. My only input is to acknowledge the possibility of copyrighted images, and not only adult material. Being a "host" of any material can be a risky business.
-
$str = 'AAL-T.COM<br> AADQ.CA<br> ACADEMIENOUVELLEGENERATION.COM<br> AEFMQ.CA<br> AEFMQ.COM<br> AEFMQ.ORG<br> AERO-ATELIER.COM<br>'; is different than: $str = 'AAL-T.COM<br>AADQ.CA<br>ACADEMIENOUVELLEGENERATION.COM<br>AEFMQ.CA<br>AEFMQ.COM<br>AEFMQ.ORG<br>AERO-ATELIER.COM<br>'; Your method is redundant to begin with as you should just create an array of domains to check in the first place: $lines = array( 'AAL-T.COM', 'AADQ.CA', 'ACADEMIENOUVELLEGENERATION.COM', 'AEFMQ.CA', 'AEFMQ.COM', 'AEFMQ.ORG', 'AERO-ATELIER.COM' ); That will work.
-
target="paypal" Makes no sense. I've never seen that in PayPal buttons before.
-
Need help in displaying confirm button on the last loop data
mrMarcus replied to newphpcoder's topic in PHP Coding Help
Does it need to be within a loop? What's the difference if you placed it outside the loop? -
Ya, that's not correct. Have a look at the documentation in the link I provided (which I hadn't before I responded). To send to multiple recipients they must be added one at a time... try the following: <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/include/MailClass.inc'); $result_message = ''; if (isset($_POST['submit'])) { $errors = array(); if (empty($_POST['email_addresses'])) { $errors['emails'] = 'No emails selected.'; } // here you can/should loop through and verify email addresses to avoid spamming; put a restriction to # of emails allowed to be sent, etc. // santizing/controlling your email functions is greatly overlooked and can cause your site to be dropped by your hosting provider if your site is being used to send gobs of spam if (empty($errors)) { $result_message = 'There was a problem sending this mail!'; // instantiate the class $mailer = new FreakMailer(); // Build foreach ($_POST['email_addresses'] as $email_address) { $mailer->AddBCC($email_address); } // Set the subject $mailer->Subject = 'This is a test'; // Body $mailer->Body = 'This is a test of my mail system!'; if ($mailer->Send()) { $result_message = 'Mail sent!'; } $mailer->ClearAddresses(); $mailer->ClearAttachments(); } } $sql = "SELECT * FROM mailinglist"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result) > 0) { echo (!empty($result_message) ? $result_message .'<br/><br/>' : ''); echo " <h1>Mailing List</h1> Send to<br/><br/> <form action='send.php' method='POST'> "; while ($getrow = mysql_fetch_assoc($result)) { echo "<input type='checkbox' name='email_addresses[]' value='". $getrow['email'] ."' checked='checked'/>". $getrow['email'] ."<br>"; } echo "<input type='submit' name='submit' value='Send ยป'/></form>"; } else { echo 'Add some email addresses.'; } } else { trigger_error(mysql_error()); } ?>
-
Just looked at the PHPMailer class now, and it appears that $mailer->AddAddress() does not accept multiple addresses in one instance; but instead, you must create a new instance of $mailer->AddAddress() which will collect them all and send them to the Send() function. See here: PHPMailer
-
Your form method is GET while your using $_POST to gather the incoming form data. Change: <form method="get" action="contact-send.php"> to: <form method="post" action="contact-send.php"> and try again.
-
OK - here's the idea... and this code is basic/raw/untested. I don't know what's up with your config file and such in terms of where you're making your connection to your database, so I'll let you plug that stuff in. <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/include/MailClass.inc'); $result_message = ''; if (isset($_POST['submit'])) { $errors = array(); if (empty($_POST['email_addresses'])) { $errors['emails'] = 'No emails selected.'; } // here you can/should loop through and verify email addresses to avoid spamming; put a restriction to # of emails allowed to be sent, etc. // santizing/controlling your email functions is greatly overlooked and can cause your site to be dropped by your hosting provider if your site is being used to send gobs of spam if (empty($errors)) { $emails = implode(',', $_POST['email_addresses']); $result_message = 'There was a problem sending this mail!'; // instantiate the class $mailer = new FreakMailer(); // Get the user's Email $mailer->AddAddress($emails); // Set the subject $mailer->Subject = 'This is a test'; // Body $mailer->Body = 'This is a test of my mail system!'; if ($mailer->Send()) { $result_message = 'Mail sent!'; } $mailer->ClearAddresses(); $mailer->ClearAttachments(); } } $sql = "SELECT * FROM mailinglist"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result) > 0) { echo (!empty($result_message) ? $result_message .'<br/><br/>' : ''); echo " <h1>Mailing List</h1> Send to<br/><br/> <form action='send.php' method='POST'> "; while ($getrow = mysql_fetch_assoc($result)) { echo "<input type='checkbox' name='email_addresses[]' value='". $getrow['email'] ."' checked='checked'>". $getrow['email'] ."<br>"; } echo "<input type='submit' name='submit' value='Send ยป'/></form>"; } else { echo 'Add some email addresses.'; } } else { trigger_error(mysql_error()); } ?>
-
You want to have a form that draws multiple email addresses where a user can check the box to select whom to send an email to? Am I getting that correctly? Or is this just one single email address? Your code suggests multiple, plus please clarify. Instead of: name='mail_".$mailcount++."' Use an array for easier use when compiling your list of addressees for mailing: name='mail[]' Then you can just fire that array into the class using options that PHPMailer allows (probably a semi-colon delimited string of email addresses): $emails = implode(';', $_GET['mail']); $mailer->AddAddress = $emails Pseudo-code, so please refer to the class to ensure accuracy. I would suggest moving from GET to POST. No reason other than POST is cleaner.
-
Is there an option in the API to have it only return the coordinates, and nothing else?
-
Always have a width and height declared for an image. You can do so using css, or to be 100% compatible across the board, use in the inline width/height attributes as some versions of IE will not render the image at all without them. function createMarker(point, name, address, type, image) { var marker = new GMarker(point, customIcons[type]); var html = "<img src='" + image + "' width='100' height='75' align='left'/><span class='mapinfo'>" + name + "</span> <br/><br/>" + address; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); return marker; } Use that block of code.
-
You're right, it is. But there is more to this than his current HTML markup. That's why I asked him to simply see if the 'Logout' text was in fact clickable as I fear, and have seen a million times before in similar cases, that the containing DIV simply has a text-decoration:none style attached to it for all hyperlinks. Might not be the case, but it needs to be ruled out for my sanity. Aside from that, I fail to see how a DIV could otherwise manipulate the content within and break links without it being controlled by javascript.
-
Works fine for me. The image is contained within the infowindow.
-
the script is being run on a page where I have a dropdown box that lets you select round 5 or round 6, once you choose a round and hit go it should run the script to display the data from one of two tables in my database directly under my dropdown I'm quite certain that IF statement is not hitting because round has not been declared properly. Know what I mean? This entire condition block is a mess: if (round == 5) { $table = round5_score_sheet; } round5_score_sheet needs to be enclosed in quotes (single or double), and I have no idea what 'round' is, but I'm thinking you meant to declare at some point earlier so your code should look something like: if ($round == 5) { $table = 'round5_score_sheet'; } Because neither of your conditions are hitting, there is no table name being passed to the query. This is a solid lesson in error handling and control in that all conditions must be met before a query is to be executed, and if none are reached, the query does not run. This: $query = mysql_query("SELECT * FROM $table ORDER BY channel"); $result = mysql_query($query) or die(mysql_errno().':'.mysql_error()); // the above will tell you what, if any, is the mysql error / Needs to turn into: $query = "SELECT * FROM $table ORDER BY channel"; $result = mysql_query($query) or die(mysql_errno().':'.mysql_error()); // the above will tell you what, if any, is the mysql error /
-
That's not valid inline CSS. See color=#9e0219 should be color:#9e0219 His initial code was OK. HTML without quotes is still valid HTML. It only becomes invalid when you have declared your document as XHTML, but who does that anymore?
-
Yes, every time you add a new column you'll need to update all applicable code within the script(s). That's why I was saying this way is over-complicating the process using an external XML generator PLUS a separate XML parser. Style it like I showed you earlier. Inline within the createMarker() function. Or by using CSS classes.
-
OK - you're not passing 'image' as an argument to the createMarker() function. See how you passed the others, you need to pass image as well. function createMarker(point, name, address, type, image) { var marker = new GMarker(point, customIcons[type]); var html = "<img src='" + image + "'/><span class='mapinfo'>" + name + "</span> <br/><br/>" + address; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); return marker; }
-
Can you either post a link to the project page (if not on localhost; and if you are OK with that), or do a view-source in your browser and paste the code here.