![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
blueman378
Members-
Posts
888 -
Joined
-
Last visited
Never
Everything posted by blueman378
-
Inviting website critique on my latest project
blueman378 replied to gabs's topic in Website Critique
I fully agree about the footer, that turns me right off the design. -
This topic will get moved to third party scripts i think?
-
Run while you still can premiso...
-
<?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!
-
Need Php code to display the probability for the given number
blueman378 replied to rishibala143's topic in PHP Coding Help
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. -
Please help with a PHP/Javascript Countdown timer
blueman378 replied to jeremyhowell's topic in PHP Coding Help
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. -
Please help with a PHP/Javascript Countdown timer
blueman378 replied to jeremyhowell's topic in PHP Coding Help
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. -
Creating a 'comment' section and Generating Thumbnail from SWF?
blueman378 replied to corrupshun's topic in PHP Coding Help
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 -
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/
-
Please help with a PHP/Javascript Countdown timer
blueman378 replied to jeremyhowell's topic in PHP Coding Help
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 -
New to mysqli library - Multiple query problem
blueman378 replied to johnnc's topic in PHP Coding Help
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); } ?> -
im refering to how you are repeating yourself where SOMETHING like \"%$trimmed%\" or SOMETHING like \"%$trimmed%\" do you need the or?
-
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.
-
sorry ignore my last post
-
your where c;ause is malformed, it needs to be where columnname=columnvalue
-
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
-
Dude your loop is fine, are you even reading the replies?
-
onclick="toggle_visibility('control');">' it is your ' ' around control that is killing it.
-
your not moving the query, your simply adding an extra clause
-
cause its the way we say it shit-ty well atleast in NZ we do
-
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.
-
All good, and yes a+ is the best for you, dont forget to mark the topic as solved
-
hmm gotta remember to do the "Quote from:THE PHP.NET MANUAL" more often
-
its your opening modifier, you are using $txtFile = fopen($txtFile, 'w'); notice the w? fopen() @php.net