Jump to content

membot

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

About membot

  • Birthday 10/19/1995

Profile Information

  • Gender
    Female
  • Location
    Oregon

membot's Achievements

Member

Member (2/5)

0

Reputation

  1. I haven't used PHP in a while. I'm getting "unexpected T_ENCAPSED_AND_WHITESPACE" on the second line of this: if(isset($_GET['name'], $_GET['organization'], $_GET['email'], $_GET['message'])){ mail('memzenator@gmail.com', 'maybearobot: '.$_GET['organization'], "Name: $_GET['name'] /n/n Return Email: $_GET['email'] /n/n $_GET['message']"); }
  2. Oh. Yeah I was checking it at school, so they probably have an older version. Because it works for me at home too. Silly me!
  3. I made what I thought was a pretty simple CSS page, and was testing it as I coded in Google Chrome. Then I tested it in Firefox and box-shadow and transition weren't working. I don't know what could be causing this, since Firefox should support box-shadow, and -moz-transition is in the code. Here is a link, and you can view the source from there: http://students.4j.lane.edu/~mmatters32/ I haven't tested it in any other browsers, so if you have Safari or Opera you can tell me if you see shadows and transitions when you hover on the boxes. Thanks!
  4. I have a MySQL table for some photos (including columns like file path, caption, date, etc.), and I'm eventually making a PHP form I can use to upload photos and set the captions and whatever. However, initially, I want to add around 100 photos, and I'm thinking it would be easier to upload them all by FTP and have some kind of script (which I would only use this once) that would add all the photos in that folder to the MySQL table. Only the file path column would need to be filled out with this. I'm thinking this might not necessarily be a MySQL command or a PHP script, but I don't know anything about any other programming languages. Any help is appreciated.
  5. Well the thing is, I'm making an admin for the site, so the user will see these numbers and be able to change them. The idea is that if for example they want to put in a new row between rows 2 and 3, they could type 2.5 for the row number. Then when they save it and refresh the page, the rows are ordered with integers again. I've seen this exact thing done on other sites. Maybe it's not very efficient, but it'll do for me.
  6. Sorry if this belongs in the MySQL section. I figured it might be more of a PHP thing. I have a database where rows each have a number, which is used to determine what order they appear in on my PHP page. But right now they aren't like 1, 2, 3, 4, etc. They are a little jumbled because of deleting some and changing some, so they're more like 1, 3, 7, etc. Is there a way to make them 1, 2, 3, 4 with PHP? Like, put them in order and number them accordingly? Thanks.
  7. Oh wow, nevermind. I had the form action set to the wrong page. I am like the queen of stupid mistakes. x3
  8. Well isn't that what I did? If the login is correct, it's supposed to set the session variable and redirect to the admin page. And then the admin just checks if the variable is set and if it's not, it redirects to the login page. But when I try it (on WAMP), even after I log in it redirects to the login page again. So my thought was that somehow the session variable wasn't carrying over to the second page. :/
  9. This should be really simple, but I just can't figure out why it isn't working. It's my first time using sessions, so I'm probably doing something silly. It's just a login to an admin page. It's for a photo gallery, that's why the database is called "photo". This is the login page: <?php session_start(); if(isset($_POST['user']) && isset($_POST['password'])){ $user = $_POST['user']; $password = sha1($_POST['password']); $photo = new mysqli('localhost', 'user', 'password', 'photo'); $login = $photo->query("select user, sha1(password) from settings where user = '$user' and sha1(password) = '$password'"); if($login->num_rows > 0){ $_SESSION['login'] = 1; ?> <META HTTP-EQUIV="Refresh" Content="0; URL=admin.php"> <?php } else { $badlogin = 1; } } ?> <html> <head> <style> body {margin-top: 50px;} td {text-align: right;} input {width: 200px;} </style> </head> <body><center> <?php if(isset($badlogin)){ ?> <span style="color: red;">Oops! Wrong login.</span><br><br> <?php } ?> <table> <form action="admin.php" method="post"> <tr><td>User:</td><td><input type="text" name="user" /></td></tr> <tr><td>Password:</td><td><input type="password" name="password" /></td></tr> <tr><td></td><td><input type="submit" value="Login" /></td></tr> </form> </table> </center></body> </html> And this is the admin page: <?php session_start(); if($_SESSION['login'] != 1){ ?> <META HTTP-EQUIV="Refresh" Content="0; URL=login.php"> <?php } else { ?> <html> <head> </head> <body> Admin stuff here. </body> </html> <?php } ?>
  10. Oh sorry, didn't see that other post about the <br /> or <br> thing. But still, I'd like to know the other stuff.
  11. I've never used html/head/body tags in pages, yet w3schools says it's "required". What does that mean exactly? It obviously still works without them. Also, what's the point of using <br /> instead of <br>? Or <img src="" /> and <img src="">? Is it really more "correct" to use the extra slashes? And why, exactly, if it all works the same?
×
×
  • 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.