I've got a website with a splash page where users select one of two languages in which to access the page, and have the option of ticking a "remember me" checkbox, which would write a cookie. On subsequent visits to the splash page, the cookie would be read, and the user would be instantly redirected to the appropriate language version of the site.
I'm new to JS, and want to avoid building bad coding habits; what would be a recommended way of coding this?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I'm using Dreamweaver, so I have full code view and highlighting. CSS3 animations (which Edge makes use of in conjunction with JavaScript) are a new technology, so there's no risk of anything being deprecated.
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I made an Edge animation with a stage which is, natively, 1600x900px. I've included it in an <iframe> linking to the HTML file outputted by Edge, on the page where it's to be displayed; as not all displays support this resolution, I wanted to use CSS media queries to resize the animation as the resolution went down. I've set up the @media syntax, and added the transform:scale(x,y) property to the iframe tag. Since they're cascading stylesheets, I though that the transform would also affect the Edge animation's elements, including the stage; however, it didn't, for some reason.<br>
The problem consists of the entire animation resizing properly as the browser window gets resized, except the stage itself, which stubbornly stays at 1600px wide.<br>
My second attempt at resolving the problem was getting the class names and IDs of the animation's divs using my browser's web inspector; I found "#stage" and ".splash (which is the name of my Edge project). I tried adding CSS rules in my main stylesheet, then in the Edge HTML file itself, which would scale these elements; to no effect.<br>
I've tried everything I can think of at this point. Should I use a different method than iframe? What else can I do?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
This is probably the wrong forum section for this post, but it's the closest I could find. Is there any way to host two websites on a single, 1and1 hosted, server, and have them point to two individual URLs?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Try hooking it up to the AC, and remove the battery. Then, using a multimeter, see if the laptop's actually supplying power to the battery.
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I'm trying to create a PHP script, which would be added to .php files (articles) on my website. This script would automatically add the article in question to a previously created database (and would subseqgently be used to timestamp articles). What would a script like that look like?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I'm a PHP newbie, and I need to replace my current code for linking to a stylesheet (which looks like <link rel="stylesheet" href="/style.css" type="text/css">) by a PHP alternative. If it's important, the code I'm using which will link to it is php-mobile detect.
The structure I wanted to use was
<?php
include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if($detect->isiOS()){
// code to run for the Apple iOS platform.
<link rel="stylesheet" type="text/css" href="style.css" />;
}
?>
which should work, except, 1. Dreamweaver gives me a syntax error alert at the second line, and 2. I get a browser error citing an unexpected "<". I tried removing the two brackets from the <link> line, only to get "Unexpected T_STRING" from my browser.
What do I do to make this script link to an external stylesheet?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
That seems to work perfectly; however, just before trying this, I tried ./menubar.php, which also worked; although, that's probably not an absolute path. Thanks!
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I get this:
Warning: include() [function.include]: URL file-access is disabled in the server configuration
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I see...
I'm new to PHP. In your second example, is "DOCUMENT_ROOT"supposed to be replaced by the path to the root, or does it just state that the next path is root-relative?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
But to make a link always point to a file in the root folder, don't I have to add something along the lines of ../menubar.php or ./menubar.php?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I want to include a .php file, containing a menu bar, in all my pages. Thing is, some of these pages are at different levels: for example, on might be in the root directory, another might be in root/news, another in root/news/2012, and so on. What can I do to make this include always link back to the menu bar file, which is located in my root directory?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
How so? MyAdmin has a command input (or command line) option. I just typed ALTER TABLE news ADD postdate VARCHAR(1000);
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I actually just got that (inputed an SQL command to create a new column, thereby creating a field).
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Alright, will do. Thanks.
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
By timestamp, I mean a line of text at the top of an article, reading "posted on Y/M/D". As for the confusion, I'm a bit confused myself. I know that databases are supposed to work with rows and columns, but PHPMyAdmin just lets me create a table with fields. So I created a table with a single field, which I named "date".
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I'd like to add a timestamp to articles I upload to my website, which reads the time and date the article was uploaded. I've got a database, as well as a working connect.php. In this database, I've created a table with a "date" field (type: date). What can I do to get the timestamps working?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I'm not sure I understand what defines a row on a page, or the limit of rows. Are these standard HTML table rows, or what?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Then how do I link to it so as not to get errors?
Patiodude
Junior Poster in Training
54 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0