-
Posts
42 -
Joined
-
Last visited
Never
Everything posted by Domcsore
-
Cheers mate. This could be so very useful. Top job mate.
-
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?
-
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?
-
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.
-
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)
-
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')
-
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?
-
Hmn I wrote up a test script and tried inserting: ${$engine[$e].$objSuffix} = new $engine[$e]; into the while loop but failed to work?
-
Exactly what I need cheers mate.
-
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?
-
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.
-
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 =)
-
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 =)
-
Could you post a link to the method you have used because this sounds unusual?
-
Agreed with oni-kun the easiest way is to use ddubs solution.
-
Ah thanks very much =)
-
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?
-
Oh sorry, this can be marked as solved as after even more extensive research I found the problem and the solution.
-
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.
-
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.
-
Try something like: Getting the string from the database and then using the str_replace function and then updating it.
-
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
-
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 ?>