Search Results

Search found 24 results on 1 pages for 'mrender'.

Page 1/1 | 1 

  • Simple POST random number issue in PHP

    - by MrEnder
    Ok I am trying to make something to ask you random multiplication questions. Now it asks the questions fine. Generates the random questions fine. But when it reloads the page the random numbers are different... how can I fix this? <?php $rndnum1 = rand(1, 12); $rndnum2 = rand(1, 12); echo "<h3>". $rndnum1 . " x "; echo $rndnum2 . "</h3>"; if($_SERVER["REQUEST_METHOD"] == "GET") { $answer=0; } else if($_SERVER["REQUEST_METHOD"] == "POST") { $answer=trim($_POST["answerInput"]); $check=$rndnum1*$rndnum2; if($answer==$check) { echo "Correct!"; } else { echo "Wrong!"; } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" > <table> <tr> <td> First Name:&nbsp; </td> <td> <input type="text" name="answerInput" value="<?php echo $answer; ?>" size="20"/> </td> <td> <?php echo $answerError; ?> </td> </tr> <tr> <td class="signupTd" colspan="2"> <input type="submit" name="submit" value="Submit"/> </td> </tr> </table> </form>

    Read the article

  • Storing info in a PostgreSQl database issue

    - by MrEnder
    Ok I am making a registry for my website. First page asks for some personal info if($error==false) { $query = pg_query("INSERT INTO chatterlogins(firstName, lastName, gender, password, ageMonth, ageDay, ageYear, email, createDate) VALUES('$firstNameSignup', '$lastNameSignup', '$genderSignup', md5('$passwordSignup'), $monthSignup, $daySignup, $yearSignup, '$emailSignup', now());"); $query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$emailSignup', now());"); $userNameSet = $emailSignup; $_SESSION['$userNameSet'] = $userNameSet; header('Location: signup_step2.php'.$rdruri); } The first query works. The second query works but doesn't save the email... the session doesn't work but the header works and sends me to the next page I get no errors even if I comment out header next page @session_start(); $conn = pg_connect("host=localhost dbname=brittains_db user=brittains password=XXXX" ); $signinCheck = false; $checkForm = ""; if(isset($_SESSION['$userName'])) { $userName = $_SESSION['$userName']; $signinCheck = true; $query = pg_query("UPDATE chatterprofileinfo SET lastLogin='now()' WHERE email='$userName'"); } if(isset($_SESSION['$userNameSet'])) { $userName = $_SESSION['$userNameSet']; $signinCheck = true; $query = pg_query("UPDATE chatterprofileinfo SET lastLogin='now()' WHERE email='$userName'"); } This is the top starting the session depending on if your logged in or not. then if I enter in the info here and put it through this if($error==false) { $query = pg_query("UPDATE chatterprofileinfo SET aboutSelf='$aboutSelf', hobbies='$hobbies', music='$music', tv='$tv', sports='$sports', lastLogin='now()' WHERE email='$userName'") or exit(pg_last_error()); //header('Location: signup_step3.php'.$rdruri); } nothing shows up for on my database from this. I have no idea where I went wrong the website is http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/

    Read the article

  • Jquery Resizable Issue

    - by MrEnder
    Ok my windows are supposed to be resizable... the web site is http://opentech.durhamcollege.ca/~intn2201/brittains/labs/ my code is document.writeln('<object id="cursorObj" width="0" height="0" >'); document.writeln('<param name="movie" value="flash/cursor.swf" name="wmode" value="transparent">'); document.writeln('<embed id="cursorEmbed" src="flash/cursor.swf" width="0" height="0" style="position: absolute;" wmode="transparent">'); document.writeln('</embed>'); document.writeln('</object>');*/ var browser=navigator.appName; var frameWidth = ""; var frameHeight = ""; var d = new Date(); var year = d.getFullYear(); var date = ""; var menuCheck = false; var si = ""; var io = ""; var windowT = ""; var cursorObj = ""; var cursorEmbed = ""; var windowState = false; var windowBody = ""; var bgImage_JS = document.getElementById("bgImage"); var desktop_JS = document.getElementById("desktop"); var menuBar_JS = document.getElementById("menuBar"); var menuBarButton_JS = document.getElementById("menuBarButton"); var menuBarContainer_JS = document.getElementById("menuBarContainer"); var menuBarClock_JS = document.getElementById("menuBarClock"); var action1_JS = document.getElementById("action1"); var action2_JS = document.getElementById("action2"); var action3_JS = document.getElementById("action3"); var showdesktopButton_JS = document.getElementById("menuBarButtonShowdesktopInput"); var windowExitImage_JS = document.getElementById("windowExitImage"); /*if(browser!="Netscape") { windowExitImage_JS.style.top = "-25px"; }*/ function requestWindow(url) { if(windowState==false) { windowOpen(); requestWindowInput() } else if(windowState==true) { windowClose(); } if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET",url,false); xmlhttp.send(null); } function requestWindowInput() { document.getElementById('action1').innerHTML=xmlhttp.responseText; } function requestdesktop(url) { if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET",url,false); xmlhttp.send(null); document.getElementById('desktop').innerHTML=xmlhttp.responseText; } requestdesktop('desktop.php'); function reset() { if (self.innerWidth) { frameWidth = self.innerWidth; frameHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientWidth) { frameWidth = document.documentElement.clientWidth; frameHeight = document.documentElement.clientHeight; } else if (document.body) { frameWidth = document.body.clientWidth; frameHeight = document.body.clientHeight; } /*cursorObj = document.getElementById("cursorObj"); cursorEmbed = document.getElementById("cursorEmbed");*/ if(browser!="Netscape") { bgImage_JS.style.top = 8 + "px"; bgImage_JS.style.left = 8 + "px"; desktop_JS.style.top = 8 + "px"; desktop_JS.style.left = 8 + "px"; menuBar_JS.style.top = (frameHeight - 45) + "px"; menuBar_JS.style.left = 8 + "px"; desktop_JS.style.width = "24px"; } bgImage_JS.style.width = (frameWidth - 21) + "px"; bgImage_JS.style.height = (frameHeight - 51) + "px"; desktop_JS.style.width = (frameWidth - 20) + "px"; desktop_JS.style.height = (frameHeight - 50) + "px"; menuBar_JS.style.width = (frameWidth - 20) + "px"; menuBar_JS.style.top = (frameHeight - 40) + "px"; menuBarClock_JS.style.left = (frameWidth - 100) + "px"; /*cursorEmbed.style.width = (frameWidth - 20) + "px"; cursorEmbed.style.height = (frameHeight - 20) + "px"; cursorEmbed.style.width = (frameWidth - 20) + "px"; cursorEmbed.style.height = (frameHeight - 20) + "px";*/ t=setTimeout('reset()',500); } function menuSize() { action3_JS.style.backgroundColor = "black"; action3_JS.style.color = "#C0C0FF"; action3_JS.style.border = "1px solid #C0C0FF"; action3_JS.style.width = "250px"; action3_JS.style.height = "400px"; action3_JS.style.padding = "5px"; if(browser!="Netscape") { action3_JS.style.top = (frameHeight - 452) + "px"; var winCheck = frameWidth - 1651; if(winCheck<=0) { action3_JS.style.left = 8 + "px"; } else { action3_JS.style.left = (frameWidth - 1672) + "px"; } } else { action3_JS.style.top = (frameHeight - 452) + "px"; var winCheck = frameWidth - 1672; if(winCheck<=0) { action3_JS.style.left = 8 + "px"; } else { action3_JS.style.left = (frameWidth - 1672) + "px"; } } //menuT=setTimeout('menuSize()',500); } function menu() { if(menuCheck==false) { var lab1 = "'lab1.php'"; var lab2 = "'lab2.php'"; var lab3 = "'lab3.php'"; var lab4 = "'lab4.php'"; var lab5 = "'lab5.php'"; var lab6 = "'lab6.php'"; menuSize(); action3_JS.innerHTML = '<input type="button" class="menuButtons" id="menuButton1" value="Lab1" onclick="requestWindow(' + lab1 + ')" /><input type="button" class="menuButtons" id="menuButton2" value="Lab2" onclick="requestWindow(' + lab2 + ')" /><input type="button" class="menuButtons" id="menuButton3" value="Lab3" onclick="requestWindow(' + lab3 + ')" /><input type="button" class="menuButtons" id="menuButton4" value="Lab4" onclick="requestWindow(' + lab4 + ')" /><input type="button" class="menuButtons" id="menuButton5" value="Lab5" onclick="requestWindow(' + lab5 + ')" /><input type="button" class="menuButtons" id="menuButton6" value="Lab6" onclick="requestWindow(' + lab6 + ')" /><input type="button" class="menuButtons" id="menuButtonShowdesktop" value="Show desktop" onclick="showDesktop()" />'; menuCheck=true; } else if(menuCheck==true) { action3_JS.style.backgroundColor = "transparent"; action3_JS.style.border = "0px solid #C0C0FF"; action3_JS.style.width = "0px"; action3_JS.style.height = "0px"; action3_JS.style.padding = "0px"; action3_JS.style.top = "0px"; action3_JS.style.left = "0px"; action3_JS.innerHTML = ""; //window.clearTimeout(menuT); menuCheck=false; } } function clearMenu() { action3_JS.style.backgroundColor = "transparent"; action3_JS.style.border = "0px solid #C0C0FF"; action3_JS.style.width = "0px"; action3_JS.style.height = "0px"; action3_JS.style.padding = "0px"; action3_JS.style.top = "0px"; action3_JS.style.left = "0px"; action3_JS.innerHTML = ""; menuCheck=false; //menuT=setTimeout('clearMenu()',500); } function showDesktop() { clearMenu(); action1_JS.style.display = "none"; action1_JS.style.backgroundColor = "transparent"; action1_JS.style.border = "0px solid #C0C0FF"; action1_JS.style.width = 0 + "px"; action1_JS.style.height = 0 + "px"; action1_JS.style.left = 0 + "px"; action1_JS.style.top = 0 + "px"; window.clearInterval(si); window.clearTimeout(windowT); windowState = false; } function windowSize() { action1_JS.style.backgroundColor = "black"; action1_JS.style.color = "#C0C0FF"; action1_JS.style.border = "1px solid #C0C0FF"; action1_JS.style.width = (frameWidth - 375) + "px"; action1_JS.style.height = (frameHeight - 200) + "px"; action1_JS.style.left = (frameWidth - 1500) + "px"; var winCheck1 = (frameWidth - 1500); if(winCheck1<=0) { action1_JS.style.left = (frameWidth - 850) + "px"; } winCheck1 = (frameWidth - 850); if(winCheck1<=0) { action1_JS.style.left = (frameWidth - 300) + "px"; action1_JS.style.width = (frameWidth - 50) + "px"; } action1_JS.style.top = (frameHeight - 750) + "px"; var winCheck2 = (frameHeight - 750); if(winCheck2<=0) { action1_JS.style.top = (frameHeight - 500) + "px"; } //windowT=setTimeout('windowSize()',500); $(function() { $("#action1").resizable(); }); } function windowOpen() { windowSize(); action1_JS.style.display = "none"; $("#action1").fadeIn(1300); setTimeout("requestWindowInput()", 100); windowState = true; clearMenu(); } function windowClose() { action1_JS.style.display = ""; $("#action1").fadeOut(1300); windowState = false; clearMenu(); setTimeout("windowOpen()", 1350); } function windowDragStart() { $(function() {$("#action1").draggable( {disabled: false} );}); } function windowDragEnd() { $(function() {$("#action1").draggable( {disabled: true} );}); } function windowExitMouseover() { document.getElementById("windowExitImage").src = "images/exit2.png"; } function windowExitMouseout() { document.getElementById("windowExitImage").src = "images/exit1.png"; } $(function() { $("#action1").resizable(); }); I'm trying to use $(function() { $("#action1").resizable(); }); to resize my #action1 div sorry for the long code =[ not sure whats breaking it is why I sent everything

    Read the article

  • PostgreSQL and PHP forms

    - by MrEnder
    Ok I have a PostgreSQL server with a Database titled brittains_db that I only have PuTTY access to. I can also upload via FTP to the web server which has access to PostgreSQL and the Database somehow... I have made a SQL file named logins.sql CREATE TABLE logins( userName VARCHAR(25) NOT NULL PRIMARY KEY, password VARCHAR(25) NOT NULL, firstName NOT NULL, lastName NOT NULL, ageDay INTEGER NOT NULL, ageMonth INTEGER NOT NULL, ageYear INTEGER NOT NULL, email VARCHAR(255) NOT NULL, createDate DATE ) Then I made a form to get all that information. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" > <table> <tr> <td class="signupTd"> First Name:&nbsp; </td> <td> <input type="text" name="firstNameSignupForm" value="<?php echo $firstNameSignup; ?>" size="20"/> </td> <td> <?php echo $firstNameSignupError; ?> </td> </tr> ... code continues I had it save all the information in variables if page run on POST $firstNameSignup=trim($_POST["firstNameSignupForm"]); $lastNameSignup=trim($_POST["lastNameSignupForm"]); $userNameSignup=trim($_POST["userNameSignupForm"]); $passwordSignup=trim($_POST["passwordSignupForm"]); $passwordConfirmSignup=trim($_POST["passwordConfirmSignupForm"]); $monthSignup=trim($_POST["monthSignupForm"]); $daySignup=trim($_POST["daySignupForm"]); $yearSignup=trim($_POST["yearSignupForm"]); $emailSignup=trim($_POST["emailSignupForm"]); $emailConfirmSignup=trim($_POST["emailConfirmSignupForm"]); All information was then validated Now comes the points where I need to upload it to PostgreSQL How do I put my table in Postgre? How do I insert my information into my table? and how would I recall that information to display it?

    Read the article

  • PHP strlen question

    - by MrEnder
    Ok I am checking that a string is at least 4 characters long and 25 or less characters short I tried to use strlen like this $userNameSignupLength = strlen($userNameSignup); else if($userNameSignupLength<4 && $userNameSignupLength>25) { $userNameSignupError = "Must be between 4 to 25 characters long"; } but it doesn't work... what did I do wrong?

    Read the article

  • Login Script for PostGreSQL and PHP not working =[

    - by MrEnder
    Ok I'm quite new at logins what not so bare with me here lol but I gota learn so don't discourage me. I tried this so far <?php $error = ""; $conn = pg_connect("host=localhost dbname=brittains_db user=brittains password=XXXX" ); $sql = "SELECT * FROM logins"; $result = pg_query($conn, $sql); if($_SERVER["REQUEST_METHOD"] == "GET") { $userName=""; $password=""; } else if($_SERVER["REQUEST_METHOD"] == "POST") { $userName=trim($_POST["userNameLogin"]); $password=trim($_POST["passwordLogin"]); if(pg_fetch_result($results, $userName, "userName")==true && pg_fetch_result($results, $password, "userName")==true) { setcookie("userIDforDV", $userName, time()+43200); } else { $error = "Your username and or password is incorrect"; } } $userName = $_COOKIE['userIDforDV']; if(isset($userName) && $userName!="") { echo "Welcome " . $userName; } echo $error; ?> <form> <table> <tr> <td class="signupTd"> User Name:&nbsp; </td> <td> <input type="text" name="userNameLogin" value="" size="20" /> </td> </tr> <tr> <td class="signupTd"> Password:&nbsp; </td> <td> <input type="password" name="passwordLogin" value="" size="20" /> </td> </tr> <tr> <td class="signupTd" colspan="2"> <input type="submit" name="submit" value="Submit"/> </td> </tr> </table> </form> that was the idea I came up with... but its prolly a really bad idea and it doesn't work... how might I go about this properly? I need really detailed descriptions please. Thanks a tun Shelby

    Read the article

  • PHP Form Validation Regular Expression, no symbols or numbers

    - by MrEnder
    Ok I am trying to get the users First Name the form gets their name perfectly fine and posts it into a variable. Now I am trying to do error checking else if(!preg_match("/^[\w-]+$/", $firstNameSignup)) { $firstNameSignupError = "Your first name cannot contain numbers or symbols, you entered " . $firstNameSignup; $firstNameSignup = ""; } I tried the above code and it does not like me but my if statement if(!isset($firstNameSignup) || $firstNameSignup == "") { $firstNameSignupError = "You must enter your first name"; } works fine so I know that the error is in that else if statement... most likely in my regular expression any help??? I'm totally at a loss (really new to PHP and regular expressions) Thanks Shelby

    Read the article

  • .type error in IE

    - by MrEnder
    The line <input type="text" name="passwordLogin" value="Password" onfocus="if(this.value=='Password'){this.value=''; this.type='password'};" onblur="if(this.value==''){this.value='Password'; this.type='text'};" size="25" /> works in all web browsers except IE... how can I fix it for IE?

    Read the article

  • Registration Form check PostgreSQL is username is already taken

    - by MrEnder
    Hey I'm really new to PHP and PostgreSQP or any database in that matter. So I'm at a loss how to do this. I need an if statement that says. If(the username user just typed in is already in database) { my code here } the variable the username that the user just typed in is $userNameSignup how would I do that with PHP for PostgreSQL? also how might I redirect people to a new page once they have completed the form properly? Thanks Shelby

    Read the article

  • Updating specific area of table in postgresql

    - by MrEnder
    Ok I am trying to update a specific area of a table in postgresql I want it to find the user that goes along with the table and then update the information I have like in this case the email is the user name that it needs to look for. it needs to add in areas like $aboutSelf, $hobbies, $music, $tv, $sports so ya I have no idea how to do this lol ^.^ I only know how to add stuff from scratch. like create a non existing user

    Read the article

  • Web Page Opinions and Suggestions

    - by MrEnder
    Been working my * off on this for a few days trying to keep updating it to make it most efficient with everything I learn... I'm quite proud of it so far considering I'm not actually the best coder lol most JS and PHP confuses the crap outa me unless I do it from scratch. So anyways here is the link. Tell me what you think. Suggestions would be amazing. I'd love to know what I screwed up as long as you explain in detail as to why and how to fix it. I really hate when people hand me a huge snippet and expect me to understand it -_- Thanks Shelby LINK http://opentech.durhamcollege.ca/~in...rittains/labs/

    Read the article

  • Simple Tableless Positioning issue: Trying to float Div right on same line

    - by MrEnder
    Ok I just started a template for a website http://clickforclicks.com/design1/ I'm trying to make it tableless. Notice I have a red div along the side. I tried to get one on the otherside aswell that looked the same. But when I do it. It goes to a new line =[ How might I get this effect without using Javascript or Absolute positioning that wont look proper on all resolution sizes.

    Read the article

  • Web page looks good in Firefox but every other browser hates it

    - by MrEnder
    I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/ Please give solutions that don't involve JavaScript.

    Read the article

  • Float Issue in IE

    - by MrEnder
    Ok I am making a simulated OS type interface. It should open up windows and have a drag handle. This all works perfectly. Then I added a image for an exit button I floated to the right... this made IE mad and IE screwed with the sizing and positioning =[ I've tried a crap load of things. None of which work. Anyone wana help? website is http://opentech.durhamcollege.ca/~intn2201/brittains/labs/ Thanks Shelby

    Read the article

  • Changing the <input> type in IE with JavaScript

    - by MrEnder
    The line <input type="text" name="passwordLogin" value="Password" onfocus="if(this.value=='Password'){this.value=''; this.type='password'};" onblur="if(this.value==''){this.value='Password'; this.type='text'};" size="25" /> works in all web browsers except IE... How can I fix it for IE? Ok made some changes to still have an error I want it to work like this like here <input type="text" name="usernameLogin" value="Email" onfocus="if(this.value=='Email'){this.value=''};" onblur="if(this.value==''){this.value='Email'};" size="25" /> if I dont enter anything it will put the value back So I tried this <td colspan="2" id="passwordLoginTd"> <input id="passwordLoginInput1" type="text" name="passwordLogin" value="Password" onfocus="passwordFocus()" size="25" /> <input id="passwordLoginInput2" style="display: none;" type="password" name="passwordLogin" value="" onblur="passwordBlur()" size="25" /> </td> <script type="text/javascript"> //<![CDATA[ passwordElement1 = document.getElementById('passwordLoginInput1'); passwordElement2 = document.getElementById('passwordLoginInput2'); function passwordFocus() { passwordElement1.style.display = "none"; passwordElement2.style.display = "inline"; passwordElement2.focus(); } function passwordBlur() { if(passwordElement2.value=='') { passwordElement2.style.display = "none"; passwordElement1.style.display = "inline"; passwordElement1.focus(); } } //]]> </script> as you can see the blur does not work =[ ok finally got it thanks to the help needed to remove passwordElement1.focus();

    Read the article

  • PHP error can't figure it out something to do with SQL stuff I think

    - by MrEnder
    Ok the error is showing up somewhere in this here code if($error==false) { $query = pg_query("INSERT INTO chatterlogins(firstName, lastName, gender, password, ageMonth, ageDay, ageYear, email, createDate) VALUES('$firstNameSignup', '$lastNameSignup', '$genderSignup', md5('$passwordSignup'), $monthSignup, $daySignup, $yearSignup, '$emailSignup', now());"); $query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$email', now())";); $_SESSION['$userNameSet'] = $email; header('Location: signup_step2.php'.$rdruri); } anyone see what I did wrong??? sorry for being so unspecific but ive been staring at it for 10 mins and I can't figure it out.

    Read the article

  • Web page looks good in FF but every other browser hates it

    - by MrEnder
    I am trying to make my own website and it was comming along quite nicely. It looked beautiful in firefox when opened and worked wonderfully. But then I run it in any other browser... and it screwes up... how can I fix this? IE especially hates it =[ you just gota see it to know what I'm talking about so here is the link http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/ please give solutions that don't involve javascript. Thanks Shelby

    Read the article

  • How to make an object go to a higher layer

    - by MrEnder
    I want this to be on top... how can I do this and not have it go underneath... http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/signup_step2.php I think there is a way in CSS to make stuff go on higher layers I think I read something about it a few years ago but I forget what its called.

    Read the article

  • Looking for Opinions and Sugestions on my Website. (General Question)

    - by MrEnder
    I am looking for general opinions and suggestions about the site in whole. Its ok I don't mind hearing where I went wrong on anything. I'm still learning. All tips and pointers on any subject relating are highly welcome. If you are going to make a suggestion and post a snippet or code please explain how it works in detail. The site was design as a interface to display the labs I have to do in my college (the labs are all basic things that I'm way beyond). So I decided to take it all to the next level with this. The link is http://opentech.durhamcollege.ca/~intn2201/brittains/labs/ It is 100% designed by me with the exception of the icons. (I could not think of anything better to draw) There is no specific area of the site I want suggestions or opinions on this is a general question. You may answer about the site in whole or an area of the coding just please specify. If you have any questions related to my site or code you may ask them as well. Thank you for your time and any comments Shelby

    Read the article

1