Jump to content

giannis196

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About giannis196

  • Rank
    Newbie
  1. Hi everyone, i made a test webpage and i noticed the page is different between chrome and firefox and so i am here to ask if there is any way to ensure compatibility (both cross browser and cross device) without using any framework. Is there any "trick" to do that? So, what do you do to ensure the compatibility to webpages? Thanks! (btw i don't think i can post the page here because i have very limited bandwidth since i have the "free account") I am attaching 2 images, the 1 is from chrome and the other is from firefox So, why do i have this micro-difference? Thanks! Chrome.bmp Firefox.bmp
  2. Ok, i found it! it couldn't found it because it was in the function that i wasn't run it yet!
  3. Hi everyone, so today i started writing a page in PHP until i got this error message: Notice: Undefined variable: query in C:\Users\Ioann\usbwebserver\root\carshop\index.php on line 19 The variable query is defined in functions.php and yet it still thinks it's undefined my functions.php <?php $host="localhost"; $username="root"; $password="usbw"; $dbname="test"; $pdo= new PDO("mysql:host=$host; dbname=$dbname", $username, $password, [PDO::MYSQL_ATTR_INIT_COMMAND =>"SET NAMES utf8"]); try{ } catch(PDOException $e){ echo "error please try again"; } function appearcars(){ $select = $pdo ->prepare("SELECT * FROM `carshopdatabase` "); $select ->execute(); $query = $select ->fetch(); } ?> and the index.php <?php require("functions.php"); ?> <html> <head><title>car shop - educational purposes please don't take anything seriously!!</title> <link rel="stylesheet" type="text/css" href="style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="utf-8" http-equiv="encoding"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> </head> <body> <div id="a">Our shop have the best cars around!!!</div> <div id="lmenu"><ul> <li class="top">Home</li> <li>Browse cars</li> <li>Spare parts</li> <li class="bottom">Contuct us</li> </ul></div> <div id="carlist"><?php echo $query[1]["cost"]; ?></div> <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> <script src="scripts.js"></script> </body> </html> so, what's going wrong here?
  4. Ok guys i found it! i should put my query between `` SELECT * FROM `carshopdatabase ` is the correct query!
  5. Hi everyone, i am using mysql for database and when i am trying to run the query SELECT * FROM carshopdatabase i got the following error message: SELECT * FROM carshopdatabase LIMIT 0, 25 So, why is this happening and how do i fix it? Thanks!
  6. Hi everyone, i am trying to make a ajax page that’s fully crawl-able from search engine so search engines can find it but i need to know how i can insert the search bar’s value in to a variable so i can process it and make a script that will load with ajax the content: Here is the script that i make but i don’t know how i can fill the hpage (h for hash) with search bat value window.addEventListener("hashchange", function(){ var page=$(this).attr("data-id"); var hpage= $("#content").load("content/"+page); }) how i can insert the search bar’s value to the hpage? Can someone tell me how to do that? Thanks!! I also use jQuery too! Just to give some explanations… The script works, when i click somewhere it will load the content of the file to the #content div but the search engines can’t find the site. I need to make something like php’s $_GET but with javascript or jQuery so a user can even copy paste the link to other user. Right now when i try to copy paste the link it will take me to the index page (home page) but with different link. Search engines will be confused or ignore it because it’s the same page. Even if they don’t ignore it, when a user clicks the link ex: OurBrandCompany/#/content/ourhistory it will take him/her to home page instead of the page that shows “our history”) so…it will have ex: localhost/#/content/Ourhistory to the search bar but the user will be in the index page (home page) That’s the why i need to know how i can load the search bar’s value to a variable so i can process it and make it work.
  7. ok i figured out what's wrong with the dropdown i had add a css style to the entire navbar i still have 2 more problems that i can't figure out: 1) the dropdown menu (at "Contact") adding space to the left as a result it's moving when someone hover the mouse over it 2) the Smenu that's at the left stills moving down when the dropdown menu opens here is my html code: <html> <head> <title>Website</title> <link rel="stylesheet" type="text/css" href="Style.css"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta content="utf-8" http-equiv="encoding"> </head> <body> <div class="navmenubg">&nbsp;</div> <div> <ul class="navmenu"> <li><a href="#Home">Home</a></li> <li><a href="#News">News</a></li> <li id="rolldown"><a href="#Contact"><span id="sArrow">Contact&#9660;</span></a> <ul class="dropdown"> <li>telephones</li> <li>email</li> <li>mail</li> <li>fax</li> </ul> </li> </ul> <div> <div id="container"> This is our website, feel free to contact us if you don't find something that you need. </div> </div> <div id="Smenu"> <div> <ul> <a href="#history"><li class="top">Our history</li></a> <a href="#workers"><li>Our workers</li></a> <a href="#buildings"><li>Our buildings</li></a> <a href="#tools"><li>Our tools</li></a> <a href="#targets"><li>Our targets</li></a> <a href="#ourjob"><li>Our job so far</li></a> <a href="#havedone"><li class="bottom">What we've done</li></a> </ul> </div> </div> </div> </body> </html> and here is my css code: html, body { margin: 0; } html{ height: 100%; background-image: linear-gradient(rgb(189, 189, 189), rgb(88, 88, 88)) } /*-------------navmenu---------*/ .navmenubg{ background-color: rgba(255, 217, 0, 0.5); position: fixed; left: 0px; width: 100%; opacity: 10%; height: 43px; z-index: -60000; } .navmenu{ overflow: hidden; text-decoration: none; display: block; font-size: 20px; color: white; margin-top: 1%; } .navmenu a{ text-decoration: none; } .navmenu li{ float: left; color: darkslategray; list-style-type: none; padding-right: 50px; padding-left: 50px; padding-top: 10px; padding-bottom: 10px; font-size: 100%; } .navmenu li:hover{ background-color: lightgreen; } .navmenu li:active{ background-color: darkgreen; color: lightgray; } .dropdown{ display: none; } #rolldown:hover > .dropdown, .dropdown:hover{ display: block; background-color: lightgreen; } #rolldown:hover > .dropdown, .dropdown:active{ display: block; background-color: darkgreen; } .dropdown{ width: 200px; z-index: -2; } /*---------Smenu--------------*/ #Smenu .bottom{ border-radius: 0px 0px 10px 10px; } #Smenu .top{ border-radius: 10px 10px 0px 0px; } #Smenu ul{ text-align: center; } #Smenu ul li{ font-size: 150%; margin-left: -40px; list-style-type: none; padding-bottom: 5%; padding-top: 5%; } #Smenu{ transform: translateY(30%); left: 1%; width: 10%; position: relative; background-color: greenyellow; border-radius: 10px 10px 10px 10px; } #Smenu a:visited{ color: darkblue; } #Smenu a:link{ color: darkblue; text-decoration: none; } #Smenu li:hover{ background-color: green } #Smenu li:active{ background-color: darkgreen; color: blue; } /*------------container---------*/ @media all and (orientation: landscape){ #container{ position: absolute; left: 20%; top: 30%; min-height: 40%; min-width: 60%; background-color: rgba(100, 200, 255, 50%); z-index: -20; } } @media all and (orientation: portrait){ #container{ position: absolute; left: 20%; top: 30%; min-height: 60%; min-width: 30%; background-color: rgba(100, 200, 255, 50%); } } #container{ border: 5px solid black; border-radius: 0px 15px 0px 15px; } can someone figure out how to solve those 2 problems? Thanks!
  8. hi, yesterday i started to write code of a page for fun and i came across one problem. my dropdown menu takes the entire line + it push down the left menu (it's id is Smenu for "small menu") here is my html code: <html> <head> <title>Website</title> <link rel="stylesheet" type="text/css" href="Style.css"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta content="utf-8" http-equiv="encoding"> </head> <body> <div> <ul class="navmenu"> <li><a href="#Home">Home</a></li> <li><a href="#News">News</a></li> <li id="rolldown"><a href="#Contact"><span id="sArrow">Contact&#9660;</span></a> <ul class="dropdown"> <li>telephones</li> <li>email</li> <li>mail</li> <li>fax</li> </ul> </li> </ul> <div> <div id="container"> This is our website, feel free to contact us if you don't find something that you need. </div> </div> <div id="Smenu"> <div> <ul> <a href="#history"><li class="top">Our history</li></a> <a href="#workers"><li>Our workers</li></a> <a href="#buildings"><li>Our buildings</li></a> <a href="#tools"><li>Our tools</li></a> <a href="#targets"><li>Our targets</li></a> <a href="#ourjob"><li>Our job so far</li></a> <a href="#havedone"><li class="bottom">What we've done</li></a> </ul> </div> </div> </div> </body> </html> and here is my css code: html, body { margin: 0; } html{ height: 100%; background-image: linear-gradient(rgb(189, 189, 189), rgb(88, 88, 88)) } /*-------------navmenu---------*/ .navmenu{ overflow: hidden; background-color: gold; text-decoration: none; display: block; font-size: 20px; color: white; text-align: center; margin-top: 1%; } .navmenu a{ text-decoration: none; } .navmenu li{ float: left; color: darkslategray; list-style-type: none; padding-right: 50px; padding-left: 50px; padding-top: 10px; padding-bottom: 10px; font-size: 100%; } .navmenu li:hover{ background-color: lightgreen; } .navmenu li:active{ background-color: darkgreen; color: lightgray; } .dropdown{ display: none; } #rolldown:hover > .dropdown, .dropdown:hover{ display: block; background-color: lightgreen; } #rolldown:hover > .dropdown, .dropdown:active{ display: block; background-color: darkgreen; } .dropdown{ width: 200px; z-index: -2; } /*---------Smenu--------------*/ #Smenu .bottom{ border-radius: 0px 0px 10px 10px; } #Smenu .top{ border-radius: 10px 10px 0px 0px; } #Smenu ul{ text-align: center; } #Smenu ul li{ font-size: 150%; margin-left: -40px; list-style-type: none; padding-bottom: 5%; padding-top: 5%; } #Smenu{ transform: translateY(30%); left: 1%; width: 10%; position: relative; background-color: greenyellow; border-radius: 10px 10px 10px 10px; } #Smenu a:visited{ color: darkblue; } #Smenu a:link{ color: darkblue; text-decoration: none; } #Smenu li:hover{ background-color: green } #Smenu li:active{ background-color: darkgreen; color: blue; } /*------------container---------*/ @media all and (orientation: landscape){ #container{ position: absolute; left: 20%; top: 30%; min-height: 40%; min-width: 60%; background-color: rgba(100, 200, 255, 50%); z-index: -20; } } @media all and (orientation: portrait){ #container{ position: absolute; left: 20%; top: 30%; min-height: 60%; min-width: 30%; background-color: rgba(100, 200, 255, 50%); } } #container{ border: 5px solid black; border-radius: 0px 15px 0px 15px; } so, what's wrong with it? 1) why does it takes the entire line 2) why does it push down the "Smenu"? Thanks!
×
×
  • Create New...