Jump to content

pyrodude

Members
  • Posts

    97
  • Joined

  • Last visited

    Never

Everything posted by pyrodude

  1. pyrodude

    PHP

    Similar to corbin, I solved #1 by solving for 1 of the variables, except I did it by adding the equations (since the y's cancel eachother out) x + y = 3 x - y = 4 --------- 2x = 7 --------- x = 3.5 then plug the 3.5 in for x and voila. It shaved a little time off for me (and/or a little paper if you were writing it out) but it would only work if one of the variables cancelled out.
  2. If you don't have access to cron jobs, however, you could store the values you retrieve in a database then compare the current time with the last time it was retrieved and see if you need to go get the up-to-date info. You'll still be stuck with the slow load time, however. Another option would be to use an iframe to load a separate php file (possible through AJAX) that does nothing but pull the information and display it. That way your page will load quickly and just the stock price will take a minute to display.
  3. Yeah, I think we need some clarification. Do you want the batch file to be run on the server, or do you want the batch file run on the client's computer?
  4. <sarcasm>Wow, I really got lots of help here</sarcasm> I did, however, find the solution to my problem. The website is called Habitually Good and is at http://blog.gadodia.net/php-5-on-iis-6-giving-404-error-and-how-to-fix-it/ The solution worked great for me, despite the wonderful suggestions I received here...
  5. I have a brand new Windows Server 2003 Small Business with IIS 6.0 installed. I got php installed, with all the appropriate Extensions showing up as Allowed in the IIS manager. I can run PHP code from the command line, but I get 404 Page Not Found errors when I try to access them via the server. The files are there, and regular HTML executes just fine. I have absolutely ZERO experience working with IIS, and would appreciate any help! Thanks, Billy
  6. Yeah, that...Lol. That's what I get for not checking the links before I post them...
  7. You realize that that would always be true, don't you? Just making sure. Anyway, I removed the preceding 0 from "08" and it seems to run fine again. Still not sure why it will work that way during the week just not on Saturdays. Ahh well, who am I to judge?
  8. As was said by jesirose, ajax is a great option, assuming the browser supports it. Another option, if a redirect to vote.php is possible, you can use javascript to check and see that the referrer is run.php. This isn't foolproof, however, as some browsers block that information or allow it to be spoofed. Please also try to have an option available for those surfers who do not have javascript enabled.
  9. Right. I'm using H because I want to compare it in a 24-hour timeline (Figured that would be easier for determining the difference between, say, 5am and 5pm) Are you suggesting I use h instead?
  10. Or, you could use the php wraptext() function if you're creating the pdf file dynamically. Learn more: http://www.w3schools.com/php/func_string_wordwrap.asp
  11. Sorry, apparently I was a day too late. Your previous post was very close. Yes, you can use <?php ?> tags anywhere. However, you either need to use <?=$var; ?> or <?php echo $var; ?> in order to output the contents of a variable to the current page.
  12. I personally find the FPDF class (http://www.fpdf.com/) to be much more user friendly then PDFLib. That's just me though. The class is about 40k, plus font files. Not sure the size of PDFLib, but it's certainly a lot easier to create a file using FPDF.
  13. A client of mine requested something for their page that lists their current business hours and whether the store is currently open or not. I thought I had this worked out fine until I was up late working on another aspect of the page and noticed it listing the store as open when it should not be. The code is as follows: <?php $currTime = date("g:i a"); $currDate = date("F jS, Y"); $currHour = date("H"); $currDay = date("l"); $currDayNum = date("d"); $currMonthNum = date("m"); $currStoreState = "<span style=\"color:red\"><strong>CLOSED</strong></span>"; $holCurrDay = "$currMonthNum $currDayNum"; // Holidays are: christmas day, new years day, thanksgiving day, labor day, memorial day, 4th of july, etc -- Still need to set up the math for memorial day, thanksgiving and labor day $holidays = Array( "Christmas" => "12 25", "NewYear" => "01 01", "July4th" => "07 04" ); foreach ($holidays as $value) { if ($holCurrDay == $value) { $isHoliday = true; } } if ($isHoliday == false) { if ($currDay != "Sunday") { // Closed Sundays, so exclude that if ($currDay == "Saturday") { if (($currHour > 08) && ($currHour < 17)) { // Saturday hours are 9am-5pm $currStoreState = "<span style=\"color:green\"><strong>OPEN</strong></span>"; } } elseif (($currHour > 07) && ($currHour <19)) { // All other days the store is open 8am-7pm $currStoreState = "<span style=\"color:green\"><strong>OPEN</strong></span>"; } } } echo "Today is $currDay, $currDate at $currTime<br /><br />We are currently: $currStoreState"; ?> The check lists the store as being open starting at 1:00am on Saturdays (however it closes at 5:00 like it should...) What I don't understand is that the code directly below it works just fine, and it's set up exactly the same. If someone can see my logic error somewhere in there, please let me know! Thanks Billy
  14. In order to create the div at the beginning of the main div and then move it part-way down the page, doesn't it need to be position: relative? I don't know of any other way (except maybe javascript...and even then I'm not sure!) to move its location. Please enlighten me! I misspoke in saying I was moving it to the right and down. What I meant to say was that the float: right was moving the div to the right and the top: 100px was moving it down. Sorry for the confusion. As for the way it affects the text around it, is there any way around that? Here's what I'm trying to prevent: The issue seems to revolve around the use of position: relative, as it takes it out of the regular flow of the page. So, I guess this is more of a positioning issue. Is there a way to position a div manually via CSS, JavaScript, or some other miracle worker? Thanks...
  15. pyrodude

    floating div

    What I'm planning to do is insert a div at the beginning of another div (an AJAX div inside a main content div) and position it relatively. Here's an example of what I have: <div id='mainContent'><div id='rightDiv'>This is a right-float div<br /><br /><br />blah!</div> <b>This is a big main content div <br /><br /> <br /> <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. </div> and the CSS is: #rightDiv { position: relative; float: right; top: 100px; width: 100px; } What I'd like to do is find a way to have text wrap around the div (therefore not get placed on top of or behind it - i think this excludes using position: absolute) I've been using relative positioning to move the div to the right and down 100px, but it winds up affecting the first few lines (the mainContent div text is centered, and this div scoots the top 3 or 4 lines to the left a little bit. I can't seem to figure it out, can anyone else?
  16. The only reason the CSS is in that document is to make testing in the development stage a little simpler. When I have the styles the way I want them, I'll move them into a separate style sheet, don't worry.
  17. So, I have this site in the infant stages, and I'm trying to get it to display nicely in a variety of browsers. So far I have tested it in Firefox, IE6 and IE7. Firefox is perfect, IE6 is manageable, and IE7 is quirky. I'm using JavaScript to differentiate between browsers, and the code for the div won't seem to get the height to set correctly. This is probably a question for the Javascript forum, but maybe someone will see my supid mistake while they're checking out my other issue. Since CSS Position: fixed doesn't work in IE6, I want the div to fill the entire contents of the cell it's in. In IE6, however, the DIV basically centers itself on the right border of the cell that is supposed to contain it. It has its width and height set correctly and it scrolls with the page, but it's too far to the right and actually covers some of the content page. The source code is as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body,td,th { color: #000000; } body { background-color: #0066CC; font: 12px Arial, Helvetica, sans-serif; background-image:url(bg.gif); background-repeat:repeat; overflow: auto; } div { background-color:#FFFFFF; padding:5px; border:2px solid #000000; overflow: auto; } a { font-weight: bold; font-size: 12px; font-family: arial; text-decoration: none; } a:visited { color: #0099ff; } a:link, a:active { color: #0000ff; } a:hover { font-size: 14px; color: #8080ff; } h4 { color:#333333; font-weight:bold; } #leftnav { position: fixed; } --> </style> <script type="text/javascript"> function setDivDim() { if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 document.getElementById('leftnav').style.width = "18%"; document.getElementById('leftnav').style.height = "57%"; } else { // IE6, older browsers document.getElementById('leftnav').style.width = "90%"; document.getElementById('leftnav').style.height = "100%"; } } </script> </head> <body onload="setDivDim();"> <table width="100%" border="0" align="center"> <tr> <td width="5%"> </td> <td colspan="2" align="center"><div><img src="logo.gif" alt="logo" width="589" height="89" /> <h3>Your neighborhood pharmacy!</h3></div></td> <td width="5%"> </td> </tr> <tr> <td width="5%"> </td> <td width="20%" height="100%" align="center" nowrap="nowrap" valign="top"><div id="leftnav"><h4>Site navigation:</h4> - <a href="#">link 1</a> -<br /> - <a href="#">link 2</a> -<br /> </div></td> <td align="center"><div> <b>This is a big main content div <br /><br /> <br /> <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <p>Part way down</p> <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. <br />. </div></td> <td width="5%"> </td> </tr> <tr> <td width="5%"> </td> <td colspan="2"><div><table width="100%"><tr><td align="left"><Insert<br />address<br />info ></td><td align="right"><Insert<br />other<br />info></td></tr></table></div></td> <td width="5%"> </td> </tr> </table> </body> </html> Hope someone has some ideas!
  18. I find loops to be the best method, that way each person who receives the email only sees themselves as a recipient
  19. If you're done with this thread, be sure to mark it as solved
  20. You could try using strtr() to "translate" the %20 into -
  21. The only variable you're defining as global is $hd, not $hdn or $hdinfo. Make them global and your problem should disappear.
  22. So, the issue seems to revolve around unsetting $_SESSION['editline']. I don't use it for anything but to get the userid that is being edited, so I changed it to unset when the mysql has been completed and then redirect, and that's when it hangs. If I leave it set (such as when attempting to change the passwords and there's a mismatch) it reloads just fine with the error message, but if I unset($_SESSION['editline']);, it winds up just hanging there, regardless of what page I try to redirect to. Anyone have any ideas?
  23. So explode the file based on the \n character, and then explode array1[1] based on the | character. You'll have the thread topic in array1[0] and the thread body in array2[]
  24. Unless you're saving that information to a variable within a function, the scope of the variable will be every page that is called with include(). The issue is that the information is probably being called in some GetRandomPic() function. Try declaring them as global variables.
  25. So, I changed the code so that it redirects to a nonexistant page and all it's doing is just sitting there. I don't get a page not found error or anything. Could something be wrong with my headers? It seems to work fine on all my other pages, just not this one for some reason...
×
×
  • 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.