PHP - Moved: Php Sacco System/ Investment Club
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=317096.0 Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=319007.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314181.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=345826.0 This topic has done the Monster Mash to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=343718.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=314868.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346529.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=348317.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=348500.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=352279.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=358615.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=359002.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=313919.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=349747.0 hello dear PHP-Fans - greetings to you - and a happy new year!! i set up a WAMP-System on my openSuse 11.4 system. In order to learn as much as i can bout PHP i want to do some tests and write some scripts. Well the WAMP is allready up and running. Now i try to give the writing access to the folder mkdir /srv/www/ where the php-scripts should go in... i want to give write permission to all to all files in /srv/www As root I generally: mkdir /srv/www/ chown <webmaster usrername> /srv/www/ /srv/www/ should be readable and traversable by all, but only writeable by it's owner (the user designated as the webmaster.) can i do this like mentioned above,... Love to hear from you greetings db1
Hi this is my login script i do have the html if you need to see it please ask & i was wondering if anyone would be kind enough to tell me how i can get my ban system to work Thanks
<?php require 'connect.php'; if(isset($_POST['submit'])) { $username = $_POST['username']; $password = $_POST['password']; //Prevent hackers from using SQL Injection $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql = "SELECT * FROM $tbl_name WHERE username='$username' AND password='$password'"; $result = mysql_query($sql); $count = mysql_num_rows($result); $user_level = $_GET['user_level']; $_SESSION['user_level'] = $user_level; if($count == 1) { $_SESSION['username']; $_SESSION['password']; header("Location: index.php"); } else { echo "Please check the username and password you entered is correct."; } if($_SESSION['user_level'] == 0) { $_SESSION['username']; $_SESSION['password']; header("Location: index.php"); } else if($_SESSION['user_level'] == -1) { die(); header("Location: banned.php"); } else if($_SESSION['user_level'] < -1) { die(); echo "An error has occurred please contact your administrator."; } else if($_SESSION['user_level'] == 1) { $_SESSION['username']; $_SESSION['password']; header("Location: admin.php"); } } ?> Edited by Tom8001, 23 November 2014 - 12:18 PM. Hi all I have been looking though loads of tutorials regarding log in method for websites (not APIs), and cant help find that they are outdated. So I am asking what is the correct way to create a log in system using php? Modern websites use JavaScript for asynchronous web requests so this requirement should also be catered for. APIs and mobile apps use access tokens which is very secure if implemented correctly. Can we use the token principle for websites? As the way I see it that most php log in systems use php sessions and they create a session and save some data in this session when the user successfully authenticates, however the session id is held in a cookie so if the cookie is stolen then they have access to your account. API access tokens are expired and refreshed periodically so is there such a implementation method for web sites too? i am trying to add a like system to my forum similar to facebook where it shows how many people like a post. this is my code so far: $like_list = ""; $likes = explode("|", $post_info['post_likes']); $amount_likes = count($likes); $ac_likes = ($amount_likes / 2); $slice = array_slice($likes, 0, 4, true); $remain = array_slice($likes, 4, $ac_likes, true); $remain_num = count($remain); if ($ac_likes >= 4) { for($i=0; $i<$ac_likes; $i+=2) { $like_list .= $likes[$i].", "; } $like_list .= " and $remain_num others like this"; } elseif ($amount_likes == 1 ) { $like_list .= "0 people like this"; } elseif ($ac_likes == 1) { $like_list = implode(", ", $likes); $like_list .= " likes this"; } else { $like_list = implode(", ", $likes); $like_list .= " like this"; } $post_info['post_likes'] contains data like: Code: [Select] user1|123456789|user2|123456789 where the number is the timestamp. unfortunatly $like_list prints the username and the timestamp when i would like it to only display the username. This means printing every 2nd element in the array starting from 0. I have seen this done with for loops but i am not using one therefore i am stuck. Any ideas? and is this the best database setup for likes? the post_likes column is added on to the end of the post table. Hi All I am wanting to create an online booking system. Has anyone got any suggestions on this? Adi Hi Everyone, Just a quick question before I take on this project. Basically the client has a secure server set up with folders for different clients. So they can store excel files, PDFs etc, What the client use to do was send the client an email with the http address of that clients particular folder to be able to login. What my job is to create a login system that redirects each client to their particular area on the secure system. Is this going to be difficult, What I was thinking of doing was when the administator is setting up the client details there would be an extra field saying address: they paste the address of the folder on the server. Then it will redirect them to their folder. Is this the correct way to do this. Any help or advice would be great. I'm busy with a small storage system for my site, but i encounter some problems with it. I have successfully managed to get all products from the order, and traced on what spots those product are in the warehouse. It looks like this atm http://img37.imageshack.us/img37/7302/tableordereng.jpg this is the code i have atm (sorry i program in dutch, i hope its abit understandable) Code: [Select] <?php $query = "select * from `orderregel` WHERE `ordernr`='".$ordernr."'"; $row = mysql_fetch_array( $query ); echo "<table border=1 width=680 bgcolor=#FFFFFF> <tr> <th width= 100>artikelnummer</th> <th width= 100>productnaam</th> <th width= 40>Plaats</th> <th width= 40>aantal in magazijn</th> <th width= 40>aantal nodig</th> </tr> </table>"; foreach ( self::find_by_sql($query) as $user) { $query2 = "select * from magazijn WHERE artikelnr = ".$user->artikelnr.""; $row = mysql_fetch_array( $query ); foreach ( self::find_by_sql($query2) as $magazijn) { echo "<table class= order_overzicht border= 0 width= 680>"; echo "<tr> <td width= 100>".$magazijn->artikelnr."</td> <td width= 100>".$magazijn->productnaam."</td> <td width= 40>".$magazijn->magazijn_plaats."</td> <td width= 40>".$magazijn->aantal."</td> <td width= 40>".$user->aantal."</td> </tr> </table>"; } } ?> The problem i have now is, that i want it to do the following. for example someone orders 430 packages of Haribo Kers Cola (see imageshack upload). I first want it to empty spot 16 in the wherehouse. Only when spot 16 is empty, i want it to go to the next spot (19) wich contains the same product. the end result would be something like this: http://img690.imageshack.us/img690/6246/tableorderneweng.jpg i hope you guys can help me out on this one, becouse i have no clue how i can resolve this problem thanks in advance (Sorry btw for my bad english ) |