Jump to content

dad00

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dad00's Achievements

Member

Member (2/5)

0

Reputation

  1. yay, it works now. thanks!
  2. yeah, but i cant work out where in the code it is going wrong. i cant see any problems :S
  3. Hi, I keep getting this error Fatal error: Out of memory (allocated 72876032) (tried to allocate 35 bytes) in ****/spinner.php on line 12 heres the loop that im using $offset=0; $i=1; $position2=0; $continue=true; $splitted[1]= 1; do{ $offset=$position2 + 1; $splitted[$i]=$offset; // LINE 12 HERE <---- if (in_array($offset, $splitted, true)) { $continue=false; }else{ $position1= stripos($_POST['text'],"{",$offset); $position2= stripos($_POST['text'],"}",$offset); $position3= $position2 - $position1; $split = substr($_POST['text'], $position1, $position3); $split = substr($split, 1); $splitted[$i]=$offset; echo $i." ".$split."<br>".$offsetlog[$i]."<br> <br>"; } $i++; }while ($continue=true); I know it probably isnt very well coded, but does anyone know how to solve my error?
  4. no i dont, i tried it on my wamp server and it works fine but i try it on a host (host gator) and it has this problem
  5. its in wordpress and yes ive put session_start in the right place (i modded wordpress to make sessions work)
  6. Hi, Im making a login form and im using this code: if($login=="true"){ $_SESSION['mlvl']=1; if($username=="admin"){ $_SESSION['admin']=1; }else{ $_SESSION['admin']=0; } } but when the page refreshes their is no value on the sessions i get this output: Array ( [mlvl] => [admin] => ) any ideas?
  7. i use notepad++ and my script works now thanks
  8. so you want the numbers 200-1000 in a array? dont hand type it thats the manual way use a while loop or for loop $i=199; while ($i<1000){ $i++; $array[$i]=$i; }
  9. couldn't u just seperate it echo "<"."?"."php "."bla bla bla text "."?".">";
  10. I keep getting this error whatever i do heres my code: TEACHER<br> <?php error_reporting(E_ALL); $HOST='localhost'; $USER='root'; $PASS=''; $DATABASE='school'; mysql_connect($HOST,$USER,$PASS) or die('connect'); mysql_select_db($DATABASE) or die($DATABASE); function confirm($msg) { echo "<script langauge=\"javascript\">alert(\"".$msg."\");</script>"; }//end function ?> <h4> Filter According To:</h4> Tutor <form action="" method="POST"> <?php $ages = array(); $query = mysql_query("SELECT * From pupils"); while($r = mysql_fetch_array($query)) { if(!in_array($r['tutor'], $ages)) array_push($ages, $r['tutor']); }; sort($ages, SORT_NUMERIC); echo "<select name='tutorfilter'> <option>Select Tutor</option>"; for($i = 0; $i < count($ages); $i++) echo "<option value=\"" . $ages[$i] . "\">" . $ages[$i] . "</option>"; echo "</select>"; ?> <input type="submit" value="Go"> </form> <?php if(isset($_POST['sent'])){ $_POST['tutorfilter']=$_POST['filter']; //add stamp if(isset($_POST['addstamp'])){ $id2=$_POST['id']; //echo $when; //$sql = "SELECT * FROM stamps WHERE player_id='$id2'"; $sql = mysql_query($sql) or die(mysql_error()); $numberofrows = mysql_num_rows($sql); //echo $numberofrows; if($numberofrows===0){ mysql_query("INSERT INTO stamps( player_id, total, totalweek ) VALUES($id2, '1','1') ") or die(mysql_error()); echo "no rows"; }else{ //mysql_query("UPDATE stamps SET $when = 1 WHERE player_id = $id2"); } //remove stamp /* if(isset($_POST['removestamp'])){ $id2=$_POST['id']; $sql = "SELECT * FROM stamps WHERE player_id='$id2'"; $sql = mysql_query($sql) or die(mysql_error()); $numberofrows = mysql_num_rows($sql); //echo $numberofrows; if($numberofrows===0){ //mysql_query("INSERT INTO stamps( player_id, monday1,monday2,monday3,monday4,monday5,tuesday1,tuesday2,tuesday3,tuesday4,tuesday5,wednesday1,wednesday2,wednesday3,wednesday4,wednesday5,thursday1,thursday2,thursday3,thursday4,thursday5,friday1,friday2,friday3,friday4,friday5 ) VALUES($id2, '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0') ") or die(mysql_error()); //echo "no rows"; } //mysql_query("UPDATE stamps SET $when = 0 WHERE player_id = $id2"); } */ if(isset($_POST['tutorfilter'])){ $sql = "SELECT * FROM pupils WHERE tutor='".$_POST['tutorfilter']."' ORDER BY surname "; $sql = mysql_query($sql) or die(mysql_error()); while($rows = mysql_fetch_assoc($sql)) { echo "<form action='' method='POST'>"; echo "<a href='addpoints.php?id=".$rows['id']."' target='side'>".$rows['surname']." ".$rows['first_name']."</a>"; ?> <input type="submit" value="+" name="addstamp"> <input type="submit" value="-" name="removestamp"> <input type="hidden" value="<?php echo $rows['id']; ?>" name="id"> <input type="hidden" value="sent" name="sent"> <input type="hidden" value="<?php echo $_POST['tutorfilter']; ?>" name="filter"> </form> <?php } } ?> the error is Parse error: parse error in C:\wamp\www\teacher\index.php on line 101 and thats the bottom line
  11. they turn into a session variable when its clicked so still giving them space to edit it. and also if i encrypt the value they can still view it and decrypt it and i need to use post because i need to send the data from my site to the paypal site
  12. or is there a way i can transfer $_post data without a form
  13. its because im using a html form its the only way i can do it for what i need. And paypal uses a html form
  14. the elements are hidden but their still editable with google chrome
  15. yeah theres a problem though ive also got a paypal buy now button which has the price and everything but i have no way of validating that before it gets to paypal
×
×
  • 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.