Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Yeah, for anyone who cares really (is a regular), I'm glad it's not hot pink!
  2. Are you even running the query? mysql_select_db($database_conYamaha, $conYamaha); $query = "INSERT INTO tblregproducts (memId, prodEPrefix, prodENo, prodPurchased, prodActive, prodYamaha, mmonth, yyear ) VALUE ('".$_SESSION['sub_id']."', '".$_SESSION['frPrefix']."', '".$_SESSION['frNo']."', '1', '1', '1', '".$_SESSION['mmonth']."', '".$_SESSION['yyear']."' )"; $result = mysql_query("$query") or die(mysql_error()); $row = mysql_fetch_assoc($result); echo print_r($row); //Display result.
  3. You can look at this. Some mail providers allow piping, but this assumes you have shell access really, It's just not so viable to be able to do this on a shared hosting account.
  4. A server error it seems, It works now so you can assume it's intermittent. There would be no access to that file (assuming it's a web host) so it couldn't have been a crashing attempt.
  5. Moved? You will require JS/AJAX to perform this, again using strip_slashes to be a viable validation to automatically create a 'text' component. If i'm understanding what you mean by moving into the other box.
  6. You would use the target="_blank" attribute on the anchor href link, But note that browsers such as (firefox/Opera/IE) will have default behaviours for this, and may force it into a tab, this is purely user defined. If you require a new window rather than tab, a popup will be your only solution.
  7. What I was hoping I could do is the following: - A file gets added to a directory - Some sort of file senses this - The file tells a php file to run - The php file starts up and reads the new file in the the directory I was hoping I could do something other than cron, because I want this to happen as soon as the file exists in the directory, not have a cron run every xx minutes. This is impossible unless you run a program on serverside (out of PHP completely) to scandir and execute php on discovery, FTP discovery is another solution but it's just not such a viable solution, A cron tab could be run xx seconds if need be, as it only executes a (should-be) short script.
  8. Do you mean added not via PHP (SSH/FTP/Shell)? You must run a CRON job to check, you can run it every 5 minutes for example (non-resource exhausting), the php script can check(glob) for a newly added file (adding each new one to a DB/flatfile or whatnot, or comparing unix timestamps of creation) and run another php script based off if there is a new result.
  9. IT's called data scraping. If the classified pages (which most likely do) provided the results via GET/POST you can use get_file_contents or curl to get the data, then preg_replace with a pattern to get the resutls you're looking for.
  10. You can get their browser user agent with $_SERVER['HTTP_USER_AGENT'], and that will be the only really non-js method of being able to read what they're on. If you install browscap.ini , You can use get_browser (instructions are on the page), and you'll be able to parse an array out of their user string, but it may only be for more common mobile OS's. If you're really wanting to find out their capability, use AJAX. If the form does not send any data, then JS can set the session to disable JS for the login session etc. EDIT: header will be your solution to redirect them, as it's an HTTP (non-js solution), add ob_start() to the beginning of your code if you wish to send the header after content is pushed to the client.
  11. I'm not sure what you want, but here's an example form with submit button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>columns</title> </head> <body> <table width="100%" border="0"> <tr> <td><form id="form1" name="form1" method="post" action="somefile.php"> <label>Users HTML<br /> <textarea name="textarea" cols="35" rows="12"></textarea> </label> </form> </td> <td><form id="form2" name="form2" method="post" action="somefile.php"> <label>Users TEXT<br /> <textarea name="textarea2" cols="35" rows="12"></textarea> </label> </td> </tr> <tr> <td> <input type="submit" value="Send mail"/> </tr> </td> </form> </table> </body> </html> Any fields between the <form> elements will be able to be accessed from PHP. Note that it will be (nearly impossible) to send an e-mail the way you want without PHP. In PHP you can access the forms like: <?php $message_html = $_POST['textarea']; $message_nohtml = $_POST['textarea2']; $to = 'your@e-mail.com'; $subject = 'Your e-mail'; $message = "E-mail: Only text: \n $message_nohtml \n\n E-mail: With html:\n $message_html \n\n"; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Note you could just use strip_tags on the html field, to remove html so there's no need for two fields if you want it automated, Just giving you the only really viable solution, if you're having troubles don't hesitate to ask on the php forums.
  12. Again, Unless you have a VPS or own your own server, You won't have access to the 500 errors, only assign a page to them.
  13. Try using utf8_encode with that function. $site = "http://www.usatoday.com/sports/gaming/sheridan.htm"; $content = utf8_encode(file_get_contents($site)); $replacement_char = utf8_encode('½'); $content = str_replace($replacement_char, ".5", $content, $count); echo 'Replacements: ' . $count . '<br />'; $doc = DOMDocument::loadHTML($content); This works fine for me, and removed the 'Â.5' .. problem.
  14. It would help to get a sample of the $raw_data variable and as well the obvious problem entries (that you claim are in the wrong places). It's hard to predict an error, Without the error..
  15. You can of course use phpflag directives, Note that if php.ini has been set to not read these, there's a slight possiblity it will not work without modifying the master: php_flag log_errors on php_value error_log /home/path/public_html/domain/PHP_errors.log You can of course, as well deny access to the error log: # prevent access to PHP error log <Files PHP_errors.log> Order allow,deny Deny from all Satisfy All </Files> EDIT: More here, http://php.net/manual/en/errorfunc.configuration.php Apache error logs would require you to ask for them most likely, not a method I know off hand to retrieve them, especially through php, you don't have access to them.
  16. So I've been wondering. What distribution of Linux do you work in, in your home personal computer, homeserver, or at a job you've come accustomed to? Here are a list of the 5 most common major distributions used: 1) Debian / Ubuntu 2) Slackware 3) Fedora 4) Mandriva 5) (open) Suse I've tried some interesting flavours, starting off at Ubuntu but found I didn't need many of the features, including the GUI. Gnome seemed to be buggy when I've wanted to do certain things with it. After that I stuck with Arch Linux which is a lightweight and 'powerful' distribution that I run most of my jobs on with out hassle. -------------------------------------------------------------------------------------------------------------------------------------------------------- In case anyone does not currently use/have never tried Linux, feel free to explore the links and try some out, Most come with the option for GRUB, which allows a 'boot menu' for selection between use of your own OS or Linux. Tell!
  17. CentOS and Fedora are usually the choices for web servers due to the power of the built in networking/server ability, but it is not really a recommended operating system for beginners. If you are wanting to develop PHP, any one will do (Ubuntu is a very user friendly, but powerful distribution based on Debian that has a good package manager and supports SQL/advanced networking). You can after install a AMP installation such as LAMP (Linux Apache/MySQL/PHP) server and development will be very simple from there.
  18. This seems like a good way to go before I write my own extensive functions. Thanks. If you want to practise around, here's a nice tutorial to teach you the essential basics of the PHP GD library (should be included on default PHP installations) and includes the tutorial as a bar char, ironically. http://www.builderau.com.au/program/php/soa/Using-GD-functions-in-PHP-to-create-a-bar-chart/0,339028448,339200806,00.htm
  19. What is exactly your problem here? Post some sample code of which you are having trouble with, or be more specific on what you want to do.
  20. Will that log all the other details as well? like the page that used the function? I don't trigger the error myself. This is the problem, I don't know what is actually causing this error because I have went through my whole script with as many possibilities as possible, such as; Logged in, Logged out, Unauthorized, etc. and I can't trigger it for the life of me. So I need to figure out "why". I know that the query is not returning a valid resource. The error tells me that in clear PHP-muffled English! This will trigger an error such as: "Fatal Error: MySQL query returns resource ID #4 on line xxx".. You can log the errors using an error log, which you can define in php.ini.
  21. Can you implement your calculation in a loop? You could fairly easily iterate a count for each time the number is modified, store it into an array and count it (or simply +1 to a number). $originalcash2 = $_GET['cash']; $equation2 = 0; $c = 0; for ($i=0;$i<$times;$i++) { $originalcash2+= ($originalcash2 / $cost * $shards / 50000); $c++; } echo "<br />Total Trades: " . number_format($originalcash2,2,'.',','); exit; }
  22. Sounds good. How are you doing the e-mail verification? Cron jobs? Or something simple?
  23. Then why not find an example survey script, and learn from those hundreds of sites on the structure? Learn how to store the questions in a database, and implement security such as multi-account blocking and verification answers were not automated. A (simple) survey is the least of your PHP problems.
  24. MS Office -> Open Office. Windows 7 -> Windows 7 RC2- r777 (free) + timebomb deactivator Vista -> (Should be thrown everywhere like AOL disks!) By the way, Visual Studio Express used to be downloadable in one step w/o registering, this DreamSpark thing is sorta uninnovative for actual utilization of effective software, unless you're not able to know other software than what MS provides (companies obviously tend to go MS rather than open source..)
×
×
  • 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.