Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. It very well could. Not sure...I never use iFrames. Too much of a bother. Is the iFrame content coming from your site (same site), or a remote site? If it's a remote site, it's subject to the Same Origin Policy. http://en.wikipedia.org/wiki/Same-origin_policy
  2. Yes, it's whatever the VALUE of the form control is, regardless of the content type. As far as a form is concerned, it's all just text.
  3. Those are form elements, you want to get and set their val(), not their html().
  4. No, it's saying $sumUsageKWH = $sumUsageKWH + $row['totalUsage'] so it's just adding $row['totalUsage'] to $sumUsageKWH
  5. When I go to the print dialog, it gives me options for printing "background graphics" as mine is called, etc. When enable that your image shows up. The options may vary from printer to printer. It was under advanced settings for me. Not sure on that.
  6. $x = 5; $x += 5; //short for $x = $x + 5 echo $x; //10 http://php.net/manual/en/language.operators.assignment.php
  7. Well, if you want an actual PDF, then you have a lot more work to do, probably more than you've done thus far. It's complex, even with a good library to use. I'd suggest looking at FPDF and TCPDF, or google "php pdf library" for more. If you just want to bring up the browsers native print dialog, which is the same as just choosing "print" from your browser, then you'd just change your button slightly and add an onclick event and have it trigger window.print(): <input type="submit" id="Button1" name="" value="print" style="position:absolute;left:129px;top:295px;width:96px;height:25px;z-index:20;" onclick="window.print();">
  8. Why don't you test for an error and display it if it does so you can get some idea of what mysql is complaining about? See the example in the documentation.
  9. $columns = array(); $fields = array(); foreach($this->getColumnNames("table") as $columnName) //cycle through the valid columns { //see if there was a posted field with this key if (array_key_exists($columnName, $_POST)) { $columns[] = $columnName; //store the column name $fields[] = $_POST[$columnName]; //store the field value from POST } } Now you can use your implode on $columns and $fields to build $columnList and $paramList
  10. It will continue through empty lines. The best way to learn is to look up the functions being used in the php manual, and also to try them out with test data to see. If you don't want it to store an empty line in the final output, then just check for it and don't add it to the array in the while() loop. if ($ar[0] != '') $users[] = $ar[0]; //only store line in new array if it contains something It *may* work retrieving the file from a different host using fopen(), but that relies on allow_url_fopen being enabled in your php.ini. Again, see the manual for fopen() for more details. You can always use CURL to retrieve from another site, which will work all of the time.
  11. Most likely you are using the mysql extension, and are using PHP >= 5.3. PHP has deprecated the mysql driver, which means it's going to be totally removed from PHP in an upcoming version. You should be using the PDO (1st choice) or MYSQLi extension and forget that the original MYSQL extension exists if you want to better future proof your code. See the PHP notes: http://php.net/manual/en/migration55.deprecated.php More here: http://php.net/manual/en/intro.mysql.php
  12. Are you using $_POST or $_GET? Because in your first lines of code you are using both, which is odd. Regarding your query, you should use double ampersands (&&) or better to just use "AND" for the logical operator. I don't believe a single & means anything.
  13. What are you using to post the form via ajax? Post that relevant JS code.
  14. I wouldn't, for the same reason. It requires special settings to be enabled to work on URLs. In shared hosting, you don't often have direct control of php.ini to enable/disable things.
  15. Put session_start() at the very top of the page as the first thing. You have something before session_start() which is outputting something (around line 9). Session won't work if there is ANY output before starting the session.
  16. Not really, curl would be more bulletproof as it will work no matter what. file_get_contents() relies on certain fopen wrappers being enabled, which may vary from server to server.
  17. This: session_save_path('/home/admin2/public_html/sesh'); ini_set('session.gc_probability', 1); should also come before session_start(), and especially before you start using $_SESSION or it won't have the correct session path to look the session data up
  18. Your code assumes the email gets sent, even without checking to see if it does. Change these 2 lines: mail($emailTo, $subject, $body, $headers); $emailSent = true; //shouldn't assume this to $emailSent = mail($emailTo, $subject, $body, $headers);
  19. Maybe these would be useful in your htaccess #If the request is not an actual existing file RewriteCond %{REQUEST_FILENAME} !-f #If the request is not an actual existing directory RewriteCond %{REQUEST_FILENAME} !-d RewriteRule //Your rewrite rule
  20. Is there an error on the screen, or in the error log? Define "stopped working"
  21. Are all of your db tables prefixed with 'smf_'? You might also try changing the driver to "mysqli" instead of "mysql". It looks like you should be receiving emails about the db errors ($db_error_send = 1;)...are you? You might contact the host then if db_server, db_name, db_user and db_passwd are all correct, and everything else. In the future when reinstalling or upgrading something, make a copy of the original so you have the original files to compare to.
  22. What about the db_user and db_name? Are those correct?
  23. Is it your application that determines whether it's a 404 page, or the webserver itself? Like for your /143/test.php example, is there an actual directory named 143 with a test.php file in it, or does your app take the request, translate it and look it up in a db for routing or something? If it's the app making the determination, then those ErrorDocument directives will never be used as those are for "native" errors to the webserver. This might be a language problem around the term "redirect", but you should never "redirect" to a 404 page. Redirects change the url and actually take the visitor to a different page. You should just throw a 404 status header and display a custom not found message, but the URL should still be the actual page that is missing and not redirected (a new request) to /errors.php. Otherwise, you are telling browsers and search engines that "http://yoursite.com/errors.php" doesn't exist instead of the actual missing page, which in fact it does.
  24. Are you sure you need to do this? What's the goal here? Default form behavior is to submit the form when enter is pressed. Altering that behavior could lead to a bad user experience since most are used to the default behavior for forms. The only way to do what you are asking is to use javascript. Are you using a library such as jQuery? Depending on what you're using, the answer would look different.
  25. The first 2 notices are probably causing the rest of the errors. The 2 variables, $boarddir and $sourcedir, don't exist in your code. Those look like they're supposed to be defined as a path. Then the rest of the code (require's) try to use those variables to load more code, but it can't since the paths aren't defined. So you need to find why those 2 variables aren't defined (should be further up your code), and define them with the correct paths.
×
×
  • 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.