Jump to content

ekante

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ekante's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How can i convert 1000000 to 1,000,000 or 1000 to 1,000 , i think you understood the idea.?
  2. Thanks for making all seem clear, yeah i realy didnt undertood the princip. its working now, and thanks again Regards.
  3. Where is problem, why doesnt it assign anything to $status ? <?php echo ' <tr> <td width=\"150\" align=\"right\">Tava karjera :</td> <td><select name=\"Chose\"> <option value=\"$select_waiting\">Simple User</option> <option value=\"$select_pilot\">Pilot</option> <option value=\"$select_manager\">Manager</option> </select>* $user_taken_err</td> </tr>'; if (isset($select_waiting)) { $status = "waiting"; } if (isset($select_manager)) { $status = "manager"; } if (isset($select_pilot)) { $status = "pilot"; } ?>
  4. Thx m8 , never thought looking at this function. Solved.
  5. <?php while ($row = mysql_fetch_array($result)) { switch ($row[id]){ case ($row[id] >= 120): $row[id] = 'west'; break; } echo $row[id]; } ?> That should do the trick, just write the four of them, im lazy to write them all
  6. But no my pc its going succesfully but on friends , shows this msg. And there is no header errors on my (xampp) pc server.
  7. Problem: 1 version: ( i check the remember button ) Error msg: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\pro\index.php:1) in C:\AppServ\www\pro\index.php on line 123 Line: <?php $info = base64_encode("$userid|$username|$password|$ipaddress|$lastlogin_date|$lastlogin_time"); if (isset($remember)){ setcookie("user","$info",time()+1209600); //here is the problem }else{ setcookie("user","$info",0); } ?> 2 version i dont check remember button Error msg: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\pro\index.php:1) in C:\AppServ\www\pro\index.php on line 125 Line: <?php $info = base64_encode("$userid|$username|$password|$ipaddress|$lastlogin_date|$lastlogin_time"); if (isset($remember)){ setcookie("user","$info",time()+1209600); }else{ setcookie("user","$info",0); //here is the problem } ?> If you need ill give you adress or the file. Problem is it works on my pc (xampp) , but wont work on my friends (appserv).
  8. Thanks guys here is simple code for (localhost/index.php?id=1 or 2 or 3): <?php /*$query = "SELECT * FROM user WHERE userid = '$userid' "; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result);*/ $_GET['id']; /*$query = "SELECT * FROM user WHERE userid = '$userid' "; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result);*/ if ($id = 1) { include( '1.php' ); } else if ($id = 2) { include( '2.php' ); } else if ($id = 3) { include( '3.php' ); } ?> I got what i wanted thanks. Best regards.
  9. i have problem with header(), he allway sends me to 1.php when i type index.php?id= {random from 1-3} <?php /*$query = "SELECT * FROM user WHERE userid = '$userid' "; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result);*/ if ($id = 1) { header("Location: http://localhost/1.php"); } else if ($id = 2) { header("Location: http://localhost/2.php"); } else if ($id = 3) { header("Location: http://localhost/3.php"); } ?> <?php echo "you stay here"; ?> how can i do redirection or just "send" to another page anotherway, i think this is very silly way to do that, or in case there isnt tell me where im wrong.
  10. Ok that function is working good, but how do i make that function auto start when i open the page?
  11. Problem is that i dont know how to write the code, so i didnt even start to write, because i dont know where to start. but i think like this: function userStatus() { $query = "SELECT * FROM user WHERE userid = '$userid' "; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); if ($row['status'] = 'user') { //dont know how the redirect code works } else if ($row['status'] = 'manager') { //same } else if ($row['status'] = 'pilot') { //same } }
  12. So the thing is i need to create manager/pilot web based sistem, where users register as manager or pilot. The whole idea is that when thay register in DB is there status pilot or manager. concept: *)user log's in *)function check the status *)page redirects him to pilots or manager control panel, where he is doing all his nececery things, stuff =D *)but when he attempts to go in ther control page liek manager is going in pilots page , function is not redirecting but just opening managers control panel again. But pilots and manager pages are different from each other. Thing is , i have no clue how to write the code for function like that , i need some hints doing this , some advice ,and some sample code to understand youre idea. Best regardrs.
×
×
  • 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.