Jump to content

blueman378

Members
  • Posts

    888
  • Joined

  • Last visited

    Never

Everything posted by blueman378

  1. I fully agree about the footer, that turns me right off the design.
  2. blueman378

    [Deleted]

    grr, wont let me post it. sorry guys.
  3. This topic will get moved to third party scripts i think?
  4. Run while you still can premiso...
  5. <?php $lname=$_POST["LastName"]; $fname=$_POST["FirstName"]; $add=$_POST["StreetAddress"]; $file=fopen("111.txt","a+") or exit("Unable to open file!"); /*while(!feof($file)) { echo fgets($file)."<br>"; }*/ fwrite.($file,$lname); /*was missing the f on this line */ fwrite($file,$fname); fwrite($file,$add); fclose($file); echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=teleform.html\">"; ?> Dunno if thats your only problem, but next time, put some effort into asking for help. I'm being nice cause your new, but Read the rules before you post!
  6. well where is your attempt at this? also do not post multiple topics for the same question [http://www.phpfreaks.com/forums/index.php/topic,279422.0.html] show us your attempt and we will help, this is not a freelance board.
  7. your not actually updating the database based off the users timer, you are only making it "appear" so. you are infact only updating the database when the pages are requested again. the javascript is just to make it look nice. the idea i first said will handle everything to do with the database and updating the energy.
  8. nice work on the countdown timer, now ajax isnt really needed for this, and in turn you could run into problems with it. this is because if you use ajax then every user that is on will be sending a request to add energy. what i mentioned above will work. all you need to do to your javascript is ensure that when it gets to 0.00 it resets to 5.00 and use javascript again to change the text inside the div, grab the number that is already there, and then add 5 to it. so your best bet <div id="energyinfo"> <p>you have <span id=energyamount">15</span> energy!</p> </div> now your javascript must function timeempty(){ var energyamount = document.getElementById ('energyamount).innerhtml; energyamount += 5; document.getElementById ('energyamount).innerhtml = energyamount; seconds=1000; } or something similar. what is happening on the client side is only visual, eg if i was to find out your javascript functions and call them through the browser window it will have no effect on the actual server.
  9. Yes it would use a database. have you done any searching at all? show us your attempt and we will help. ask for it to be done and we will point you to the freelance section. regards, Matthew Hailwood
  10. ah i see what you are doing now, the somethings would be replaced later by eg title and contents. fair enough. but as i said basically search things do not cater in general for searching guitars to try and find guitar, then simplest approach is to have a note to users informing them that searching for guitar will search for guitar, guitars, guitarist ect may i suggest this as a tutorial for you as you seem to want to build your search up. http://iamcal.com/publish/articles/php/search/
  11. the following is assuming you do not have access to a cron job system. the following is assuming you update every 5 minutes (30 0000 milliseconds). the following assumes you add 5 energy when you update. right, well the simplest way of doing it that i can see is to have one db field, pupdate -> this field holds the time of the previous update, a timestamp will do. while(currenttime - pupdate > 30 0000 ) pupdate += 30 0000 foreach(user) energy += 5 endforeach endwhile (because of the previous loop we know there will be less than 5 minutes before the next update) timeremaining = currenttime - pupdate / 100 this gives us the time remaining in seconds minutes = timeremaining / 60 seconds = timeremaining % 60 so now you have two variables you can feed into your javascript timer the minutes and seconds or if it only takes it in seconds simply removew the last two steps and give it timeremaining directly. the rest is javascript which im not exactly strong in, so good luck. This algorithm has not been tested although i believe it should work
  12. please use tags! also, would you be able to identify which line is 103? <?php $starttime = date('h:i:s A'); $sqlid = 150000; $connect = mysqli_connect("localhost", "username", "password","database") or die ("The database is unavailable. Please try again later."); /* $connect1 = mysqli_connect("localhost", "username", "password","database") or die ("The database is unavailable. Please try again later."); $connect2 = mysqli_connect("localhost", "username", "password","database") or die ("The database is unavailable. Please try again later."); */ $query = "SELECT * from table where id > " . $sqlid; $results = mysqli_query($connect,$query) or die(mysqli_error($connect)); if (mysqli_num_rows($results) != 0) { //Set counter variable to see how many records were processed $i=0; //Start the loop of retrieving the leads to be rated while ($row = mysqli_fetch_array($results, MYSQL_ASSOC)) { //Get the Age Factor and set the variable $query1 = "CALL sp_get_rates(" . $row["sqft"] ."," . $row["zip"] . "," . $row["yearbuilt"] . ")"; $results1 = mysqli_query($connect,$query1); $row1 = mysqli_fetch_row($results1); extract($row1); $cov = $row1[0]; $premYes = $row1[1]; $premNo = $row1[2]; //Update record with new information $query2 = "update tableset fireprem = " . $premYes . ", nonfireprem = " . $premNo . ", covfactor = ". $cov . " where id = " . $row["id"]; $results2 = mysqli_query($connect,$query2); //increment counter variable $i++; //Free sql resources mysqli_free_result($results1); } //Determine how many records received a rate $query3 = "select count(*) as count from aptmailinglist where id > " . $sqlid . " and fireprem <> '0.00'"; $results3 = mysqli_query($connect,$query3); $row3 = mysqli_fetch_row($results3); extract($row3); $endtime = date('h:i:s A'); //Print on screen the number of records that were processed echo "There were " . $i . " records processed<br>"; echo "There were " . $row3[0] . " records rated<br>"; //echo $i - $row3[0] . " records did not receive a rate<br>"; echo "Start Time = " . $starttime . "<br>"; echo "End Time = " . $endtime . "<br>"; //Close connections mysqli_free_result($results); //mysqli_free_result($results3); mysqli_close($connect); //mysqli_close($connect1); //mysqli_close($connect2); } ?>
  13. im refering to how you are repeating yourself where SOMETHING like \"%$trimmed%\" or SOMETHING like \"%$trimmed%\" do you need the or?
  14. why do you need this part? or SOMETHING like \"%$trimmed%\" and yes you are correct, in general searches like this are built upon the logic that people will not search for plurals if they want the singular.
  15. your where c;ause is malformed, it needs to be where columnname=columnvalue
  16. it seems to be that you are going to try to make almost a database of plural form words, would it not be better to use like? eg in your query have LIKE 'crash%' that would return crash, crashed, crashing, crashn (for those who like to abbreviate) ect
  17. Dude your loop is fine, are you even reading the replies?
  18. onclick="toggle_visibility('control');">' it is your ' ' around control that is killing it.
  19. your not moving the query, your simply adding an extra clause
  20. cause its the way we say it shit-ty well atleast in NZ we do
  21. You do realise you basically did what they have done here? The "PHP manual is crappy" comment was simply an example relevant to you, and although it was obviously not said with the intent of being taken truthfully you still decided to defend against it. Daniel0 is correct, he came in at an offensive approach so they came back at a defensive approach, and the best defense is a good offense, and well, he just got owned.
  22. All good, and yes a+ is the best for you, dont forget to mark the topic as solved
  23. hmm gotta remember to do the "Quote from:THE PHP.NET MANUAL" more often
  24. its your opening modifier, you are using $txtFile = fopen($txtFile, 'w'); notice the w? fopen() @php.net
×
×
  • 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.