Jump to content

mraza

Members
  • Posts

    329
  • Joined

  • Last visited

    Never

Everything posted by mraza

  1. hi i need to get value after Multiplication in a loop as total, plz how can i do that here is my code while ($row = mysql_fetch_array($name)) {?> <td><?php echo $row['service']; ?></td> <td><?php echo $result['qty'] ; ?></td> <td><?php echo $total = ($result['qty'] * $row['price']); ?></td> <?php } ?> i need to get $total of sum after loop, currently it shows only individual.. thanks for any help.. Regards
  2. Thank you very much sir for your help. its solved
  3. hi i am in situation to display input box along with select option , here is my code <?php $run= $dbc->db("SELECT * FROM `table` WHERE `id`='$id'"); ?> <select name="service"> <?php while ($result = mysql_fetch_array($run)) { ?> <option value="<?php echo $result['id'] ; ?>"><?php echo $result['service'] ; ?></option> <?php // This is problem i need to get this as hidden field but it breaks my select options. ?> <input type="hidden" value="<?php echo $result['data'] ; ?>" name="data" /> <?php } ?> </select> so here i am stuck <input type="hidden" value="<?php echo $result['id'] ; ?>" name="data" /> when i repeat in while loop it breaks options box and display other options without in select box. any help please thanks
  4. hi i am working on a php form where i need to get user signature and store in a db or as file, here is a link to an applet with perl but i am not sure about it. i need something like this http://www.lawrencegoetz.com/programs/signature/ Please can anyone tell if there is something related for php. thanks for any suggestion.
  5. hi i need a little help with javascript, I have one drop downl list which is populating from mysql <script type="text/javascript"> function show() { // dont know what to put here :-\ } <script> <select name="user" onchange="show()"> <option value="0">Select a user </option> <option value="1">First Name of one user </option> <option value="2">First Name of second user</option> <option value="3">First Name of third user</option> </select> <input type="text name="fname" value="" /> Now what i wants is when i change first option to second it will fill value="" of input box with that user second name which i need to run mysql query but i am not good with javascript so really appreciate for any help. Thanks
  6. Hi i am in a situation where i need to use two tables. please look at my code $result= $db->dbrun('select * from table_user'); while($row = mysql_fetch_array($result)): echo $row['username'] . '<br />'; endwhile; now my problem is i wants to get something from other table where user id match with $row['id'], $result= $db->dbrun('select * from table_user'); while($row = mysql_fetch_array($result)): $query= $db->dbrun('select id from table_other where user_id =$row['id']'); while($user_row = mysql_fetch_array($query)): echo $row['username'] . ' - ' . $user_row['id'] . '<br />'; endwhile; endwhile; so my main question is is it ok to run $query within a while loop because i cant run this query without $row['id'] which i gets after loop started or is there any other good way. Thanks for answering.
  7. Thank you Ken that looks perfect
  8. i dont know if i was good but i make it work with it, function FileExtension($filename) { $mp4 = "mp4"; $flv ="flv"; $avi = "avi"; $gp = "3gp"; $mpeg = "mpeg"; $flvcheck = $filename.".".$flv; $mp4check = $filename.".".$mp4; $avicheck = $filename.".".$avi; $gpcheck = $filename.".".$gp; $mpegcheck = $filename.".".$mpeg; echo $test; if (file_exists($flvcheck)) { $extension = $flv; } elseif (file_exists($mp4check)) { $extension = $mp4; } elseif (file_exists($avicheck)) { $extension = $avi; } elseif (file_exists($mpegcheck)) { $extension = $mpeg; } else { $extension = $flv; } echo $extension; } If there was some more fency way plz let me know Thx
  9. Hi i wants to know how can i get a file name extension in directory, for example file name is "thisfile" and there could be any of these thisfile.txt or thisfile.pdf or thisfile.doc in current directory , but there is only one file with that name in directory either with txt or pdf or doc extension, and i need to get that file name extension , please can someone help how can i know the extension of "thisfile" using php. thanks
  10. sorry it was php related question, nvm i figured it out here solution preg_match("/(?s)img\.src = '(.*?)';/", $html, $m1); Thanks
  11. Hi i wants to extract a link from a script line i wants to get this line img.src = 'http:\/\/this link i wants to extract'; from below code, please can someone tell me how can i do that. <script> var yt = yt || {}; t.preload = {}; y.preload.start = function() { var img = new Image(); t.preload.videoConnection = img; img.onload = img.onerror = function () { delete t.preload.videoConnection; }; img.src = 'http:\/\/this link i wants to extract it alos contain $%&= type of words'; img = null; }; yt.preload.start(); </script> Thanks for support
  12. Thanks for qucik help but i get this error Fatal error: Call to undefined function http_parse_message() in /home/admin/mysite.com/test2.php on line 4 my code <?php error_reporting(E_ALL); ini_set("display_errors", 1); print_r(http_parse_message(http_get('http://www.site.com'))->headers); ?> i guess need to compile something , is not there any other way that does not include any server configuration? Thanks
  13. Hi i wants to know how i can get headers to display on page, for example if i visit to www.thissite.com i see in headers with livehttpheaders it is also showing some more URL's and keep refreshing even i am on that page like www.pic.thissite.com video.thissite.com css.thissite.com So i wants to extract that URL's from headers with curl. Please any support. Thanks
  14. you can add one date column in your replies table, and sort them by date
  15. sorry but i am not clear what you are trying to say, last script i assumed you have one file named "textfile.txt" within same location you are running this script , you wants to read that file and find some words and replace them, if so that should work, other then not clear to me
  16. you can use global server variable $_SERVER['document_root'] and then add your file location i guess.
  17. <?php $file = 'textfile.txt'; if (file_exists($file)) { $ff = fopen($file, 'r+'); $contents = file_get_contents($file, FILE_TEXT); $change= array("My name is", "Hi", "Come back"); $replace = array("is name my","Hello","I coming"); $new_contents = str_replace($change, $replace, $contents); file_put_contents($file, $new_contents, FILE_TEXT); fclose($ff); $ff = fopen($file, 'r+'); fwrite($ff, $new_contents); fclose($ff); } else { echo "The file $filename does not exist"; } ?> something like this?
  18. <?php $values = 8; for($i = 1; $i <= $values; $i++) { echo $i . ':'; if($i == 1) { echo $i * 0; } else { echo ($i * 50) - 50; } echo '<br />'; } ?>
  19. not clear, can you show your image code? if you are looking for image width then why not try to set in img tag? like <img src="" width="" height="" />
  20. <?php $value = 8; for($i = 1; $i <= $values; $i++) { echo $i . ':'; echo $i * 50; echo '<br />'; } ?> hope this what u wants
  21. Thanks for help here i find one more http://www.phptutorial.info/iptocountry/the_script.html cheers
  22. hi ! i wants to make a script which would be country based, lets say if visitor ip on my site is from UK he will see echo "you are coming from UK !"; if visitor is from US he will see echo "you are coming from US !"; if he is from other country they will see that message i will write for them, so is there any open source available? or any idea how can i complete this task, Thanks for help
  23. hi i am trying to run a script with zend code nut not working, in my phpinfo(); it display ; This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright © 1998-2008 Zend Technologies with the ionCube PHP Loader v3.1.31, Copyright © 2002-2007, by ionCube Ltd., and with Zend Extension Manager v1.2.0, Copyright © 2003-2007, by Zend Technologies with Zend Optimizer v3.2.8, Copyright © 1998-2007, by Zend Technologies and Zend Optimizer Optimization Pass 1 enabled Optimization Pass 2 enabled Optimization Pass 3 enabled Optimization Pass 4 enabled Optimization Pass 9 enabled Zend Loader enabled License Path no value Obfuscation level 3 i am using PHP Version 5.2.11 ,when i do the test it shows me zend optimizer is not installed, i am using centos 5 wtih kloxo /apache. , i also found this tutorial and there are some files i tried but not working http://en.ispdoc.com/index.php/Installing_Zend_Optimizer thanks for any help
  24. ok thx for help all is done i need to fix css
×
×
  • 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.