AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
You aren't outputting any divs in your loop, so how would you determine that your query is correct by the number of divs?
-
You are treating $query as an array, where it is a string What are you trying to do?
-
Need to know the class from where this line is coming from. $cart = Cart::CreateInstance();
-
so you want to take someone elses idea because you can't create any of your own?
-
What is you footer contained in?
-
you want the errors to be sent to the console log, however you do not want them to be sent to the user obviously, to do this you can turn display errors off, which will still send errors to the console for you to view but users will only see the error that you output. ini_set("display_errors","no");
-
what have you come up with so far? Edit: to point you in the right direction, you will most likely be using a self join here. http://www.thunderstone.com/site/texisman/joining_a_table_to_itself.html
-
then the "object" you are trying to call the method GetCart() on is not a valid object, can you post your code directly on this thread please.
-
couple of things here, first I will write the correct code and then I will explain. if (isset($_POST['submit'])) { $file = $_POST['filename']; $target= $_POST['hosttarget']; if(file_put_contents($file, file_get_contents($target)) !== false) { echo "Successfully uploaded {$file}!"; } else{ echo "Unable to retrieve file!"; } } your previous code only checked to see if $_POST['submit'] was set, but even if it is set, that does not mean that retrieving the filename was successful, therefore your conditional would always return true even if the file_put_contents() returned false. Also, you do not need quotes around $target or $file, since they are variables and already contain quotes.
-
it is a CSS declaration that makes sure that the CSS properties associated with the !important rule will always be applied, and will not be overwritten by conflicting CSS. for reading, http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
-
Sessions
-
Why wouldn't you want to pass the variables via query string? Alternatively, you can use sessions
-
i don't need an example, i know very well what you can do with this, as i said, you can manipulate the history, my guess is this is to create an annoying popup or something of the sorts, which i'm not at means to help with.
-
if you are talking about manipulating the browsers back button, it can't be done with JS. It can, but it's a bit of a hack and not very reliable. You can manipulate the history, not the functionality itself.
-
Why are you commenting on old threads?
-
variable = variable + number - script not working
AyKay47 replied to AnAmericanGunner's topic in PHP Coding Help
You really want to avoid including a file in a loop, very inefficient. The function might look something like this, well will say that the file that it is in is called func.php function findPoints($points) { // if {} else if {} conditionals go here return $points; //return points value } Then in your main page you will include func.php at the top, and in your while loop after the $place variable is defined you will add this line $points = findPoints($place); // will contain the return value of the function. Then output $points like I have already done in the previous post. -
here, var imgList = array( "imgs/test_1.png", "imgs/test_2.png", "imgs/test_3.png" ); you are treating the array syntax like PHP, its not, you will need to create an array object and store it in a variable. There are 2 ways to do this, I prefer, var imgList = ["imgs/test_1.png", "imgs/test_2.png", "imgs/test_3.png" ]; also, im not sure why you are checking the value of var i, because each call to swap(); will reset the value to 1 again. take a look here you can use CSS for this, it tends to be more efficient and normally requires much less code, the CSS pseudo classes are actually very powerful. However again, it depends on whether the image sources are to be dynamic or static.
-
if you are talking about manipulating the browsers back button, it can't be done with JS.
-
well, since you are injecting a string, you will need to wrap editor in quotes. textarea.insertAdjacentHTML("afterEnd", editor); unless editor is a variable?
-
we have seen alot of dumb questions here, so you're good, welcome
-
variable = variable + number - script not working
AyKay47 replied to AnAmericanGunner's topic in PHP Coding Help
really, i would make this into a function and include the file in the head of the page, but just using the code you have now, you will want to do a few things. change your points.php file to something like this, <?php if($place === '1st') {$points += 50;} elseif($place === '2nd') {$points += 45;} elseif($place === '3rd') {$points += 40;} elseif($place === '4th') {$points += 35;} elseif($place === '5th') {$points += 30;} elseif($place === '6th') {$points += 25;} elseif($place === '7th') {$points += 20;} elseif($place === '8th') {$points += 10;} elseif($place === '9th') {$points += 10;} elseif($place === '10th') {$points += 10;} elseif($place === 'CH') {$points += 50;} elseif($place === 'RCH') {$points += 40;} elseif($place === 'TT') {$points += 30;} elseif($place === 'T5') {$points += 30;} elseif($place === 'Champion') {$points += 50;} elseif($place === 'Reserve Champion') {$points += 40;} ?> and your main page to, <div class="tabbertab"> <h2>Records</h2> <?php $points = 0; //set before loop $query92 = "SELECT * FROM THISTABLE WHERE VARIABLE='$id' OR VARIABLE = '$name' ORDER BY ABS(VARIABLE), VARIABLE"; $result92 = mysql_query($query92) or die (mysql_error()); echo "<table class='record'> <tr><th>Show</th> <th>Class</th> <th>Place</th></tr> "; while($row92 = mysql_fetch_array($result92)) { $class = $row92['class']; $place = $row92['place']; include("include/points.php"); //will add correct $points value every iteration while maintaining previous value $entries = $row92['entries']; $race = $row92['show']; $purse = number_format($row92['purse'],2); echo "<tr><td>$race</td> <td>$class</td> <td>$place</td></tr>"; } ?> <tr><td colspan='3'><div align='right'>Total Points: <?php echo $points; ?></div></td></tr> </table> </div> so in your points.php page I removed where you defined $points = 0; to make it more robust so it would not overwrite the variable every iteration of the while loop, and I cleaned up the syntax a bit, you could use a switch statement here as well, but its really whatever you are more comfortable using. For the main page, I set $points = 0; towards the top before the loop so it remained a static value if the script were to be run again for another person, I included the points.php page into the while loop so it would add the correct value to the $points variable each iteration, and after the while loop has completed its iterations, you will be left with the total number of points contained in the $points variable, which i output in your table column. Again, i would set this up in a function rather then the format that you have it in now, but that's just me, also, get into the habit of using full <?php opening tags, as not all servers are configured to accept short tags. -
two result in two horizontal columns without table
AyKay47 replied to whynot's topic in PHP Coding Help
can you post the code that you have, will make it easier for me to help. -
two result in two horizontal columns without table
AyKay47 replied to whynot's topic in PHP Coding Help
The short simple explanation, in a while loop, set an incrementing variable, if the variable is a modulus of 4, create another <ul> to fill with <li>. -
variable = variable + number - script not working
AyKay47 replied to AnAmericanGunner's topic in PHP Coding Help
So you want it to output the total amount of points once?