Jump to content

Infected-Waffle

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Infected-Waffle's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. okay so I've got this login, but it requires me to put my username in exactly as it is in the database. This gets kind of tedious. How could I make it so that it will accept both upper and lower case? Here's the code if it helps... [code]if($mode == 'login') { //login $username = $_POST['username']; $password = md5($_POST['password']); $query = 'SELECT name, password FROM users WHERE name = "'.$username.'"'; $result = mysql_query($query); $row = @mysql_fetch_array($result, MYSQL_ASSOC); if($username == $row['name'] && $password == $row['password']) { $_SESSION['logged_in'] = $row['name']; header('location: index.php'); } else { $content = 'Invalid Login credentials'; } mysql_free_result($result);[/code]
  2. Sorry. Alright basically when I didn't use this templating system I would put an echo in the while. But now I started using this template system and What I need to basically do is put all the entries the query returns into one variable which will then be placed in the $data array and parsed. Hope that's  specific enough. ^^;
  3. Okay so I have this templating system and I want to retrieve all my new results but they allhave togo into one variable. I've brainstormed for a while but I can't think of anything. Here's the code: [code]<?php session_start(); if (isset($_SESSION['logged_in']) { $nav = '&raquo; User CP'; } else { $nav = '<form action="index.php?page=submit&mode=login" method="post" name="login"> Username:<br> <input name="username" type="text" size="17" maxlength="15"><br> Password:<br> <input name="password" type="password" size="17" maxlength="16"><br> <input name="Login"  value="Login" type="button"> </form>'; } include("dbconnect.php"); include("templates/templatesys.php"); switch($_GET['page']) { case 'templates' : break; default: $query = 'SELECT * FROM news ORDER BY id DESC'; $result = mysql_query($query); if ($result) { while( $row = @mysql_fetch_array($result, MYSQL_ASSOC)) { } } $data = array('CONTENT' =>); $tpl = new template; $tpl->parseTemplate('templates/main.tpl', $data); $tpl->display();     break; } ?>[/code]
  4. [!--quoteo(post=372387:date=May 8 2006, 03:47 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 8 2006, 03:47 PM) [snapback]372387[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yes you can place an array within an array in a ur. Something like this: [code]<?php if(isset($_GET['say'])) {     echo '<pre>' . print_r($_GET['say'], true) . '</pre>'; } ?> <a href="?say['hello']=hello&say['world']=world">Set the array in the url!</a>[/code] [/quote] I'm confused. Could you please explain more?
  5. It's not check box's. It's like if you click a link it adds it to the url var and keeps it until you end the game (whihc is what this is for.) I need a way to force link colors to change during one game session, so I decided to store the used options in the url and call them from there and add them each time you visit a page. [a href=\"http://www.infected-designs.com/jeopardy/\" target=\"_blank\"]http://www.infected-designs.com/jeopardy/[/a] it's for that, you'll understand when you look at one of the boards. edit: here's the source if you need it... [a href=\"http://www.infected-designs.com/jeopardy/source/\" target=\"_blank\"]http://www.infected-designs.com/jeopardy/source/[/a]
  6. Is there a way to store multiple variables in 1 $_GET['']? edit: what I mean is, is there a way to make something like: whatever.php/something.php?d0=var1, var2 kind of like an array in the url
×
×
  • 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.