I am trying to build a desktop PHP app.
<!DOCTYPE HTML>
<html>
<body>
<script type="text/php">
$heading=$document->getElementById("title");
$heading->innerHTML="Now i see you!";
</script>
</body>
</html>
When I launch the desktop app it comes up blank. The basic hello world works fine if I don't try to use php. Am I using the right syntax?
I don't know Titanium, but there is no element with an id of 'title' to set the value of.
Does the following work?
<!DOCTYPE HTML>
<html>
<body>
<script type="text/php">
$heading=$document->getElementById("title");
$heading->innerHTML="Now i see you!";
</script>
<h1 id="title"></h1>
</body>
</html>
Related
I am trying to create a simple php page which contain only an echo, if I saved the page as ".html" it will be opened on google chrome but nothing is executed, if ".php" the page never open. any help? PS: I am new on programing
<html>
<head>
<title> test</title>
</head>
<body>
echo "hello World";
</body>
</html>
You have to write your PHP code between PHP open <?php and close ?> tags.
Try this :
<html>
<head>
<title> test</title>
</head>
<body>
<?php echo "hello World"; ?>
</body>
</html>
Php file don't run .html format and without server . Please read and understand what is php and how it is work ?. follow below link or find youtube tutorial for more visual understanding .
https://www.w3schools.com/php/default.asp
http://php.net/manual/en/
Maybe you try this :
<html>
<head>
<title> test</title>
</head>
<body>
<?php echo "hello World"; ?>
</body>
</html>
Save file as .php format and run through a localhost server that you prefer . if you don't know what is server is
follow link :
https://www.w3schools.com/php/php_install.asp
PHP server on local machine?
Download XAMPP, change your code to
<html>
<head>
<title> test</title>
</head>
<body>
<?php echo "hello World"; ?>
</body>
</html>
Locate the folder C:/xampp/htdocs, and create the file index.php containing your code, now type "localhost" in your web browser and you're done
Thanks in advance for your help, I am pretty sure you can solve my problem.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
</head>
<body>
<?php
echo '<p>hello world</p>';
?>
</body>
</html>
Previous Code example does display
hello world
'; ?>
instead of the expected
hello world
This was run local with xampp V3.2.2 on a win10 OS and Chrome browser.
I hope I'm not the fiftieth person to ask this just because I couldn't google it correctly.
Thanks for your help.
I have been using wamp server do build small websites with php for a long time.. but this morning something strange just happend :
here is my home.html file :
<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<p>Hello world</p>'; ?>
</body>
</html>
and here is what I get when I display the page :
Hello world
'; ?>
And when I display the source code, here is what I get :
<html>
<head>
<title>Test PHP</title>
</head>
<body>
<?php echo '<p>Hello world</p>'; ?>
</body>
</html>
It seems to be a very stupid problem where the php code is not interpreted by the server.. Any suggestion ?
You saved the filename as .html
Use .php instead of .html it will interrupt.
Okay people, its something very common the only thing is that I have no idea how to deal with it. i have a file "login.php" the codes within the file are
<div><textarea>Eneter your description</textarea></div>
I have a second file name "index.php" and the html inside it are
<html>
<head>
<title>SMO</title>
</head>
<body>
<?php include_once("login.php"); ?>
</body>
</html>
The problem i am facing is that, when php include login.php it also add a <title></title> tag hence i am left with two title tags.
Please help me sort it out. I know its a kid things. but just could not figure out how to solve this.
login.php
<html>
<head>
<title>SMO</title>
</head>
<body>
<div><textarea>Eneter your description</textarea></div>
</body>
</html>
index.php
<html>
<head>
<title>SMO</title>
</head>
<body>
<?php include_once("login.php"); ?>
</body>
</html>
Is this your code?
If yes, you don't have to add the <title> in your login.php page.Remove <title> and it'll work fine.
If no, please include your code in your question.
So your login.php page should be like
<div><textarea>Eneter your description</textarea></div>
I'm trying to integrate LinkedIn the login feature onto my site, but the button does not show. The code is:
<head><script type="text/javascript" src="http://platform.linkedin.com/in.js">
<body>
<script type="IN/Login" data-onAuth="onLinkedInAuth"></script>
</script>
</body>
</head>
I have made this jsfiddle it it helps as well.
I'm fairly wet behind the ears in programming so I'm sure its something simple I'm missing when it comes to understanding the api as a whole. A little help would be more than enough.
The html you've provided is all messed up - body should NOT be above head!. Check this or this out to learn the basics.
To get the login page follow instructions linkedin developer page.
First, you need to get an API key.
Than, build the HTML something like this:
<html>
<head>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: YOUR_API_KEY_GOES_HERE
authorize: true
</script>
<script type="text/javascript">
function onLinkedInAuth() {
IN.API.Profile("me")
.result( function(me) {
var id = me.values[0].id;
// AJAX call to pass back id to your server
});
}
</script>
</head>
<body>
<script type="IN/Login" data-onAuth="onLinkedInAuth"></script>
</body>
</html>
Well you have a problem of order with your tags. You can't put a body tag in the head. Try perhaps this:
<head>
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
</head>
<body>
<script type="IN/Login" data-onAuth="onLinkedInAuth"></script>
</body>
But I'm not sure if your second script is correctly done, as I don't know how the LinkedIn Api works.
<head>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: YOUR_API_KEY
</script>
</head>
<body>
<script type="IN/Login">
Hello, <?js= firstName ?> <?js= lastName ?>.
</script>
</body>