Jump to content

Domcsore

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by Domcsore

  1. Cheers mate. This could be so very useful. Top job mate.
  2. I'm not sure if this is the correct place for this query so sorry if it isnt. I recently signed up for a GameBattles account (www.gamebattles.com) and on there I am able to log into Playstation network account. \Any ideas on how they may do this?
  3. Cheers
  4. I have seen some websites with dynamic content not using a switch (I do not think at least) they keep the same banner and footer how instead of it being ?content=blah its /blah?
  5. PHP is server side, there for to do this you will need to use a form and use post or get method linking to a different page. Alternatively look up AJAX. I think I am right in what you mean.
  6. Basically what I am trying to do is load extend classes from a separate file, however I just want the files to include and create a new object automatically from the array name given. For example my template class would be like so: file name: template.global_conf.php that would be a template class which is an extend of my global_conf class. so in my global_conf class __construct function I have it so it includes the files automatically as shown above however I have issues trying to create the template object in the loop. (Should have really explained my objective to start, sorry)
  7. Sorry for late reply, but yes if I just run that it displays admin_conf and template_conf as it should. ($engine[0] and [1] are 'admin' and 'template' and $objSuffix is '_conf')
  8. An error again... I think it does not recognise the engine variable as a class so does not like it, however, I get an error saying maximum file size exceeded which seems as if the loop keeps repeating over and over?
  9. Hmn I wrote up a test script and tried inserting: ${$engine[$e].$objSuffix} = new $engine[$e]; into the while loop but failed to work?
  10. Exactly what I need cheers mate.
  11. I currently have this: $engineSuffix = '.global_conf.php'; $objSuffix = '_conf'; $engine[0] = 'template'; $engine[1] = 'admin'; $engineCount = count($engine); $e = 0; while ($e<$engineCount){ include_once($engine[$e].$engineSuffix); $e++; } but I would like something like this: $engineSuffix = '.global_conf.php'; $objSuffix = '_conf'; $engine[0] = 'template'; $engine[1] = 'admin'; $engineCount = count($engine); $e = 0; while ($e<$engineCount){ include_once($engine[$e].$engineSuffix); $e++; $'VALUE OF ARRAY $engine[$e] AND VALUE OF $objSuffix AS VARIABLE NAME' = new $engine[$e]; } Is there a way to do this?
  12. THANK YOU! Haha you have helped me so much, I did post this in the math section but had no reply so thank you for your quick response.
  13. Okay I've had so many ideas on how to do probability but when it comes to practice it's a little more difficult than I thought. Okay so what I am trying to create is a random advertisements script. So far I have this: public function adImage(){ $adimgLink[1] = 'template/template_files/ad_images/adhere.jpg'; $noAds = (count($adimgLink)); $randAd = rand(1,$noAds); echo '<img src="'.$adimgLink[$randAd].'" />'; } This works, however, I want it so customers can have a higher or lower probability of showing up depending on their budget they wish to spend on their advertisement. Any ideas? all help is appreciated =)
  14. Okay I've had so many ideas on how to do probability but when it comes to practice it's a little more difficult than I thought. Okay so what I am trying to create is a random advertisements script. So far I have this: public function adImage(){ $adimgLink[1] = 'template/template_files/ad_images/adhere.jpg'; $noAds = (count($adimgLink)); $randAd = rand(1,$noAds); echo '<img src="'.$adimgLink[$randAd].'" />'; } This works, however, I want it so customers can have a higher or lower probability of showing up depending on their budget they wish to spend on their advertisement. Any ideas? all help is appreciated =)
  15. Wrong section?
  16. Could you post a link to the method you have used because this sounds unusual?
  17. Agreed with oni-kun the easiest way is to use ddubs solution.
  18. Ah thanks very much =)
  19. Now I'm not entirely sure if I'm doing this right but I have: #topnav li a:active{ color: #000; text-decoration:none; background-image:none; background: #FFF; } And when I click the link the background does go white but I want it to stay white. Any solutions?
  20. Oh sorry, this can be marked as solved as after even more extensive research I found the problem and the solution.
  21. Haha, yeah I didn't know about that command if you look at the times I posted it at around the same time you posted yours.
  22. For example: $result = mysql_query("SELECT * FROM Persons WHERE FirstName='Peter is my name' "); $row = mysql_fetch_array($result); $replace = str_replace('Peter', 'Jammy', $row['FirstName']); mysql_query("UPDATE Persons SET FirstName = '$replace' WHERE FirstName = 'Peter' "); Something like that should set first name to 'Jammy is my name' where 'Peter is my name' was.
  23. Try something like: Getting the string from the database and then using the str_replace function and then updating it.
  24. Okay so I understand to vertically align you have to display it as a table, however, this removes the option to use keep the width at 100% any help? I have been looking all day =( Cheers, Dom Sore
  25. Try this: <?php if ( isset( $_GET['id'] ) ) { $query = "SELECT * FROM schedule WHERE course_id = '". $_GET['id'] ."' ORDER BY indexx ASC"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); if ($numrows == 0) { echo "This course does not have a set schedule. "; } $q .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); echo "<table border='1'>"; echo "<tr>"; echo " <td>Index</td>"; echo "<td>Semester</td>"; echo "<td>Day</td>"; echo "<td>Time</td>"; echo "<td>Instructor</td>"; echo "<td>Location</td>"; echo "</tr>"; while ($row= mysql_fetch_array($result)) { $indexx = $row["indexx"]; $semester = $row["semester"]; $day = $row["day"]; $time = $row["time"]; $instructor = $row["instructor"]; $location = $row["location"]; echo "<tr>"; echo "<td>$indexx</td>"; echo "<td> $semester</td>"; echo "<td>$day</td>"; echo "<td>$time</td>"; echo "<td>$instructor</td>"; echo "<td>$location</td>"; echo "</tr>"; $count++ ; } // end WHILE echo"</table>"; echo "<br/>End test link<br/>"; } // end IF ?>
×
×
  • 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.