Jump to content

papillonstudios

Members
  • Posts

    294
  • Joined

  • Last visited

Everything posted by papillonstudios

  1. the loginform.php is included in the login.php file
  2. What I have is login.php and loginform.php login.php holds the full login page and loginpage.php hold all functionality and display of the form
  3. <?php include('config.php'); ob_start(); @session_start(); if (!isset($_POST['login'])) { ?> <form method="post" action="<?php $_SERVER['PHP_SELF'] ?>"> <fieldset> <legend>Login</legend> <table> <tr> <td>Email </td> <td><input type="text" name="email" /></td> </tr> <tr> <td>Password </td> <td><input type="password" name="password" /></td> </tr> <tr> <td><input type="submit" name="login" value="Login" /></td> </tr> <tr> <td><a href="<?=$siteurl?>/register.php">Register</a></td> </tr> </table> </fieldset> </form> <?php } else { //Declare some variables $email = secure($_POST['email']); $password = secure($_POST['password']); //Check if the form is filled out if (!$email || !$password) { echo 'Please fill out the form completely'; echo '<a href="'. $siteurl .'/login.php">Go Back</a>'; } else { $user = mysql_query("SELECT * FROM `users` WHERE email = '$email'"); if (! mysql_num_rows($user)) { echo 'That user doe not exist'; } else { //Encrypt the password $encpass = sha1($password . $salt); //Find the user $superquery = mysql_query("SELECT * FROM `users` WHERE email = '$email' AND password = '$encpass'"); if (mysql_num_rows($superquery) == 1) { //If the user is found, set the cookies setcookie("username", $email, 0); setcookie("password", $encpass, 0); setcookie("is_logged_in", true, 0); //send the user to the home page header("Location: " . $siteurl . "members.php"); } else { echo 'Password was incorrect. Please try again.'; } } } } ob_flush(); ?>
  4. I am having a problem with my login page when I set cookies I get this error. I do have ob_start() at the beginning and ob_flush() and the end but i still get the error <?php include('config.php'); ob_start(); @session_start(); if (!isset($_POST['login'])) { ?> <form method="post" action="<?php $_SERVER['PHP_SELF'] ?>"> <fieldset> <legend>Login</legend> <table> <tr> <td>Email </td> <td><input type="text" name="email" /></td> </tr> <tr> <td>Password </td> <td><input type="password" name="password" /></td> </tr> <tr> <td><input type="submit" name="login" value="Login" /></td> </tr> <tr> <td><a href="<?=$siteurl?>/register.php">Register</a></td> </tr> </table> </fieldset> </form> <?php } else { //Declare some variables $email = secure($_POST['email']); $password = secure($_POST['password']); //Check if the form is filled out if (!$email || !$password) { echo 'Please fill out the form completely'; echo '<a href="'. $siteurl .'/login.php">Go Back</a>'; } else { $user = mysql_query("SELECT * FROM `users` WHERE email = '$email'"); if (! mysql_num_rows($user)) { echo 'That user doe not exist'; } else { //Encrypt the password $encpass = sha1($password . $salt); //Find the user $superquery = mysql_query("SELECT * FROM `users` WHERE email = '$email' AND password = '$encpass'"); if (mysql_num_rows($superquery) == 1) { //If the user is found, set the cookies setcookie("username", $email, 0); setcookie("password", $encpass, 0); setcookie("is_logged_in", true, 0); //send the user to the home page header("Location: " . $siteurl . "members.php"); } else { echo 'Password was incorrect. Please try again.'; } } } } ob_flush(); ?> what am i doing wrong?
  5. the way Im doing it is calling a javascript function I can use over and over. function redirect(url) { window.location = url; }
  6. I didn't upload all the images http://gamingfusion.net/magic/
  7. the links that have index.php and play.php as the anchor dont go to mydomain.com/index.php or mydomain.com/play.php they stay mydomain.com when I click them
  8. but the thing is it wont even add the "#" to the url in the address bar
  9. ok Im doing a javascript project for school, but for some reason my links are not working. What I mean is I can click them and nothing happens. They are pointed to different pages but it doesn't change. heres my code: index.php <!DOCTYPE HTML> <html> <head> <title>Magic: The Gathering Community Tournment</title> <link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="cssreset.css"> <script type="text/javascript" src="javascript.js"></script> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.easing.min.js"></script> <script type="text/javascript" src="jquery.lavalamp.min.js"></script> <script type="text/javascript"> $(function() { $("#1, #2, #3").lavaLamp({ fx: "backout", speed: 700, click: function(event, menuItem) { return false; } }); }); </script> </head> <body> <div id="loginBox"> <h2>Login</h2> <form action="login.php" method="post"> <table> <tr> <td>Email: </td><td><input type="email" name="email" /></td> </tr> <tr> <td>Password: </td><td><input type="password" name="passsword" /></td> </tr> <tr> <td><input type="submit" name="submit" value="Submit" /></td> </tr> </table> </form> </div> <div id="wrapper"> <div id="logo"> <img src="i/logo.png" alt="Logo" /> </div> <div id="navigation"> <ul class="menu" id="2"> <li class="current"><a href="index.php">Home</a></li> <li><a href="play.php" target="_self" >Play!</a></li> <li><a href="#" id="account" onclick="showElement('pageOverlay', 'loginBox')">My Account</a></li> <li><a href="#">Members</a></li> <li><a href="#">Top Players</a></li> <li><a href="#">Logout</a></li> </ul> </div> <div id="contentContainer"> <div id="breadCrumb"> Home </div> <div id="features"> <table style="position:relative;"> <tr> <td> <div id="widget1"> <a href="#"><img src="i/widget1.jpg" alt="Play Now!" /></a> </div> </td> <td> <div id="widget2"> <a href="#"><img src="i/widget2.jpg" alt="Join Today!" /></a> </div> </td> </tr> </table> </div> <div id="video"> <table> <tr> <td> <img src="i/youtube.jpg" alt="YouTube" /> </td> <td id="videoTxt"> <img src="i/videoTxt.jpg" alt="Watch How-To Video" /> </td> </tr> </table> </div> <!--END OF contentContainer --> </div> </div> </body> </html> javascript.js onload = createElements; function createElements() { createOverlay(); createLoginBox(); } function createOverlay() { var pageOverlay = document.createElement("div"); pageOverlay.id = "pageOverlay"; pageOverlay.onclick = function() { document.getElementById("pageOverlay").style.display = "none"; document.getElementById("loginBox").style.display = "none"; } document.body.appendChild(pageOverlay); } function createLoginBox() { var loginBox = document.getElementById("loginBox"); loginBox.id = "loginBox"; document.body.appendChild(loginBox); } function showElement(id, id2) { document.getElementById(id).style.display = "block"; document.getElementById(id2).style.display = "block"; } im also using the Lavalamp Javascript script for the menu.
  10. but why do I have to do it that way and can't call the function that contains the same code? kuzz I need to use that getElementById code frequently throughout the lesson.
  11. that worked so I put that into a separate function and called it in the window.onload and it works thanx for ur help
  12. nope that didn't work. anything else?
  13. ok I am in school and both all the other students and the teacher are stumped. I am loading this js file /* New Perspectives on JavaScript, 2nd Edition Tutorial 5 Tutorial Case Author: Date: Filename: order.js Functions List: todayTxt() Displays the current date in the format mm/dd/yyyy. startForm() Sets up and initializes the form1 Web form. resetForm1() Reloads the current Web page, resetting the form. calcPrice() Calculates the price of the customer order by multiplying the product price by the quantity ordered. calcShipping() Calculates the shipping cost of the item calcTotal() Calculates the total cost of the order including the sales price, shipping cost, and sales tax. checkForm1() Checks the form to ensure that all required fields have been entered by the user. */ window.onLoad = startForm(); function todayTxt() { var Today = new Date(); return Today.getMonth() + 1 + "-" + Today.getDate() + "-" + Today.getFullYear(); } function startForm() { document.forms[0].date.value = todayTxt(); } and this htm file <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- New Perspectives on JavaScript, 2nd Edition Tutorial 5 Tutorial Case GPS-ware Form 1 Author: Date: Filename: form1.htm Supporting files: gpsware.css, gpsware.jpg, order.js, functions.js --> <title>Product Order Form 1</title> <link href="gpsware.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="order.js"></script> </head> <body> <form id="form1" method="post" action="form2.htm"> <div id="links"> <a href="#" class="newgroup">Home Page</a> <a href="#">Product Catalog</a> <a href="#">Order Form</a> <a href="#">Maps Online</a> <a href="#">Contact Us</a> <a href="#" class="newgroup">Countries</a> <a href="#">States</a> <a href="#">National Parks</a> <a href="#">Hiking Trails</a> <a href="#">Cities</a> <a href="#">Astronomical</a> <a href="#">Natural</a> <a href="#" class="newgroup">GoMap 1.0</a> <a href="#">Drive Planner 2.0</a> <a href="#">Hiker 1.0</a> <a href="#">G-Receiver I</a> <a href="#">G-Receiver II</a> <a href="#">G-Receiver III</a> <a href="#" class="newgroup">Downloads</a> <a href="#">Tech Support</a> <a href="#">FAQs</a> </div> <div id="main"> <p id="logo"><img src="gpsware.jpg" alt="GPS-ware" /></p> <h1>Order Form</h1> <p id="datep"> <input class="text" id="date" name="date" size="11" value="mm-dd-yyyy" readonly="readonly" /> </p> <fieldset> <legend>Select a Product</legend> <table> <tr> <td class="labelcell">Product</td> <td class="inputcell"> <select name="prod" id="prod"> <option value="0">Products from GPS-ware</option> <option value="19.95">GoMap 1.0 ($19.95)</option> <option value="29.95">Drive Planner 2.0 ($29.95)</option> <option value="29.95">Hiker 1.0 ($29.95)</option> <option value="149.50">G-Receiver I ($149.50)</option> <option value="199.50">G-Receiver II ($199.50)</option> <option value="249.50">G-Receiver III ($249.50)</option> </select> <select name="qty" id="qty"> <option value="0">Quantity</option> <option value="1">1</option><option value="2">2</option><option value="3">3</option> <option value="4">4</option><option value="5">5</option><option value="6">6</option> <option value="7">7</option><option value="8">8</option><option value="9">9</option> <option value="10">10</option> </select> </td> <td class="outcell"> <input class="num" name="price" id="price" size="7" value="0.00" readonly="readonly" /> </td> </tr> <tr> <td class="labelcell">Shipping</td> <td> <p><input type="radio" name="shipType" id="ship1" value="4.95" /> <label for="ship1">Standard (4-6 business days): $4.95</label> </p> <p><input type="radio" name="shipType" id="ship2" value="8.95" /> <label for="ship2">Express (2 days): $8.95</label> </p> <p><input type="radio" name="shipType" id="ship3" value="12.95" /> <label for="ship3">Next Day (1 day): $12.95</label> </p> </td> <td class="outcell"> <input class="num" name="ship" id="ship" size="7" value="0.00" readonly="readonly" /> </td> </tr> <tr> <td colspan="2" class="labelcell2">Subtotal</td> <td class="outcell"> <input class="num" name="sub" size="7" value="0.00" readonly="readonly" /> </td> </tr> <tr> <td colspan="2" class="labelcell2">Tax (5%)</td> <td class="outcell"> <input class="num" name="tax" id="tax" size="7" value="0.00" readonly="readonly" /> </td> </tr> <tr> <td colspan="2" class="labelcell2">TOTAL</td> <td class="outcell"> <input class="num" name="tot" id="tot" size="7" value="0.00" readonly="readonly" /> </td> </tr> </table> </fieldset> <p id="formbuttons"> <input type="reset" name="cancelb" id="cancelb" value="Cancel" /> <input type="submit" name="nextb" id="nextb" value="Next" /> </p> </div> </form> </body> </html> and when I open the page in firefox and open the error console i get this error the same thing comes up when changing the "0" to "form1" I tried using getElementById and the console says it returns null why is this happening?
  14. After going back through my code I thought of the wp-head(); php syntax so i tried it and it fixed it!
  15. Im not sure whats going on with your script but heres one that works. <?php ob_start(); session_start(); if ($uId) { //If they are logged in, they don't need to be here header("Location: " . $siteurl . "index.php"); } else { if (!isset($_POST['login'])) { //If the post hasn't been submitted, then show the forms echo '<br /><p><form method="post" action="index.php?action=login"> <p>Username:'.form_input(text,username).'</p> <p>Password:'.form_input(password,password).'</p> <input class="submit" type="submit" name="login" value="Login"><p> </form> <br> '.anchor ('index.php?action=forgot','Forgot Password?').' | '.anchor ('index.php?action=register','Register').''; } else { //secure the input $username = secure($_POST['username']); $password = secure($_POST['password']); //make sure the fields arn't empty if (!$username | !$password) { echo 'You left a field empty'; } else { //make sure the user exists $user = mysql_query("SELECT * FROM `users` WHERE username = '$username'"); if (($usez = mysql_num_rows($user)) == 0) { echo 'user doesnt exist'; } else { //Encrypt the password to check with the encrypted one currently in the database $encpass = sha1($password . SALT); //Find the user $superquery = mysql_query("SELECT * FROM `users` WHERE username = '$username' AND password = '$encpass'"); if (mysql_num_rows($superquery) == 1) { //If the user is found, set the cookies setcookie("username", $username, $cookieTime); setcookie("password", $encpass, $cookieTime); //send the user to the home page header("Location: " . $siteurl . "index.php"); } else { echo 'Password was incorrect. Please try again.'; } } } } } ?>
  16. I am making a custom theme and I am pretty much done. I tested it but the podpress player won't show on the page it shows the links that appear below it but no the player itself here is the source code: http://pastebin.com/nqQGCyBJ What could the problem be, its works in the default WP Theme and in another custom theme, i check out my css and i dont think thats it
  17. I want to have text for a certain element to wrap around an image(#content .body img) in the same element. the image is positioned relative. the reason for positioning the DIV relative is if i use float:left; the image is removed from the containing DIV(#content .body). If i set the text(#content .body p) to display:inline then is partially wraps the text(first line wraps around the bottom of the image). Is there anything I can do to wrap the text around the image? #content .body { position:relative; top:60px; left:15px; background: rgba(0, 0, 0, 0.6); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; max-width:650px; -webkit-border-radius:15px; -moz-border-radius:15px; border-radius:15px; } #content .body img { position:relative; top:15px; left:15px; margin-right:15px; margin-bottom:15px; } #content .body p { position:inherit; padding:10px; font-size:14px; text-indent:20px; display:inline; } <div id="contentContainer"> <div id="navigation"> <ul> <li><a href="#">News</a></li> <li><a href="#">Reviews</a></li> <li><a href="#">Videos</a></li> <li><a href="#" id="active">Downloads</a></li> <li><a href="#">Contact</a></li> </ul> <img id="divider" src="images/divider.png"/> </div> <div id="content"> <div class="title"> <h2>Google I/O 2011</h2> </div> <div class="body"> <img src="images/icecream.png" /> <p>At the live keynote, Google announced 2 new versions of it's Android OS. First the 3.1 update for Android Hunnycomb and the next big release Android Ice Cream Sandwich or Android 4. This version of Android is going to include many new features. First is Google is standardizing the Android Platform across all devices, this means that the same OS that is on Android phones with also be on Android Tablets. This new OS is going to have all the features of Android 3, but optimized to work on both Tablets and Phones. <a href="#">READ MORE</a></p> </div> </div> </div>
  18. i changed my design a little
  19. that would work but the div is inside of another which is why im having the issue ex <div> <div> Text image Text </div> </div> I have done this before but i have a fixed height and put the text with an overflow if it was longer than the space available. But I want to avoid that
  20. its floating to the right but its taken out of the div
  21. I am having troubles with my css code. I am trying to wrap text around an image that is contained in a div but when i try 'float:right' the image get taken out of the div. I have also tried using position:relative but as i thought it just puts the image over top of the text. heres my code .leftPost img { float:left; } <div class="leftPost"> <div class="post-cat-three"> <!-- Display the Title as a link to the Post's permalink. --> <h2> <a href="http://localhost:8888/TerranFarms/?p=1" rel="bookmark" title="Permanent Link to Welcome!!"> <h2>Welcome!!</h2> </a> </h2> <!-- Display the Post's Content in a div box. --> <div class="entry"> <div class="text"><p>Happy Holidays everyone!!!</p> <div>Welcome to TerranFarm Equine Products, dealers for Mar-Weld and Duralume Aluminum Products, specializing in Round Pens, Horse Stalls and Gates.</div> <div><a href="http://localhost:8888/TerranFarms/wp-content/uploads/2011/04/pic.png"><img class="image alignright" title="pic" src="http://localhost:8888/TerranFarms/wp-content/uploads/2011/04/pic.png" alt="" width="250" height="188" /></a></div> </div </div> FYI this is for a wordpress template and i have tried using the image align in wordpress but it doesnt change anything heres is all my css #wrapper { width:662px; height:200px; position: absolute; left:50%; margin-left:-331px; } #logo { background: url(images/logo.png); width:378px; height: 128px; position:absolute; left:50%; margin-left:-188px; top:70px; } #navigation { background: url(images/navbarbg.png); width:662px; height:66px; position:absolute; top:264px; } #navigation a { text-decoration: none; color: black; font-size: 18px; } #navigation #home { position: absolute; left:20px; top:15px; } #navigation ul { position: absolute; top:23px; left:57px; } #navigation ul :hover { color: blue; height: 50px; } #navlist li { display: inline; list-style-type: none; padding-left: 20px; padding-left: 20px; } #content { background: url(images/contentbg.png); width: 662px; height: 738px; position:absolute; top:356px; } .postContainer { margin: 25px; } .leftPost { background: #999; /* for non-css3 browsers */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d5d3c6', endColorstr='#9f8b73'); /* for IE */ background: -webkit-gradient(linear, left top, left bottom, from(#d5d3c6), to(#9f8b73)); /* for webkit browsers */ background: -moz-linear-gradient(top, #d5d3c6, #9f8b73); /* for firefox 3.6+ */ } .leftPost h2 { background: #999; /* for non-css3 browsers */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b7663a', endColorstr='#6a280e'); /* for IE */ background: -webkit-gradient(linear, left top, left bottom, from(#b7663a), to(#6a280e)); /* for webkit browsers */ background: -moz-linear-gradient(top, #b7663a, #6a280e); /* for firefox 3.6+ */ padding: 5px; } .leftPost a { color: white; text-decoration: none; font-family: Arial; } .leftPost .text { padding: 10px; } #footer { width:180px; position:absolute; left:50%; margin-left: -90px; text-align: center ; top:1107px; font-family: Arial; font-size: 9px; }
  22. Are you talking about a Mod Rewrite in a .htaccess file.
  23. So I have a wordpress website but when I share a link on Facebook I don't want to have to put in http://yourdomain.com/?page_id=176 for example I would want to put http://yourdomain.com/thepage The only problem with doing it this way is it doesnt pull the meta data set for facebook. How do I get facebook to get the right image and text when I share a link with a redirect?
  24. OK in the html editor I add spaces into the text of a page, I check the visual editor and the spaces are there but when I load the page the spaces do not appear. Why is this happening?
×
×
  • 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.