Jump to content

Bauer418

Members
  • Posts

    206
  • Joined

  • Last visited

    Never

Everything posted by Bauer418

  1. I agree. Exceptions can be useful but they can be extremely annoying and pointless. If your code is truly "full" of try catch blocks, you probably have too many.
  2. Your JS doesn't even work in Firefox 3. My assumption is that your JS has more than one problem in it.
  3. Made a mistake in what I posted. This line: http.open('get', 'update.php?height=' + height + '&width='+width + '&top='+top + '?&left='+left + '&Div_name='+Div_name + '&Border='+Border + '&Position='+Position + '&Background='+Background + '&Cursor='+Cursor); Should be this: http.open('get', 'update.php?height=' + height + '&width='+width + '&top='+top + '&left='+left + '&Div_name='+Div_name + '&Border='+Border + '&Position='+Position + '&Background='+Background + '&Cursor='+Cursor); And what does this line in your PHP file do: $conn; Seems useless to me.
  4. Your parameters are added incorrectly. Multiple parameters in a querystring should be separated with an ampersand (&) not a question mark. The question mark separates the query string from the page. This code: var http = createRequestObject(); http.open('get', 'update.php?height=' + height + '?width'+width + '?top'+top + '?left'+left + '?Div_name'+Div_name + '?Border'+Border + '?Position'+Position + '?Background'+Background + '?Cursor'+Cursor); http.send(null); Should be this: var http = createRequestObject(); http.open('get', 'update.php?height=' + height + '&width='+width + '&top='+top + '?&left='+left + '&Div_name='+Div_name + '&Border='+Border + '&Position='+Position + '&Background='+Background + '&Cursor='+Cursor); http.send(null);
  5. For something this simple I'd advise that you use str_replace rather than preg_replace. str_replace is much faster.
  6. That'd be ugly. You could just do echo '<tr bgcolor="' . $bg . '"> <td align="left">' . $row['job_no'] . ' <td align="left">' . $row['model_no'] . '</td> <td align="left">' . $row['firmware'] . '</td> <td align="center">' . $row['dr'] . '</td> <td align="center">' . $row['ds'] . '</td> <td align="center">' . $row['dc'] . '</td> <td align="left"><b>' . ($row['status'] == 'Complete' ? "link here" : "whatever you want if it isn't complete") . '</b> </td> </tr>
  7. Well I don't think you even need the hidden field, you could just have "yes" hardcoded into the script, but if you want to use it you'll need a form looking like this on your HTML page: <form action="yourphppage.php" method="post"> <input type="hidden" name="active" value="yes" /> <input type="text" name="username" value="" /> <input type="submit" name="submit" value="Activate!" /> </form> And yourphppage.php: <?php $active = $_POST['active'] == 'yes' ? 'yes' : 'no'; $username = $_POST['username']; $query = "UPDATE `tablename` SET `active`='" . $active . "' WHERE `username`='" . $username . "'"; $result = mysql_query($query) or die(mysql_error()); ?> Please be aware that the code I just wrote is highly vulnerable to SQL injection. You'll need to run whatever you feel is necessary (usually a mysql_real_escape_string and some HTML removal technique is good enough) to remove that vulnerability.
  8. Well assuming your ID field is an auto_increment, you should just be able to run this query: SELECT * FROM example ORDER BY id DESC LIMIT 5 Which will grab the 5 most recent items in the database, assuming that is what you want.
  9. After this line: $result = mysql_query($sql); Add this code: if (mysql_num_rows($result) < 1) { echo 'This ID does not exist in the database'; }
  10. You'll want some sort of separation such as placing a hyphen between the manufacturer's 2/3 character code and the model #, so your items would be HTS-xxxxxx and ST-xxxxxx Then you can run something like: SELECT SUBSTRING_INDEX(model_no, '-', 1) as mft_code FROM Disks
  11. $query = "SELECT MAX(ordId) + 1 AS newOrderId FROM `order`";// query to generate new order ID $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($res); $new_orderid = $row['newOrderId'] ? $row['newOrderId'] : 1; That should do it...
  12. At the end of the code you posted above you can simply add: if (!$new_custid || !is_integer($new_custid)) { $new_custid = 0; }
  13. Instead of doing INSERT INTO `phpbb_users` (`user_id`, ...OTHER COLUMNS...) VALUES (NULL, ...OTHER COLUMNS...) Take out user_id from the fields, and remove NULL from the VALUES. this should solve your problem.
  14. phpBB is open source...copy the mail function from it. Chances are it's just a simple header or two that you're not passing.
  15. This isn't a PHP error at all. It's a MySQL error. Your table is setup to have a unique index and it is returning an error when two different rows have the same value for this "unique" ID.
  16. Rather than stripping out the double quotes, consider running: $var = htmlentities($var, ENT_QUOTES); Which will convert double quotes to " to and single quotes to &#039;
  17. You don't understand the concept? You add $mail->IsHTML(true) right above $mail->Send()
  18. Yes and no. POP3 is a client/server protocol for receiving and sending messages to the user's email client. It's not a "server setting." However, you refer to an ISP's email service (such as comcast.net) as a POP3 email address, because emails are retrieved using POP3. This (I believe) is what he meant when saying a POP3 email address.
  19. Considering the fact that you can send it to some mail servers and not others, I can't think of anything off the top of my head. You can try using the PHPMailer class, as it helps set a lot of headers that the mail() function leaves out, some of which help your message pass certain filters and checks.
  20. Do you have access to the vBulletin files from the script you want the information to appear on? While freenity posted the easiest solution, if you want to do everything with respect to your vBulletin settings, I'd recommend essentially copying and pasting the code from the index.php of vBulletin. I don't have access to a vBulletin installation, however, but I'm sure a quick google search will shed some light. I can't imagine you're the first person to want to do this same thing.
  21. Are you sending the email from a shared host/server? Your server may have been blacklisted by certain ISPs or mail hosts for spam (not necessarily by you, but by another user on the same server).
  22. What did you host on massmirror.com? Are you trying to send an attachment in your email?
  23. Edit: I lied, forgot upload_max_filesize and post_max_size are PHP_INI_PERDIR so they need to be changed in .htaccess, using this: php_value upload_max_filesize 100M php_value post_max_size 101M post_max_size is larger than upload_max_filesize to allow 1MB of extra postdata (form fields, etc.) beyond the 100MB limit of the file itself.
  24. POP3 is a method for retrieving email addresses, and shouldn't have an impact an email being sent to the address. My assumption is that the message is being flagged as spam by the server. Check the junk mail folders of the email program.
  25. That still doesn't describe your problem. You can send to gmail users, but nowhere else? Please clarify your issue. Side note: you're sending the email twice, but the first one has en empty body...
×
×
  • 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.