Jump to content

BillyBoB

Members
  • Posts

    630
  • Joined

  • Last visited

    Never

Everything posted by BillyBoB

  1. Ok then I would advise doing a loop. <? $datestamp = date("m-d-Y-h-i-s"); // Current date and time to put on filename of backup file in format of MM-DD-YYYY--hour-minute-second $optimize = "mysqlcheck -u root -pPASSWORD --auto-repair --check --optimize --all-databases"; $optimizeresult = passthru($optimize); //Make sure it's completely optimized. $optimizeresult2 = passthru($optimize); $i = 0; while($i<3) { $command[$i] = "mysqldump -u root -pPASSWORD database".$i=0?:$i+1." > /FULL_PATH/back-ups/database".$i=0?:$i+1."-$datestamp.sql"; $result[$i] = passthru($command[$i]); $i++; } ?> I didn't test it but it should be close.
  2. I found your answer pretty easily with google... http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_databases <? $datestamp = date("m-d-Y-h-i-s"); // Current date and time to put on filename of backup file in format of MM-DD-YYYY--hour-minute-second $optimize = "mysqlcheck -u root -pPASSWORD --auto-repair --check --optimize --all-databases"; $optimizeresult = passthru($optimize); //Make sure it's completely optimized. $optimizeresult2 = passthru($optimize); $command = "mysqldump -u root -pPASSWORD --databases database database2 database3 > /FULL_PATH/back-ups/databases-$datestamp.sql"; $result2 = passthru($command); ?> That should help
  3. I need to see more of the code.. where is $image_id set?
  4. I figured it out after posting the second post. I just needed to add ./ in the directory. Thanks for the help.
  5. The fix didn't work. It still throws the same error. Warning: move_uploaded_file(/resources/familyties/0604_betty_paige_ebay.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/cplpaso0/berrysch/public_html/Members on line 111 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php2WoBpR' to '/resources/familyties/0604_betty_paige_ebay.jpg' in /home/cplpaso0/berrysch/public_html/Members on line 111
  6. I am working on building a site that needs to upload a pdf to their site weekly. The file is not uploading correctly, could you help me out and see if there are any errors. I have already set /resources/ and /resources/familyties/ to 777... Error Messages: Warning: move_uploaded_file(/resources/familyties/01_08_2010.pdf) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/cplpaso0/berrysch/public_html/Members on line 111 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpJe0INn' to '/resources/familyties/01_08_2010.pdf' in /home/cplpaso0/berrysch/public_html/Members on line 111 Code: $uploadfile = '/resources/familyties/'.substr($_POST['date'], 0, 2).'_'.substr($_POST['date'], 3, 2).'_'.substr($_POST['date'], 6, 4).'.pdf'; $_POST['date']=substr($_POST['date'], 6, 4).'-'.substr($_POST['date'], 3, 2).'-'.substr($_POST['date'], 0, 2); if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { if($sql = mysql_query("INSERT INTO `dyn_familyties` (`date`, `link`) VALUES('$_POST[date]', '')")) { echo(" <div> $_POST[date] was added to the family ties list. <a href=\"/~berrysch/Members/FamilyTies\">Go back</a> </div> "); }else{ echo(" <form method=\"post\" enctype=\"multipart/form-data\"> <div style=\"text-align: center;\">There was an error adding $_POST[date] to the database!</div> <div> <div style=\"float: left; width: 102px;\"><input type=\"text\" name=\"date\" class=\"inputOpt\" style=\"width: 88px;\" value=\"MM/DD/YYYY\" /></div> <div style=\"float: left;\"><input type=\"file\" name=\"file\" class=\"inputOpt\"/></div> <div style=\"float: right;\"><input type=\"submit\" name=\"ft_submit\" class=\"inputSub\" value=\"Submit\" /></div> <div style=\"clear: both; font: normal 0px Arial;\"> </div> </div> </form> "); } }else{ print_r($_FILES); echo(" <form method=\"post\" enctype=\"multipart/form-data\"> <div style=\"text-align: center;\">There was an error uploading ".$_FILES['file']['name']." to the server!</div> <div> <div style=\"float: left; width: 102px;\"><input type=\"text\" name=\"date\" class=\"inputOpt\" style=\"width: 88px;\" value=\"MM/DD/YYYY\" /></div> <div style=\"float: left;\"><input type=\"file\" name=\"file\" class=\"inputOpt\"/></div> <div style=\"float: right;\"><input type=\"submit\" name=\"ft_submit\" class=\"inputSub\" value=\"Submit\" /></div> <div style=\"clear: both; font: normal 0px Arial;\"> </div> </div> </form> "); }
  7. Is sidebar-left an id or a class name?
  8. have you tried displaying the text with the html code inside a <xmp> wrapper? For example, <xmp>I am writing html code inside a html form... <font color="red">Red?</xmp>
  9. With just a simple addition of a query string we can adjust them as we want to test. I also fixed the <0 issue. <?php function calibrateDamage($attack, $defence) { $atkDifference = $attack-$defence; if($atkDifference>0) $atkDifference = ($atkDifference/7)*2; elseif($atkDifference==0) $atkDifference = ($attack*-.25); elseif($atkDifference<0) $atkDifference = ($atkDifference/3)*2; echo $atkDifference.' - '; return (($attack+$atkDifference)<0)?0:$attack+$atkDifference; } echo calibrateDamage($_GET['atk'], $_GET['def']); ?>
  10. <?php function calibrateDamage($attack, $defence) { $atkDifference = $attack-$defence; if($atkDifference>0) $atkDifference = ($atkDifference/7)*2; elseif($atkDifference==0) $atkDifference = ($attack*-.25); elseif($atkDifference<0) $atkDifference = ($atkDifference/3)*2; echo $atkDifference.' - '; return $attack+$atkDifference; } echo calibrateDamage(1000, 1000); echo("<br/>"); echo calibrateDamage(1500, 1000); ?> That's as close as I can get it for you. You can adjust the figures as needed, its pretty simple.
  11. I found http://www.go4expert.com/forums/showthread.php?t=2262, it has an interesting one line way of doing it. <script> var url_match = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?/; alert(url_match.test("http://www.go4expert.com/forums/showthread.php?t=2262")); </script>
  12. Is $id set somewhere or is it in a session?
  13. Why do you have a div within a table? Tables are for tabular data not templates, consider making your sites with divs instead. Also the valign attribute is deprecated, if you insist on trying to use vertical align use the css style. style=\"vertical-align: middle;\"
  14. What does that output exactly for the trash div? Does it include any line-breaks?
  15. I don't see where the 'remove' is being placed in the html. Could you explain how it gets added? Is it an image, script, or part of the html not currently visible?
  16. Dorky: why exactly not use a padding on the left and right?
  17. @haku: The width isn't being set because it is supposed to inherit the width from the length of the text plus the padding. @jcombs_31: I'm not sure, kind of a tradition thing for me. I know of the list way I just choose to do it with divs. @nadeemshafi9: I have to develop for ie6 because my demographic is people that go to church, young people and old people. The older people may or may not have their systems upgraded with the latest browser. The client has requested the code work for ie6.
  18. The html wouldn't help much to determine the problem because the javascript changes the classes a lot. But here it is anyways: <div id="navigation"> <div class="nav-btn nav-left" id="navHome">Home Page</div><div class="nav-sep">|</div><div class="nav-btn nav-dropdown" id="navAbout">About Us</div><div class="nav-btn nav-cur nav-dropdown" id="navMembers">Members</div><div class="nav-btn nav-dropdown" id="navEducation">Education</div><div class="nav-sep">|</div><div class="nav-btn nav-dropdown" id="navYouth">Youth</div><div class="nav-sep">|</div><div class="nav-btn nav-right nav-dropdown" id="navPreschool">Preschool</div> </div>
  19. I haven't read much else but I'm pretty sure its 'javascript:' not 'java script:' <a href="javascript:newWindow('../sendemail.php?'+document.location.href,'email',400,350,'')">Tell a Friend</a> Not: <a href="javascript:newWindow('../sendemail.php?'+document.location.href,'email',400,350,'')">Tell a Friend</a>
  20. You should check this site out: http://slayeroffice.com/articles/innerHTML_alternatives/ I simply love that page. It explains so much and will help with not using innerHTML because it isn't supported by many browsers.
  21. not the stylesheet your code... the html.
  22. I'm working on a site for a church down the road from my school. We have created the design and I have finished coding the nav drop down menu. The problem I am experiencing is that the drop down menu(dd-menu) expands to the far right side of the design when it is supposed to adhere the width of the largest dd-item. Example of working menu: (firefox) Example of not working menu:(ie 6) The stylesheet for the nav is: #navigation { color: #ffffff; text-transform: uppercase; margin: 0px auto; width: 927px; height: 34px; clear: both; } .nav-btn { font: normal 0.75em/34px Arial; padding: 0px 30px; height: 34px; background: #cd6b2b; float: left; } .nav-btn:hover { font: normal 0.75em/34px Arial; padding: 0px 30px; height: 34px; background: #a2460a; color: #ffa56a; float: left; font-weight: normal; } .nav-sep { font: normal 16px/34px Arial; height: 34px; width: 2px; max-width: 2px; overflow: hidden; background: #cd6b2b; color: #a2460a; float: left; } .nav-left { background: #cd6b2b url('../images/nav/corner_tl_au.png') no-repeat top left; } .nav-left:hover { background: #a2460a url('../images/nav/corner_tl_au_hover.png') no-repeat top left; color: #ffa56a; font-weight: normal; } .nav-left-hover { background: #a2460a url('../images/nav/corner_tl_au_hover.png') no-repeat top left; color: #ffa56a; font-weight: normal; } .nav-right { background: #cd6b2b url('../images/nav/corner_tr_au.png') no-repeat top right; } .nav-right:hover { background: #a2460a url('../images/nav/corner_tr_au_hover.png') no-repeat top right; color: #ffa56a; font-weight: normal; } .nav-right-hover { background: #a2460a url('../images/nav/corner_tr_au_hover.png') no-repeat top right; color: #ffa56a; font-weight: normal; } .nav-cur { font: bold 12px/34px Arial; color: #463a1f; background: #ffffff; } .nav-cur-left { font: bold 12px/34px Arial; color: #463a1f; background: #ffffff url('../images/nav/corner_tl_au_cur.png') no-repeat top left; } .nav-cur-left:hover { font: normal 12px/34px Arial; color: #ffa56a; background: #a2460a url('../images/nav/corner_tl_au_hover.png') no-repeat top left; } .nav-cur-right { font: bold 12px/34px Arial; color: #463a1f; background: #ffffff url('../images/nav/corner_tr_au_cur.png') no-repeat top right; } .nav-hover-right { font: normal 12px/34px Arial; color: #ffffff; background: #a2460a url('../images/nav/corner_tr_au_hover.png') no-repeat top right; } .nav-hover { color: #ffa56a; background: #a2460a; } .nav-ddhover { color: #ffffff; background: #a2460a; } .dd-menu { background: #a2460a; float: left; } .dd-item a:visited { color: #ffffff; text-decoration: none; font: normal 12px/34px Arial; background: #a2460a; } .dd-item a:link { color: #ffffff; text-decoration: none; font: normal 12px/34px Arial; background: #a2460a; } .dd-item a:hover { color: #ffa56a; text-decoration: underline; font: normal 12px/34px Arial; background: #a2460a; } .dd-item { text-align: left; font: normal 12px/34px Arial; color: #ffffff; padding: 0px 30px; height: 34px; background: #a2460a; white-space: nowrap; min-width: 75px; } The html is built by javascript... if you need, I will post. The link is: http://dreamshowstudios.net/development/BerrysChapel/index.php I tend to over-complicate some things, but any guidance is appreciated.
  23. there are really so many reasons why I shouldn't even reply to your post but its because you have the object src set to: Sugerlandcheesecake.swf when you need it set to: images/Sugerlandcheesecake.swf you might need to research relative and absolute paths
  24. What about HTTP_REFERER just call upon the $_SERVER['HTTP_REFERER'] variable and it would tell you where they just were at. http://us2.php.net/manual/en/reserved.variables.server.php
×
×
  • 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.