Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. eRott, you will still need to Initialize the session first
  2. try <?php session_start(); $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); ?>
  3. LOL change if(!empty($_SESSION['counter']) || $_SESSION['counter']==100) to if(!empty($_SESSION['counter']) && $_SESSION['counter']<100) to make it start over, the build up was just for showing that i don't test my code
  4. Okay this was my first post in this topic So far i know this and from the start you said and this is from your own code // get thumbnail $cmd = 'ffmpeg -v 0 -y -i '.$FileName.' -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 '.$FileName_JPG; $res = shell_exec($cmd); // $res is the output of the command So // $res is the output of the command Now I know if you make a call to a problem and that program isn't found you get an error, this error is found in the server logs and in the output of the command.. however these are the two things you have yet to tell me! With all that in-mind i am going to guess and say you need to add the path to ffmpeg and mencoder into the code.
  5. Try this okay the session stuff isn't needed but was fun for an example, just put this code into a single file and run it, if its what you want then play with it, if not delete it <?php session_start(); if(!empty($_SESSION['counter']) || $_SESSION['counter']==100) { $_SESSION['counter']++; }else{ $_SESSION['counter']=1; } $barwidth = 300; $done = $_SESSION['counter']; $donewidth = ($barwidth/100)*$done; ?> <!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=utf-8" /> <meta http-equiv="REFRESH" content="2"> </HEAD> <title>ProcessBar</title> <style type="text/css"> <!-- .processbox{ width: <?php echo $barwidth;?>px; background-color:#FFF; border:thin #000; border-style:solid; height: 10px; } .bar{ background-color:#0C0; height: 10px; width: <?php echo $donewidth;?>px; } --> </style> </head> <body> <div class="processbox"> <div class="bar"></div> </div> <br> <?php echo $done;?> % done </body> </html>
  6. #1 Welcome to PHP Freaks #2 this post is in the wrong section, this should be in PHP Installation & Configuration However, the problem at a guess is Microsoft well okay more Vista, try moving your webroot from c:\Program Files\Apache Software Foundation\Apache2.2\htdocs to somewhere outside program files also put PHP on the top level as well the User Account Control (UAC) are a pain but i'm not sure if they will affect PHP or apache, infact after a quick check, i found this Setting up Apache, PHP, MySQL under Vista it sounds like the solution for you
  7. This solution may suite you jodconverter But if you want PHP then you could use Open Office COM support, I played with this for about an hour (during my lunch break) and it/I failed, I will probably need to revisit this at some stage. however your need Open Office installed on the Server, If you want a pure PHP ODT to PDF then you could but its it may take a while to write the parse.
  8. okay i have created some simple sample code, for the menu, but used an array instead of an SQL Database <?php //Database start $MENU = array("Lunch","Dinner","Beverage"); $SubMenu = array( "Lunch" => array("Appetizers","Soups and Salads","Pizzas"), "Dinner" => array("Appetizers","Soups and Salads","Pizzas","Classic Recipes","Beef & Pork"), "Beverage" => array("Wines","Specialty Drinks","Beer","Other Beverages"), ); //Database end //ShowMenu echo "<UL>"; foreach($MENU as $m) { echo "<LI><a href=\"?menu=$m\">$m</a></LI>\n"; if(!empty($_GET['menu']) && $m == $_GET['menu']) { echo "<UL>"; foreach($SubMenu[$m] as $s) { echo "<LI>$s</LI>\n"; } echo "</UL>"; } } echo "</UL>"; ?> Heres a untested guess work at the SQL version, 9 used the above one as a base script <?php //ShowMenu echo "<UL>"; $result = mysql_query("SELECT id,Subject FROM menusubjects"); while($MENU = mysql_fetch_assoc($result)) { $m = $MENU['Subject']; $id = $MENU['id']; echo "<LI><a href=\"?menu=$id\">$m</a></LI>\n"; if(!empty($_GET['menu']) && $id == $_GET['menu']) { echo "<UL>"; $result2 = mysql_query("SELECT shoename FROM regularmenu WHERE menusubject_id=$id"); while($SubMenu = mysql_fetch_assoc($result2)) { $s = $SubMenu['shoename']; echo "<LI>$s</LI>\n"; } echo "</UL>"; } } echo "</UL>"; ?>
  9. When i say about the time i refer to the time it takes to download IE if it takes you 15 seconds to download 2MB and 30Seconds to download 4MB but fails at to download anything larger it maybe timing out after 30seconds and not files over 4MB do you have this online at all ? also check the server logs
  10. okay so no it hasn't worked before.. Have you checked the logs and echoed the $res ? EDIT: also is this on your own PC or a shared server?
  11. I'm sorry i don't get what your asking (it could also be me as its 4am here) am i correct in saying you want an image above some text and X number of columns if so your need to put only the second table in the loop. <?php $sql = "SELECT menusubjects.Subject, menusubjects.image FROM menusubjects"; $result = mysql_query($sql, $connection); if(!$result){ die("Database query failed:" . mysql_error());} echo "<table width=\"260\" height=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#FF0033\" bgcolor=\"#FFFFFF\" style=\"float:left; position:relative; left:206px; top: 300px; height:5px;\"> <td width=\"95%\ height=\"10%\">"; while ($content = mysql_fetch_array($result)) { echo "<table width=\"96%\" height=\"10%\"> <td style=\"width:100%\"><img src=\"../images/lineforheader.gif\" alt=\"gf\" width=\"100%\" /></td><tr><td bordercolor=\"#666666\" bgcolor=\"#D83607\" height=\"100%\" style=\" width:140px;\"><a href=\"#\"> <div class=\"shoe2\" align=\"left\" style=\"background-image:url(../images/titleshoe.gif);\">" . $content['Subject'] . "</div> </a></td></tr> <tr> <td style=\"width:100%; background:#CC0000; height:2px;\"><a href=\"#\">" . $content['image'] . "</a></td> </tr></table></td>"; } echo "</table>"; ?>
  12. What are you asking ? how to format the menu or list it ? format = css list = SQL as this isn't the CSS section i'll assume you mean the SQL (not as if its the SQL section either) you could do this a few ways probably the easeist way is to do 2 queries, 1. SELECT * from MENU 2. SELECT * from subMenu WHERE menu=$menu then on your loop to create the Menu have an if statement to check if your at the submenu part ie (untested written on the fly) //$menuname = selected menu $SQL = "SELECT * from MENU" $menuq = mysql_query($SQL); while ($row = mysql_fetch_assc($menuq)) { echo $row['Name']; //menu item name if($row['Name'] == $menuname) { $sSQL = "SELECT * from SUBMENU WHERE MENU='$menuname' " $smenuq = mysql_query($sSQL); while ($srow = mysql_fetch_assc($smenuq )) { echo $srow['submenuname']; } } }
  13. #1 try echoing the $res from the shell_exec's to see what happening #2 Check the server logs Has this ever worked before ? so you have full access to the server ?
  14. 3 things to look at #1 check the files on the server #2 is $dl_size correct ? #3 is the the size 4,096 bytes. that fails or the time it takes to get to 4,096 bytes ? as this could well be a a timeout issue! try adding set_time_limit(0);
  15. Nice idea.. I didn't think of that,
  16. your need to use cURL, with cookies, try this untested function function cUrl_get_contents($url) { $ch = curl_init($url); curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); return curl_exec ($ch); } PS i am having a bad phping day so this will probably fail!
  17. could be some encoding, try opening the files in notepad and re-saving them!
  18. you need to use ucwords() ie ucwords(strtolower("joe bloggs")); convert to lower first or JOE BLOGGES will fail
  19. you may want to fetch the data ie $result = mysql_query($query); $row = mysql_fetch_attay($result); EDIT: Ahhhh KingPhilip beat me
  20. What the form called "myform" ? as i didn't see a name!! try changing var frmvalidator = new Validator("myform"); to var frmvalidator = new Validator("booking");
  21. Their are other ways but they get a little bit complex, the iframe will still work in a table take a look at this (it basically used javascript to put the iframe in place)
  22. Oh and the best option if to restore from backup, if you don't have a backup then HAHAHAHAHA.. i mean its your own fault Sorry thats my Evil side..
  23. Use notepad++ STEPS: 1) If possible, turn off FTP and Web Services 2) In Notepad++, use Ctrl-Shift-F to open the Find in Files dialog. 3) Enter the path to your web site root in the “Look in” box. Uncheck the ‘Match whole word’ box. Check the ‘Use’ box and select ‘Wildcards’. 4) In the ‘Look at these filetypes’ box, enter: *.php; *.js, *.html 5) Perform the following searches. This is a good chance to review the results before switch to to ‘Replace in Files’ mode and doing a ‘Replace All’. SEARCH #1:<script language=javascript><!–*\n*\n*<body> REPLACE WITH: <body> Run this search several times, until no results are found (some files may have multiple occurances, and it only removes them one at a time). SEARCH #2: <?php if(!function_exists('tmp_lkojfghx')*tmp_lkojfghx2(); ?> REPLACE WITH: nothing SEARCH #3: <?php eval(base64_decode(*c7')); ?> REPLACE WITh: nothing SEARCH #4: <!–*\n*(function(*.replace(*\n*–> REPLACE WITH: nothing 6) Once the searches are done, find any folders called ‘images’. They should each have an ‘images.php’ file, which should now be empty. Change permissions on these files so that no user can alter or modify them. 7) Change the passwords on any accounts used to access the server by http://FTP. It may also be a good idea to change other admin account passwords, just to be safe. Turn FTP and Web services back on, and then periodically use the searches above to see if the infection returns. EDIT: i got these step from another site.. which i just closed (i'll find the link if needed) i have tweaked it a bit as it had some parse problem and they said use VS but thats money notepad++ is free
  24. Just create a form then view that from the iframe.
×
×
  • 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.