-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
try this <?php $Wins[] = "Result: You search the train station from top to bottom and find $1!"; $Wins[] = "Result: You search the train station from top to bottom and find $3!"; $Wins[] = "Result: You search the train station from top to bottom and find $5!"; $Wins[] = "Result: You search the train station from top to bottom and find $10!"; $Wins[] = "Result: You search the train station from top to bottom and find $15!"; $rand = rand(0,(count($Wins)-1)); $QuoteResult = $Wins[$rand]; echo $QuoteResult; //remove this (was for testing) ?> EDIT: note if you add an extra $Wins[] = "Result: You search the train station from top to bottom and find $15!"; it will work with it note i updated the above code
-
the link in the iframe is opening the page you could add a ?portal to the src in the iframe and then a $_GET in the file to exclude the menu! if(!isset($_GET['portal'])) { echo "menu"; }
-
read the logic UnderBridgeCrimeScript.php //rand is created to choose at random if they succeed or fail.. if ($EXP <= 100) { $rand = rand(1,5); if ($rand < 3) { include('bridgefailure.php'); } else { include('bridgesuccess.php '); //Gets here } } $QuoteResult hasn't been set yet 'bridgesuccess.php ' //FIRST RAND $rand = rand(1,5); //Random from 1 to 5 if ($rand == 1) { //if its 5 then set $QuoteResult $QuoteResult = "Result: You search the train station from top to bottom and find $1!"; } //if not 1 then $QuoteResult is still not set.. EDIT: also change echo $$QuoteResult; to echo $QuoteResult;
-
Techie Out
-
OK.. if you say so but the logic says $rand = rand(1,5); if ($rand == 1) so $QuoteResult will only be set 20% of the time.. so have //FIRST RAND $rand = rand(1,5); if ($rand == 1) { $QuoteResult = "Result: You search the train station from top to bottom and find $1!"; }else{ $QuoteResult = "Result: You search the train station from top to bottom and find NOTHING!"; } or //FIRST RAND $QuoteResult = "Result: You search the train station from top to bottom and find $1!"; but hey you know best!
-
[SOLVED] $_SESSION variables dissapear after IF statement
MadTechie replied to vajra_hendry's topic in PHP Coding Help
well your not passing duration, banner or price so it can't work! what are you trying to do ? from your PHP code you should have something like <?php session_start(); $duration = $_SESSION['duration']; $banner = $_SESSION['banner']; ?> <HTML> <HEAD><TITLE>File Upload Screen</TITLE> </HEAD> <BODY> <OL> <LI>Enter the name of the picture you want to upload </li></OL> <div align="center"><hr> <form enctype="multipart/form-data" action="steptwo.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="500000"> <input type="file" name="pix" size="60"> <input type="text" name="duration" size="60"> <input type="text" name="banner" size="60"> <input type="text" name="price" size="60"> <p><input type="submit" name="upload" value="Upload Banner"> </form> </body> </html> -
revised bridgesuccess.php <?php <? include("include.php"); //FIRST RAND $rand = rand(1,5); if ($rand == 1) { $QuoteResult = "Result: You search the train station from top to bottom and find $1!"; }else{ $QuoteResult = "Result: You search the train station from top to bottom and find NOTHING!"; } // update the user's money to 1 more than what it was $addMoney = "UPDATE userregistration SET MoneyInHand=MoneyInHand+1 WHERE UserID='{$_SESSION['Current_User']}'"; $firstrandresult = mysql_query($addMoney) or die(mysql_error()); if (mysql_affected_rows() == 0) { die('Error ID 0001 contact admin on the Civilian forums immediately about this error!'); } // update the user's crimeexp to 2 more than what it was $addcrimeexp = "UPDATE userregistration SET CrimeExp=CrimeExp+2 WHERE UserID='{$_SESSION['Current_User']}'"; $expresult = mysql_query($addcrimeexp) or die(mysql_error()); if (mysql_affected_rows() == 0) { die('Error ID 0001, contact admin on the Civilian forums immediately about this error!'); } ?>
-
[SOLVED] $_SESSION variables dissapear after IF statement
MadTechie replied to vajra_hendry's topic in PHP Coding Help
ok post your form.. i think thats the problem.. -
Passing requests through my ISP PHP to my local fixed IP
MadTechie replied to seanryder's topic in PHP Coding Help
maybe .htaccess RewriteEngine on RewriteRule ^/icons/(.+) - [PT,L] RewriteRule ^/(.*) http://subdomain.domain.com/$1 [P,L] -
try adding ini_set('memory_limit', '500M'); //overkill on line 135 (above the current line 135)
-
please post your latest code (in code # tags)
-
try <?php //getting exp from database $GetEXP = "SELECT CrimeExp FROM userregistration WHERE UserID='{$_SESSION['Current_User']}'"; echo $GetEXP; $result = mysql_query($GetEXP) or die(mysql_error()); $EXP = mysql_result($result,0,"CrimeExp"); echo $EXP; ?> what is echo'd
-
really depends in the site setup.. if SQL is already used then why not.. if the news system is just a very simple one then why not use flatfile!! more info needed PS i voted SQL as you can do more advanced stuff later!
-
<? //include connect info include("include.php"); // Start up the session session_start(); if (!isset($_SESSION['Current_User']) || !$_SESSION['Current_User']) { die('You must be logged in to view this page'); } //getting exp from database $GetEXP = "SELECT CrimeExp FROM userregistration WHERE UserID='{$_SESSION['Current_User']}'"; $result = mysql_query($GetEXP) or die(mysql_error()); $EXP = mysql_result($result,0,"CrimeExp"); echo $EXP; ?>
-
[SOLVED] $_SESSION variables dissapear after IF statement
MadTechie replied to vajra_hendry's topic in PHP Coding Help
whats the print_r($_SESSION) show ? -
IF() statements not working correctly. help!
MadTechie replied to ipwnzphp's topic in PHP Coding Help
your page is doing that ? -
Page is timeing out.. on your code add if (ob_get_level() == 0) ob_start(); then after the upload add echo "upload done"; ob_flush(); flush(); set_time_limit ( 0 ); this will reset the timeout.. basically you are uploading and resizing in one timeout slot by adding the above the timeout will start again the echo can be "" but for testing have some text in their see if that helps.. i don't have access to my php.ini so i'm more limited
-
IF() statements not working correctly. help!
MadTechie replied to ipwnzphp's topic in PHP Coding Help
can you post an example of what it should look like compared to what it does look like.. personally i think this could be sorted via SQL statement! -
[SOLVED] Simple Sort ascending descending buttons
MadTechie replied to m00ch0's topic in PHP Coding Help
Parse error: syntax error, unexpected T_VARIABLE is normally somehthing like ; thing ie $sql="SELECT * FROM table ORDER BY ".$_GET['sort']." ".$_GET['order']; -
well with comments like that i don't think markjoe will be giving you any advice! good luck with your site
-
IF() statements not working correctly. help!
MadTechie replied to ipwnzphp's topic in PHP Coding Help
only think i can think of is change unset($vendors); $vendors = array_merge($vendor4, $vendor3, $vendor2, $vendor1); to the way i said it should be unset($vendors); $vendors =array_merge($vendor2, $vendor1, $vendor3, $vendor4); other than that i don't know what the problem is i see none -
note the line $clean3 = str_replace(":", ": ", "$clean2");
-
quick question/test have you tried saving the whole php file i created and tried it on your server with no changes ?
-
$clean3 = str_replace(":", ": ", "$clean2"); //existing line if (strpos($clean3,'XTREME - STATION ID 1~1')) { $clean3 = "Swansea University's Favorite Music"; }
-
what about this? http://www.madeinshropshire.co.uk/demo/index.php?contents=about-us&title=about+us or http://www.madeinshropshire.co.uk/demo/index.php?title=about-us&title=about+us