But how can i do that, how to include the "menu.html" file into another file for example index.html
But how can i do that, how to include the "menu.html" file into another file for example index.html
Hey everyone i have a little problem with the navigation bar, i have created the design of the menu but i want to be in one file (menu.html) and to show on all pages in the website... here is my code for menu.html
<html>
<body>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<style>
form.position-and-style {
opacity:1;
position:absolute;
border-radius:20px;
width:150px;
left:-1%;
top:10%;
height:100px;
background-color:white;
border:1px solid gray;
}
#pocetna {
opacity:1;
position:absolute;
top:10%;
left:20%;
font-feature-settings:normal;
font-style:normal;
font-family:sans-serif;
font-size:15px;
}
#kontakt {
opacity:1;
position:absolute;
top:70%;
left:20%;
font-feature-settings:normal;
font-style:normal;
font-family:sans-serif;
font-size:15px;
}
</style>
<form class='position-and-style'>
<a id='pocetna' href='index.html'><b>Почетна</b></a>
<a id='kontakt' href='sleden_cekor.html'><b>Контакт</b></a>
</form>
</body>
</html>
Tell me how can i make this menu appear on all sites i have with out copy and pasting the same code in every single page.
Thank you :)
Theres much error lines i cannot copy and paste it all that.. but the first line is: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
but i have the MySQL-Connector...
Actualy the score is taken from mysql database and all i want to make is to read the score on application start up, im sorry i forgot to write this..
I have this code but it doesnt work application is crashing or not showing the results...
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://DATABASE", "USERNAME", "PASSWORD");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from BackgammonResults");
while (rset.next()) {
asd = rset.getInt("Stefan"); // local variable
asd1 = rset.getInt("Bojan"); // local variable
}
stefanRes.setText(asd);
bojanRes.setText(asd1);
} catch (Exception e) {
e.printStackTrace();
}
Hello i need to save score on application close and when will start up to show the last score is entered... i have not idea how do i start i have searched on google but nothing found which can help me, please show me some ways/codes of doing it.
Thanks ! :)
I have download that driver and place it into jre8
but now its showing me some error which is wierd com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user 'StefanRafa'@'%' to database 'users'
I have the right username and password but i dont know why the access is denied...
can u tell me what to add to my project and how do i do that ?
Please someone help me ??? :/
Hello im trying to connect database with my java program for register/login but im not doing well, i have online database on godaddy and i cannot connect with the java program i tryed with using the URLEncoder
and it works for registering but for loging in i cannot make it please help me to connect it...
show me the code and i will just change the host, username and password ...
Thank you ! :)
Ok thank you but now the problem is i dont know my "host" i have Database in godaddy, can anyone tellme how to find it ?
Hello guys i have question how is the right way to write the mysqli_connect ?
$con=mysqli_connect("username","host","password","db_name");
Please tell me if im wrong and how to fix it.
Thanks ! :)
Feel free to reply if somebody know how to solve this problem
Visit it now its online and look what im talking about...
I just want the website to look beautifull on every screen no matter does its big or small...
Hello everyone im trying to make a website for movies so its pretty simple with movie boxes but the poblem is i dont want to do it like every single movie i add i need to write a new code in index.html
so is there a way to skip this part of coding and make it eazy padding on every movie so to have 10px distance between the boxes...
Here is my Website you can see it what im trying to say.
Thank you all :)
I have change it to this but nothing happens when i run it ...
if (cmd.equals(AdminCommands[1])) {
String player = scanner.next();
int money = scanner.nextInt();
File folder = new File(player);
File pFile = new File(folder, player + ".txt");
File bFile = new File(folder, money + ".txt");
if (pFile.exists() && bFile.exists()) {
try {
Account pAcc = new Account(player, money);
if(pAcc.admin != 1) {
try {
writer = new BufferedWriter(new FileWriter(bFile));
writer.write(player);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
writer.close();
} catch (Exception e) {
}
}
LabelInfo.setText("Money transfer complited ! ( " + money + " ) to ( " + pAcc.name + " )");
} else {
LabelInfo.setText("You can't transfer money to an admin!");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Username doesn't exist!");
}
}
}
Hello everybody i have a little problem with making a java command for program i have some code but i do not know how to continue i stuck in one place BTW the command i want to make is
/sendcash [username] [money] // how it looks like
I have this code
if (cmd.equals(AdminCommands[1])) {
String player = scanner.next();
String money = scanner.next();
File folder = new File(player);
File pFile = new File(folder, player + ".txt");
File bFile = new File(folder, money + ".txt");
if (pFile.exists() && bFile.exists()) {
try {
Account playerAccount = new Account(player, money);
// Sending money code here ... how to transfer it ?
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Username doesn't exist!");
}
}
} else {
LabelInfo.setText("Command doesn't exist!");
}
So after the Account playerAccount ... i don't know how to continue to transfer the money...
Thanks for your time :)
Guys everything have beggining and END you know that clearly... MySpace, HI5, Messenger... and much other sites have been shuted down because facebook and facebook will be shuted down after some year and i guess it will 2017
If yahoo start social networking then he can
Its all about how they will advertise them selfs ... but yeah its good idea ! :)
Once again: what was the exact exception stack trace?
Sorry i didn't see it..
Here is it all:
02-04 11:58:56.335: W/System.err(2378): android.os.NetworkOnMainThreadException
02-04 11:58:56.335: W/System.err(2378): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
02-04 11:58:56.335: W/System.err(2378): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
02-04 11:58:56.345: W/System.err(2378): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
02-04 11:58:56.345: W/System.err(2378): at java.net.InetAddress.getByName(InetAddress.java:289)
02-04 11:58:56.345: W/System.err(2378): at com.kafic.rafa.MainActivity$1.onClick(MainActivity.java:77)
02-04 11:58:56.345: W/System.err(2378): at android.view.View.performClick(View.java:4204)
02-04 11:58:56.345: W/System.err(2378): at android.view.View$PerformClick.run(View.java:17355)
02-04 11:58:56.355: W/System.err(2378): at android.os.Handler.handleCallback(Handler.java:725)
02-04 11:58:56.355: W/System.err(2378): at android.os.Handler.dispatchMessage(Handler.java:92)
02-04 11:58:56.355: W/System.err(2378): at android.os.Looper.loop(Looper.java:137)
02-04 11:58:56.355: W/System.err(2378): at android.app.ActivityThread.main(ActivityThread.java:5041)
02-04 11:58:56.355: W/System.err(2378): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 11:58:56.355: W/System.err(2378): at java.lang.reflect.Method.invoke(Method.java:511)
02-04 11:58:56.355: W/System.err(2378): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-04 11:58:56.355: W/System.err(2378): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-04 11:58:56.365: W/System.err(2378): at dalvik.system.NativeStart.main(Native Method)
I have solved the problem but now its crashing the app when no connection..
I have tried on different ways but still showing that "No Internet Connection" but after 1 sec. later it shows that is sended to the database ...
android.os.NetworkOnMainThreadException
Just like this
try {
InetAddress g = InetAddress.getByName("https://www.google.com/");
SocketAddress sockaddr = new InetSocketAddress(g, 80);
Socket socket = new Socket();
socket.connect(sockaddr, 2000);
} catch (Exception e) {
e.printStackTrace();
LabelInfo.setText("No Internet Connection !" + e);
return;
}
It gives me all time NoInternetConnction ... but its sending it ..
Sadly none :/
try a ping before you do anything else.
ping for one or more very reliable sources
(www.google.com, www.facebook.com, www.microsoft.com, ... )
chances of those going offline are pretty slim.
ping fails? (especially for all of them?) it's pretty sure you're not connected.
Im sorry i dont get you, but i like the idea... :D
If you can repeat that ? :D
what about internet connection ? :D
Thank you men :)
Solution: "URL url = new URL("http://secretchatsk.host56.com/some_file.php?search="+URLEncoder.encode(search, "UTF-8"));"
Hello i have a little problem with writing the words in the database, after some space between the words the database can't remember it, thats why because the link eg. ( /some_file.php?search=something%20wierd ) that "%20" its the space between the words but from my mobile application when ill type space doesnt write it into the database... what should i do ? :/
Also i want to give message "You are not connected to the Internet" if is true...
public static String sendSearch(String search) throws Exception {
URL url = new URL("http://secretchatsk.host56.com/some_file.php?search="+search);
URLConnection conn = url.openConnection();
InputStream stream = new BufferedInputStream(conn.getInputStream());
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String line;
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) {
sb.append(line);
}
reader.close();
return sb.toString();
}
Thank You ! :)
Thank you for the answers and does its safe or unsafe to do that ?
I guess you are using jquery for chrome only...
- Post the code
Im asking does its posible to attach video to my website but the video to be in my PC and does its possible to watch it on the site it self from anywhere in the world :)
Hello i choose this title cause i dont know how it calls with the real name but i will try to explain...
Im asking does its possible to put a video on a website which will get the data from my computer so to get rid of uploading the video to the database and stuff.. but that video to can watch anyone in the world not just me and also does it will be fast like it will be if i upload on database or youtube or something else, im not sure that it will be slower im just asking ..
Thank you and if you dont understand clearly what im talking about i will try to explain better :)
I make it like this:
public void onClick(View v) {
String Shortword = word.getText().toString();
for (int i = 0; i < questions.length; i++) {
if (Shortword.equals(questions[i])) {
description.setText(answers[i]);
break;
} else {
description.setText("Word not found.");
return;
}
}
}
but now gives me all time "Word not found"
Hello, im trying to get the answers from the secound array but it takes just the last question and answer hers is the code:
search.setOnClickListener(new View.OnClickListener() {
String[] questions = {
"http",
"arp",
"asd"
};
String[] answers = {
"HyperText Transfer Protocol",
"Advanced Research Project",
"asdasdasdasdasdasdasdasd."
};
@Override
public void onClick(View v) {
String word1 = word.getText().toString();
for (int i = 0; i < questions.length; i++) {
for (int j = 0; j < answers.length; j++) {
if(word1.equals(questions[i])){
description.setText(answers[j]);
} else {
description.setText("We doesn't find that word");
}
}
}
}
});
why this doesnt work and what should i fix ?
I have solved that with the login system:
login.php
<?php
function CheckCookieLogin() {
$username = $_COOKIE['username'];
if (!empty($username)) {
$sql = "SELECT * FROM `users` WHERE `login_session`='$username'";
$_SESSION['user_is_logged_in'] = 1;
$_SESSION['cookie'] = $username;
setcookie("username",$username,time()+3600*24*365,'/','.secretchatsk.host56.com');
echo "<script> document.getElementById('login_position').style.display='none';</script>";
}
}
if(!isset($_SESSION['cookie']) && empty($_SESSION['user_is_logged_in'])) {
CheckCookieLogin();
}
?>
<?php
if($count == 1) {
session_register("myusername");
session_register("mypassword");
session_start();
if(session_is_registered('myusername')) {
echo "<script> document.getElementById('login_position').style.display='none';</script>";
echo "<a id='user_login_info'><br>Welcome <font color='#00FF00'>$user</font></a>";
echo "<a id='user_login_info'><br>Username and Password Accepted</a>";
$_SESSION['user_is_logged_in'] = 1;
$cookiehash = md5(sha1(username . user_ip));
setcookie("username",$cookiehash,time()+3600*24*365,'/','.secretchatsk.host56.com');
$sql = "UPDATE `users` SET `login_session`='$cookiehash' WHERE `Username`='$uid'";
}
}
?>
index.html
<?php
require('login.php');
CheckCookieLogin();
//include('login.php');
?>
But i can't get that with the functions... :/
Doesnt work even with the quotes, BTW yeah i have readed something about that and what should i use instead of that method ?
EDITED Also want to ask how to i make to disapear the form when the user will login so just to say "Welcome $user" i have this:
<script>
function asd(a)
{
document.getElementById("login_position").style.display="none";
}
</script>
but the problem is i dont know where to place it to work.
i can not understand why is showing "Wrong Username or password" even i dont click the button always is there and dissapearing after user enter true username and password.
if($count == 1) {
session_register("myusername");
session_register("mypassword");
session_start();
if(session_is_registered(myusername)){
echo "<a id='user_login_info'><br>Welcome <font color='#00FF00'>$user</font></a>";
echo "<a id='user_login_info'><br>Username and Password Accepted</a>";
}
} else {
echo "<a id='user_login_info'><br>Wrong Username or Password!</a>";
}
Thanks :)
Now i have two classes index.html and statusbar.css i have the background on the statusbar.css and some sliding image on mouse drag i have connected the classes with this code:
index.html
<head>
<link rel="stylesheet" type="text/css" href="statusbar.css">
</head>
<!-- ----------------------------- Sliding Image ----------------------------- -->
<div class="SFI-image">
<A HREF="http://www.tripleclicks.com/13614839" target="_blank">
<IMG SRC="http://www.sfimg.com/SFIBanners/banner400.gif" border="1" color='green' / ></A>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.email_details').click(function() {
// Some Code Here ...
});
$('.SFI-image:hover').click(function() {
// Some Code Here ...
});
});
</script>
So im asking does i can renamed this statusbar.css
into statusbar.php
and just write the name of the function in the index.html
class.
Also i know im not alowed to ask another queston here but i want to apply animation on the email_details
form, i have this code for that but dont know how to make it in JS:
#email_details {
opacity:1;
position:fixed;
top:25%;
right:20%;
border-radius:9px;
font-size:20px;
font-family:sans-serif;
font-weight:100;
background-color: #E6FFFF;
border:2px solid gray;
width:30%;
height:50%;
padding-top: 10px;
/* overflow set to hidden to hide the expanded text */
overflow:hidden;
/* all style changes will ease-in-out for 1s */
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
transition: all 1s;
}
Thanks :)
You can check here is the website: http://secretchatsk.host56.com/
And if you have better hosting tell me.
EDITED And i would know how to make when mouse is over the BANNER to change the background image like here …
no i dont need any engines i just need to merge two classes to get rid of copying the code again and again in every class...
Ok, im taking for example this site .. Look at the top of daniweb site you seeing this pink "navigation bar or status bar" where have "LOGGED IN AS: pritaeas EDIT PROFILE, WATCHED ARTICLES, PRIVATE MESSAGES, LOG OUT" so i want to make that in one class so when im working in other classes (for example the rest of the page "body") just to copy the name of the class with the "statusbar" so for example something like this
this to be statusbar.php
<html>
<body>
<?php
function statusbar(){
?>
<h2>Hello World</h2>
}
<?php
}
?>
</body>
</html>
this is index.html
<?php
require 'statusbar.php';
statusbar();
?>
but have in mind that in the statusbar.php need to have "login and register" so im confuzed how do i make that in one class and than just to say the name of the that class to another. Because to get rid of copying all the time the same code in all classes. I hope you now understand me :D
Hello everyone, i want to make a status bar which will have there Login and Status of the user but i want that to be in one class and when im working in other classes just to copy the name of the "statusbar" in the other classes. I dont know what it need to be named that class for example "status.php, status.css, status.html etc..." and also i dont know how do i make it to just copy the class name into other classes. i have this code but its not working:
statusbar.php
<html>
<body>
<?php
function statusbar(){
?>
.navbar {
position: fixed;
height: 20%;
width: 100%;
top: 0px;
left:0px;
background-color: #48a770;
}
<?php
}
?>
</body>
</html>
and
index.html
<?php
require 'statusbar.php';
statusbar();
?>
I know that is bad explained but i dont know how to explain better i hope you will understand it :)
- Thanks and merry Christmas :D
Hello i will ask directly with out explaining, how can i close this echo ???
<?php
echo "<div class='date'> date("Y/m/d"); </div>";
?>
It gives me some error like Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a5834708/public_html/index.html on line 149
Thanks :)