Jump to content

R0bb0b

Members
  • Posts

    127
  • Joined

  • Last visited

    Never

Everything posted by R0bb0b

  1. do you echo your javascript before or after the html? The way you have inserted the javascript, not in a function or anything like that, it is going to run right when the browser processes it, so if you have it before your div has been parsed then you will get an undefined object. And Zurev does have a point, I have to assume that this is just a proof of concept type thing.
  2. I don't see any reason why that wouldn't work, can you provide some of your html as well?
  3. this is very basic, if you are taking user input you should probably add some field validation but here you go: <?php $strOutPut = ""; if(isset($_POST['txtInput']) && trim($_POST['txtInput']) != "") { $arrLines = explode("\n", str_replace("\r", "", $_POST['txtInput'])); array_walk($arrLines, "trim"); foreach($arrLines as &$value) { $strOutPut .= str_replace(" ", "-", $value) . "\t" . $value . "\n"; } $strOutPut = substr($strOutPut, 0, -1); $fp = fopen('path/to/file.txt', 'w'); fwrite($fp, $strOutPut); fclose($fp); } ?> <html> <head> </head> <body> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <textarea name="txtInput" style="width:500px; height:300px;"><?php echo trim($strOutPut) != ""?$strOutPut:""; ?></textarea><br /> <input type="submit" name="btnSubmit" value="submit" /> </form> </body> </html>
  4. This also may be a windows socket thing, which I don't use, but I do see something that you also might find useful here http://www.psychostats.com/forums/index.php?showtopic=20761&st=0&p=111863&&do=findComment&comment=111863
  5. I don't recognize that error but I can say this: the url "http://127.0.0.1/ddos/udp.php?ip=127.0.0.1?port=81?time=10" is not valid. I should look like this http://127.0.0.1/ddos/udp.php?ip=127.0.0.1&port=81&time=10
  6. try to urlencode the entire xml string like so: foreach($fields as $key=>$value) { $fields_string .= $key.'='.urlencode($value).'&'; }
  7. I got it, you need to call the function <?php pdf_set_parameter($pdf, "escapesequence", "true"); ?> after you instantiate the pdf object and then you can use a whole range of encoded characters. After I set the parameter "escapesequence" as "true" I could then use <?php str_replace("<", "\\074", $noterow['note']); ?>
  8. <?php $textflow=PDF_create_textflow($pdf, $macros.$doccontent, "fontname=Times-Roman fontsize=10 encoding=winansi leading=118%"); PDF_fit_textflow($pdf, $textflow, 70, 50, 550, 750, "showborder=false"); PDF_delete_textflow($pdf, $textflow); ?> I have tried "<" and it just displays as "<" and not "<".
  9. I am using pdflib and am getting this error "Fatal error: Uncaught exception 'PDFlibException' with message 'Unknown macro '&' in Textflow' in /usr/local/apache2/azfmc/html/cases/printdn.php:478 Stack trace: #0 /usr/local/apache2/azfmc/html/cases/printdn.php(478): pdf_create_textflow(Resource id #5, '/usr/local/apache2/azfmc/html/cases/printdn.php on line 478" What it is doing is finding a "<" in the text and considering that to be the start of a macro. What can I replace "<" with that will show up as "<" in a pdflib pdf document that won't confuse the parser? I've already looked through my dingbat chart and don't see it there.
  10. That's just one example where there are dozens. My guess is that somewhere in the PDO class mysql_real_escape_string() is already being used. It must single quote the values too, otherwise that should work.
  11. OK, but I think you get the point. How are you going to validate that ':id' is an integer if you do validate that ':id' is an integer. I don't see how this protects against sql injection.
  12. I don't see a difference between this: <?php $pquery=$dbh->prepare("SELECT * FROM product WHERE product_name='bananna' and category_id=1 and 1=1"); ?> and this: <?php $pquery=$dbh->prepare('SELECT * FROM product WHERE product_name=:name and category_id=:id'); $pquery->execute(array( ':name'=>$name, ':id'=>'1 and 1=1' )); ?> they would produce the same results
  13. It's certainly worth looking at if you want to. I would preserve this script you have here by renaming it to something like file.php.bak and then make the other the primary file for the time being and see if you can get that one working. But eventually you're going to want to stick with something.
  14. Yes, the terminal window. This looks like a valid sql statement to me so I am assuming that some of the columns like "id" and "name" and possibly the tablename "info" may be reserved words in mysql so require must be quoted with ``.
  15. So that people can have a place where they can view all of their unresolved threads.
  16. Now try putting that "SELECT id, name FROM info ORDER BY id" into your database manager query window and adjust it until it works. I'm guessing one of those columns is a key word which you will need to surround with ``. BTW: while you are learning, you should start most of your queries inside of your database manager, make sure they work first, then input them into your code. Once you learn php error handling, which you can find in the manual just search on google for php error handling, then it will be easier for you to write sql in your code on the fly.
  17. You should consider echoing your query to the browser. I always set up a debug boolean at the top that turn on and off debug mode. If on, every query is echoed to the browser and I can see what the problem is.
  18. if you use <?php if(isset($_GET['name'])) ?> instead of <?php if($_GET['name']) ?> it will get rid of those warnings
  19. I think this should do it <?php function getValues() { $param=array(); $param["ban"] = "table1"; $param["cpu"] = "table2"; $param["mem"] = "table3"; $data = array(); foreach($param as $key=>$value) { $sql=mysql_query("select time,".$key." from ".$value); while($row=mysql_fetch_assoc($sql)) { $data[$key][] = $row['time']."|".$row[$key]; } } return $data; } ?>
  20. Should be one of the links in the top left "Unresolved issues"
  21. You will find several examples here http://us2.php.net/features.file-upload
  22. You need a double = <?php // Top Two $package = $_POST['package']; $time_frame = $_POST['time_frame']; // Details $company = $_POST['company']; $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $address = $_POST['address']; $city_state_zip = $_POST['city_state_zip']; $purchase_order = $_POST['purchase_order']; // Site Details $site_details = $_POST['site_details']; $i_have = $_POST['i_have']; $sites_you_like = $_POST['sites_you_like']; // If Submitted if (isset($_POST['submit'])) { // Required $required = array ($package, $time_frame, $name, $email, $phone, $address, $city_state_zip); // Validate for ($i = 0; $i < count($required); $i++) { if ($required[$i] == '') { echo 'error' . $required ; } } } else {echo 'good';} ?>/code]
  23. The reason you haven't found anything on google is because this consists of several concepts. I think I would have an effdate and termdate for each news article entry in the database so you can "select column, column from table where effdate <= now() and termdate > now()"
  24. You're looping a <br /> between your <tr> and </tr>. Since this is an invalid format, different browsers will display it differently, some may ignore it while others will stick it at the top of the table.
×
×
  • 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.