ELATED: All Forums http://www.elated.com/ ELATED.com Webmaster Forums: Free Help with HTML, CSS, JavaScript, PHP and Photoshop from ELATED.com en-us Wed, 26 Jul 2017 18:46:22 GMT Wed, 26 Jul 2017 18:46:22 GMT http://blogs.law.harvard.edu/tech/rss ELATED.com feeder Re: [Authoring and Programming] Banner rate http://www.elated.com/forums/topic/6345/#post26732 From: chrishirst


No idea to both questions, because it depends ENTIRELY on the marketplace and whether the visitors are 'qualified', which means, are they actually going to be USEFUL to the advertiser(s).

C.P.M. means "Cost Per Mille", mille being 1000. So C.P.M. equates to "cost per thousand impressions".

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 21 Jul 2017 13:39:22 GMT http://www.elated.com/forums/topic/6345#post26732
[Authoring and Programming] Banner rate http://www.elated.com/forums/topic/6345/#post26731 From: brucebrown


Assuming that my web site is getting about 150,000 impressions per month, how much should I charge for a banner ad? If I'm getting less impressions, how much would I charge?

What is a cpm?

View » | Reply »

]]>
Fri, 21 Jul 2017 12:15:59 GMT http://www.elated.com/forums/topic/6345#post26731
Re: [Authoring and Programming] Javascript help adding if statement http://www.elated.com/forums/topic/6344/#post26730 From: chrishirst


You cannot do this;


Code:
--------------------
lInputs[i].checked = false;
--------------------


An unchecked box is not 'false', it will return 'undefined' or 'null' as only a checked box will return a value of true.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 21 Jul 2017 02:53:31 GMT http://www.elated.com/forums/topic/6344#post26730
Re: [Authoring and Programming] Build a CMS in an Afternoon with PHP and MySQL http://www.elated.com/forums/topic/5114/#post26729 From: prakul


Hi Matt,
First I was impressed your answered. You just not answered like others, but give them the working code.!!

I tried to add Search for Topic or Category by add form at the head. But somehow not success.
All detail I post in github here :https://github.com/kul1/elated

Here the code:
1. ./templates/include/search.php

Code:
--------------------
<html>
<form action="?action=searchTitle" method="post">
<input type="text" name="mytitle" />
<input type="submit" name = submit value="Search Title" />
</form>
</html>

--------------------


2. Add case searchTitle and function searchtitle()


Code:
--------------------
<?php

require( "config.php" );
include "templates/include/search.php";



$action = isset( $_GET['action'] ) ? $_GET['action'] : "";

switch ( $action ) {
case 'archive':
archive();
break;
case 'viewArticle':
viewArticle();
break;
case 'searchTitle':
searchtitle();
break;
default:
homepage();
}

function archive() {
$results = array();
$categoryId = ( isset( $_GET['categoryId'] ) && $_GET['categoryId'] ) ? (int)$_GET['categoryId'] : null;
$results['category'] = Category::getById( $categoryId );
$data = Article::getList( 100000, $results['category'] ? $results['category']->id : null );
$results['articles'] = $data['results'];
$results['totalRows'] = $data['totalRows'];
$data = Category::getList();
$results['categories'] = array();
foreach ( $data['results'] as $category ) $results['categories'][$category->id] = $category;
$results['pageHeading'] = $results['category'] ? $results['category']->name : "Article Archive";
$results['pageTitle'] = $results['pageHeading'] . " | Widget News";
require( TEMPLATE_PATH . "/archive.php" );
}

function viewArticle() {
if ( !isset($_GET["articleId"]) || !$_GET["articleId"] ) {

homepage();
return;
}

$results = array();
$results['article'] = Article::getById( (int)$_GET["articleId"] );
$results['category'] = Category::getById( $results['article']->categoryId );
$results['pageTitle'] = $results['article']->title . " | Widget News";
require( TEMPLATE_PATH . "/viewArticle.php" );
}

function homepage() {
$results = array();
$data = Article::getList( HOMEPAGE_NUM_ARTICLES );
$results['articles'] = $data['results'];
$results['totalRows'] = $data['totalRows'];
$data = Category::getList();
$results['categories'] = array();
foreach ( $data['results'] as $category ) $results['categories'][$category->id] = $category;
$results['pageTitle'] = "Widget News";
require( TEMPLATE_PATH . "/homepage.php" );
}

function searchtitle() {

//if ( !isset($searchitem) || !$searchitem) {
if ( !isset($_POST["mytitle"]) || !$_POST["mytitle"] ) {
homepage();
return;
}
echo "<br/>";
$searchitem = $_POST["mytitle"];

echo '$searchitem in side searchtitle = >>>>>>>>>> '.$searchitem;

$results = array();
$results['article'] = Article::getByTitle($searchitem);

echo "<br/> ";
print_r($results['article']);

echo "<br/> Here I have problem with the next line results['category'] is not work";

$results['category'] = Category::getById($results['article']->categoryId);
//$results['pageTitle'] = $results['article']->title . " | Widget News";
//require( TEMPLATE_PATH . "/viewArticle.php" );
//$results['pageHeading'] = $results['category'] ? $results['category']->name : "Article Archive";
//$results['pageTitle'] = $results['pageHeading'] . " | Widget News";
//require( TEMPLATE_PATH . "/archive.php" );

homepage();
return;
}
?>

--------------------


3. Modify classes/Article.php
Add function getByTitle


Code:
--------------------

public static function getByTitle( $mytitle=null, $numRows=1000000, $categoryId=null, $order="publicationDate DESC" ) {
echo "<br/>";
echo 'getByTitle = >>>>>>>>>> '.$mytitle;


$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
$categoryClause = "WHERE title = ".$mytitle;

echo "<br/>";
echo 'DB_DSN, DB_USERNAME, DB_PASSWORD = >>>>>>>>>> '.DB_DSN.",".DB_USERNAME.".".DB_PASSWORD;

echo "<br/>";
echo '$categoryClause = >>>>>>>>>> '.$categoryClause;

//$sql = "SELECT SQL_CALC_FOUND_ROWS *, UNIX_TIMESTAMP(publicationDate) AS publicationDate FROM articles $categoryClause ORDER BY " . ($order) . " LIMIT :numRows";
$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM articles WHERE title = 'Forth Title'";

$st = $conn->prepare( $sql );
$st->bindValue( ":numRows", $numRows, PDO::PARAM_INT );
if ( $categoryId ) $st->bindValue( ":categoryId", $categoryId, PDO::PARAM_INT );
$st->execute();
$list = array();

echo "<br/>";
print_r($list);

while ( $row = $st->fetch() ) {
$article = new Article( $row );
$list[] = $article;
}

// Now get the total number of articles that matched the criteria
$sql = "SELECT FOUND_ROWS() AS totalRows";
$totalRows = $conn->query( $sql )->fetch();

echo "<br/>";
echo "---------->".$totalRows[0];

$conn = null;
return ( array ( "results" => $list, "totalRows" => $totalRows[0] ) );
}

--------------------



Somehow the function searchtitle() have problem


Code:
--------------------
Notice: Trying to get property of non-object
--------------------



Perhaps there is any other better way to search Title or Category(not here yet). Or how to fix it.

Thanks
Peter

--
Peter Cooling

View » | Reply »

]]>
Thu, 20 Jul 2017 19:55:45 GMT http://www.elated.com/forums/topic/5114#post26729
[Authoring and Programming] Javascript help adding if statement http://www.elated.com/forums/topic/6344/#post26728 From: esowers


Hey,

I'm running into trouble adding an if statement around some pre-existing javascript that I have. Essentially I have a checkbox field within my webpage that may be in an array, or it may be a straight variable, depends on how many different options there are. (ie if the page loads and there's only one option, then the checkbox will be a variable with no array, else with two or more options it will be in an array with the same tagname).



Code:
--------------------
<!-- Script to control the function of the check boxes -->
<script>
var inputs;
$( document ).ready(function() {
inputs = document.getElementsByTagName("input");
if(inputs.constructor === Array){
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].type == "checkbox") {
inputs[i].onclick = function() { checkOnly( this.name ); };
}
} else{

}
}

}

});

function checkOnly(stayChecked) {
var lInputs = document.getElementsByTagName("input");
var fieldNum = 0;
for(var i = 0; i < lInputs.length; i++) {
if(lInputs[i].type == "checkbox") {
if ( stayChecked != lInputs[i].name ) {
lInputs[i].checked = false;
} else {
//Set the selected cost for this registration
var selectedCost = document.getElementById( "tfa_2201[" + fieldNum + "]");
var setSelectedCost = document.getElementById( "tfa_2202" );
setSelectedCost.value = selectedCost.value;
//Set the selected price for this registration
var selectedPrice = document.getElementById( "tfa_2197[" + fieldNum + "]" );
var setSelectedPrice = document.getElementById( "tfa_2204");
setSelectedPrice.value = selectedPrice.value;
//Set the amount due field
var selectedPrice = document.getElementById( "tfa_2197[" + fieldNum + "]" );
var setSelectedPrice = document.getElementById( "tfa_2532");
setSelectedPrice.value = selectedPrice.value;
}
fieldNum++;

}
}

}

</script>
--------------------


If someone could help us add an if statement to this it would be super helpful. The function is that when a checkbox is checked it will take one fields value and populate it in another field.

View » | Reply »

]]>
Thu, 20 Jul 2017 19:13:05 GMT http://www.elated.com/forums/topic/6344#post26728
Re: [Authoring and Programming] PHP Data Types http://www.elated.com/forums/topic/4724/#post26726 From: chrishirst


Objects are [b]NOT really[b] data 'types' which is why they are not covered as simple data 'types'

'Objects' are an abstract structure of variables which are containers of scalar data types, arranged as an associative array

PLUS;

" but it is not mentioned in this article."

Had you actually read the article all the way through you would have found arrays and objects covered in the section headed with

"PHP's compound data types"

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Mon, 17 Jul 2017 10:24:36 GMT http://www.elated.com/forums/topic/4724#post26726
Re: [Authoring and Programming] PHP Data Types http://www.elated.com/forums/topic/4724/#post26725 From: olidev


Objects are also a type of data in PHP, but it is not mentioned in this article. Arrays and function are some examples of an Object. Here is how a new Object is created.

$car = new ferrari();

Source: https://www.cloudways.com/blog/php-data-types-and-variable-concepts/

View » | Reply »

]]>
Mon, 17 Jul 2017 07:18:40 GMT http://www.elated.com/forums/topic/4724#post26725
Re: [Website Management] Introduction to FTP http://www.elated.com/forums/topic/4599/#post26724 From: vivi016


Hello,
Thank you for sharing your pinion.
It's really interesting!
[url=http://www.comparateur-mutuelle-assurance-sante.com]mutuelle auto entrepreneur [/url]

View » | Reply »

]]>
Mon, 17 Jul 2017 01:29:41 GMT http://www.elated.com/forums/topic/4599#post26724
[Authoring and Programming] Managing callback in argument in javascirpt http://www.elated.com/forums/topic/6343/#post26723 From: zesanriky


The async function itself should make use of the lookup() function but return the result inside the callback.

The parameters for the callback are err and res.

If an Error has been thrown by lookup() then it should be passed to err, otherwise err is null or undefined.If a result has been returned by lookup() then it should be passed to res, otherwise res is null or undefined.



<!DOCTYPE html>
<html>
<body>
<script src="https://wzrd.in/standalone/tape@latest"></script>
<script src="https://wzrd.in/standalone/tap-browser-color@latest">
</script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script>
window.test = tape;
tapBrowserColor();
</script>
</body>
</html>

<script>

const users = [
{
"login": "knuth",
"firstName": "Donald",
"lastName": "Knuth",
"likes": ["C", "Unix"]
},
{
"login": "norvig",
"firstName": "Peter",
"lastName": "Norvig",
"likes": ["AI", "Search", "NASA", "Mars"]
},
{
"login": "mfowler",
"firstName": "Martin",
"lastName": "Fowler",
"likes": ["Design Patterns", "Refactoring"]
},
{
"login": "kent",
"firstName": "Kent",
"lastName": "Beck",
"likes": ["TDD", "wikis", "Design Patterns"]
}
];

// lookup()
const lookup = (login, prop) => {
// Only change code below this line
const found = users.find(function(e){
return e.login === login;
});
if(!found) {
throw "Could not find user";
} else {
if(prop in found) {
return found[prop];
} else {
throw "Could not find property";
}
}
};

// lookupAsync()
const lookupAsync = (login, prop, callback) => {
// Only change code below this line
const found = users.find(function(e){
return e.login === login;
});
if(!found) {
throw "Could not find user";
} else {
if(prop in found) {
return found[prop];
} else {
throw "Could not find property";
}
}

//my intension below but doesn't work
//callback();
//lookupAsync(function (err,res) {});

};
test('lookupAsync() likes', assert => {
const msg = `lookupAsync(<login>, 'likes', callback) should return

likes

for the specified user.`;

lookupAsync('norvig', 'likes', function(err, res){
const actual = res;
const expected = ["AI", "Search", "NASA", "Mars"];
assert.deepEqual(actual, expected, msg);
assert.end();
});

});


test('lookupAsync() last name', assert => {
const msg = `lookupAsync(<login>, 'lastName') should return the last

name
for the specified user.`;

lookupAsync('knuth', 'lastName', function(err, res){
const expected = 'Knuth';
const actual = res;
assert.deepEqual(actual, expected, msg);
assert.end();
});
});


test('lookupAsync() with unknown user', assert => {
const msg = `lookupAsync() with unknown user should return an error
with the correct message.`;

const value = lookupAsync('nobody', 'likes', function(err, res){
const actual = err.message;
const expected = 'Could not find user.';
assert.equal(actual, expected, msg);
assert.end();
});
});


test('lookupAsync() with unknown property', assert => {
const msg = `lookupAsync() with unknown property should return an

error
with the correct message`;

lookupAsync('mfowler', 'noprop', function(err, res){
const actual = err.message;
const expected = 'Could not find property.';
assert.equal(actual, expected, msg);
assert.end();
});
});


</script>

The output should look like(short from) :

1..4
# tests 4
# pass 4
# ok

[Edited by zesanriky on 16-Jul-17 15:38]

View » | Reply »

]]>
Sun, 16 Jul 2017 20:36:27 GMT http://www.elated.com/forums/topic/6343#post26723
Re: [Graphics and Design] Help with css media queries http://www.elated.com/forums/topic/6342/#post26722 From: eddie


Thank you for the fast response.

View » | Reply »

]]>
Sat, 15 Jul 2017 04:19:26 GMT http://www.elated.com/forums/topic/6342#post26722
Re: [Graphics and Design] Help with css media queries http://www.elated.com/forums/topic/6342/#post26721 From: chrishirst


https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries


https://www.w3schools.com/css/css3_mediaqueries_ex.asp

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 14 Jul 2017 18:52:47 GMT http://www.elated.com/forums/topic/6342#post26721
Re: [Authoring and Programming] html-stylesheet linkage http://www.elated.com/forums/topic/6341/#post26720 From: chrishirst



Code:
--------------------
<link rel="stylesheet" type="text/css" href="path_to_css_file.css">
--------------------



https://www.w3schools.com/tags/tag_link.asp

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 14 Jul 2017 18:50:56 GMT http://www.elated.com/forums/topic/6341#post26720
[Graphics and Design] Help with css media queries http://www.elated.com/forums/topic/6342/#post26719 From: eddie


I need to add media queries to make a slider responsive, there are tons of help online, but it seems like everytime I fix for one type, for example, if I use a media query for a certain size, it's ok for galaxy phones and some others, but then landscape is different and iphones, and then min and max width don't really work, can anybody help me with an easier method or at least one that works for the majority of devices? Thank you.

View » | Reply »

]]>
Fri, 14 Jul 2017 12:13:51 GMT http://www.elated.com/forums/topic/6342#post26719
[Authoring and Programming] html-stylesheet linkage http://www.elated.com/forums/topic/6341/#post26718 From: newbie1022


I am having trouble getting the html sheet I have created to reference its stylesheet, a separate CSS file, in the same folder. What are the critical parts that make this happen? I have seen two instructors do this, but I cannot make it happen.

--
Jim Williams

View » | Reply »

]]>
Thu, 13 Jul 2017 21:54:16 GMT http://www.elated.com/forums/topic/6341#post26718
Re: [Authoring and Programming] Where http://www.elated.com/forums/topic/6340/#post26717 From: chrishirst


You're not a Douglas Adams aficionado I guess,


It is what was etched into the goldfish bowl that the Dolphins left for Arthur Dent on his return to Earth, and was the final message to Earth from the dolphins.

Also the Quandary Phase of the Hitchhikers Guide to the Galaxy. https://www.youtube.com/watch?v=Gi08277caUQ

(The books and radio/TV Series are much better than the film)

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 12 Jul 2017 22:46:09 GMT http://www.elated.com/forums/topic/6340#post26717
Re: [Authoring and Programming] Where http://www.elated.com/forums/topic/6340/#post26716 From: newbie1022


Ok, thanks! That's a little easier to understand, I think.
AND, where are you getting "all the fish" from?

--
Jim Williams

View » | Reply »

]]>
Wed, 12 Jul 2017 18:54:51 GMT http://www.elated.com/forums/topic/6340#post26716
Re: [Authoring and Programming] Where http://www.elated.com/forums/topic/6340/#post26715 From: chrishirst


Classes and IDs are styling components NOT structural elements, so they do NOT 'distinguish' elements structurally, they CAN be used to distinguish elements visually, but that is not necessarily the case as a class AND an ID may be styled identically

'div' is short for 'a division' element, so non-visual user agents can determine that the content of that particular element is separated from the preceding and following content, while not giving the content any particular significance.

A paragraph '<p>' does the same thing in separating content, BUT also gives the content some significance, just as a paragraph break would do on a printed page.

"WHERE do divs fit in the parent/child relationships between the body and other parts?

There is no particular "parent - child relationship", you as the developer define what the element hierarchy will be.
There are just the standard 'rules' of HTML. Which are:
Divs are a block level element so can be a child of other block level elements or a parent of block level and/or inline level elements. Whereas inline level elements can be parent ONLY to other inline elements

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 12 Jul 2017 18:31:55 GMT http://www.elated.com/forums/topic/6340#post26715
[Authoring and Programming] Where http://www.elated.com/forums/topic/6340/#post26714 From: newbie1022


I am having a hard time seeing the point of the div element. If you have classes, ID's and other means of distinguishing paragraphs and other elements, what's the point of div's? And WHERE do divs fit in the parent/child relationships between the body and other parts?

--
Jim Williams

View » | Reply »

]]>
Wed, 12 Jul 2017 14:43:23 GMT http://www.elated.com/forums/topic/6340#post26714
Re: [Authoring and Programming] Fading Nav Bar http://www.elated.com/forums/topic/6339/#post26713 From: chrishirst


"as I scroll up it snaps back instead of fading back out. "

As it will, given that you remove the very thing that makes it 'fade'.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sun, 09 Jul 2017 10:12:07 GMT http://www.elated.com/forums/topic/6339#post26713
[Authoring and Programming] Fading Nav Bar http://www.elated.com/forums/topic/6339/#post26712 From: neotrad


I need help with coding the nav bar, I can get it to fade into the new color when scrolling down, but as soon as I scroll up it snaps back instead of fading back out.

html:


Code:
--------------------

<div>
<nav class="nav">
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
</ul>
</nav>
</div>
--------------------



css:



Code:
--------------------
.changeColor {
background: #d13e3f;
transition: 1.5s all;
}
--------------------



javascript:



Code:
--------------------
$(window).scroll(function(){
if ($(this).scrollTop()>1000){
$('.menu').addClass("changeColor");
}
else
{
$('.menu').removeClass("changeColor");
}
})
--------------------


--
Ruan Jordaan

View » | Reply »

]]>
Sat, 08 Jul 2017 22:49:49 GMT http://www.elated.com/forums/topic/6339#post26712
Re: [Authoring and Programming] stuck left justified! http://www.elated.com/forums/topic/6338/#post26711 From: chrishirst


Oh and HTML/CSS it will be 'left aligned', 'justify' is related to text flow.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 07 Jul 2017 20:52:05 GMT http://www.elated.com/forums/topic/6338#post26711
Re: [Authoring and Programming] stuck left justified! http://www.elated.com/forums/topic/6338/#post26710 From: chrishirst


"Headers and paragraphs appear stuck on the left side."

That's the norm for the HTML document flow.

"Do you have to box em on the screen to move em?"

Haven't a clue what you mean by this. 'em' is a dimensional unit for layout positions and font sizes.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 07 Jul 2017 20:50:06 GMT http://www.elated.com/forums/topic/6338#post26710
[Authoring and Programming] stuck left justified! http://www.elated.com/forums/topic/6338/#post26709 From: newbie1022


Headers and paragraphs appear stuck on the left side. I managed to put one in a block and move it over with a large left margin, but I couldn't move the first or second headers off the left margin, even with a large margin number in the style box. Do you have to box em on the screen to move em?

--
Jim Williams

View » | Reply »

]]>
Thu, 06 Jul 2017 23:50:13 GMT http://www.elated.com/forums/topic/6338#post26709
Re: [Graphics and Design] The New Photoshop: What We Need in a Proper Next-Generation Digital Design Tool http://www.elated.com/forums/topic/5151/#post26708 From: chrishirst


"Hello, I am new here."

Then the [b]FIRST[/b} thing you need to learn is;


DO NOT hijack threads with irrelevant posts.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 05 Jul 2017 10:10:44 GMT http://www.elated.com/forums/topic/5151#post26708
Re: [Authoring and Programming] what's the difference? http://www.elated.com/forums/topic/6337/#post26707 From: chrishirst


<br> is for HTML code.

<br/> is for XHTML code.


The difference is that XHTML requires all 'tags' to be closed and as <br> is a single tag that has no equivalent 'close' tag, the '/>' makes it 'self-closing'

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 05 Jul 2017 10:08:43 GMT http://www.elated.com/forums/topic/6337#post26707
Re: [Graphics and Design] The New Photoshop: What We Need in a Proper Next-Generation Digital Design Tool http://www.elated.com/forums/topic/5151/#post26706 From: gibsonherry


Hello, I am new here.

--
VMware vSphere 6 Essentials, , VIRTUALIZATION Software , VIRTUALIZATION , VIRTUALIZATION , VIRTUALIZATION , VIRTUALIZATION Thailand

View » | Reply »

]]>
Wed, 05 Jul 2017 05:25:57 GMT http://www.elated.com/forums/topic/5151#post26706
[Authoring and Programming] what's the difference? http://www.elated.com/forums/topic/6337/#post26705 From: newbie1022


Between <br> and <br/>? I have seen a few other tags with the / after the letters. What's the purpose of it being after the letters?

--
Jim Williams

View » | Reply »

]]>
Tue, 04 Jul 2017 22:47:50 GMT http://www.elated.com/forums/topic/6337#post26705
Re: [Graphics and Design] The New Photoshop: What We Need in a Proper Next-Generation Digital Design Tool http://www.elated.com/forums/topic/5151/#post26703 From: damon96c


outpatient alcohol rehab

View » | Reply »

]]>
Mon, 03 Jul 2017 15:26:03 GMT http://www.elated.com/forums/topic/5151#post26703
Re: [Authoring and Programming] JavaScript Tabs - Create Tabbed Web Pages Easily http://www.elated.com/forums/topic/4717/#post26702 From: anhr


I took the ideas from this article and wrote my own code. Please see my cross-browser JavaScript code: https://github.com/anhr/Tabs.

You can use different ways to create tabs and tab content.

Tab content can added only when tab gets focus.

You can remember selected tab. Selected tab opens immediatelly after opening of the page.

You can create tabs inside tab.

Custom background of the tab is available.

Example: http://anhr.ucoz.net/Tabs/

--
Andrej web developer

View » | Reply »

]]>
Sun, 02 Jul 2017 13:02:23 GMT http://www.elated.com/forums/topic/4717#post26702
Re: [Authoring and Programming] How can I update mySQL Database using PHP & HTML Form http://www.elated.com/forums/topic/6335/#post26699 From: chrishirst


" But it adds a new row under the username column in the database"

Which is exactly what an INSERT query will do.

Changing data requires an UPDATE query https://www.w3schools.com/php/php_mysql_update.asp

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 30 Jun 2017 12:24:32 GMT http://www.elated.com/forums/topic/6335#post26699
[Authoring and Programming] How can I update mySQL Database using PHP & HTML Form http://www.elated.com/forums/topic/6335/#post26698 From: VenoM


Greetings,
So before I dive into my problem, I'll explain what I'm trying to achieve. I'm making a profile page. I already have a login system which means I have stored the user's email, password, first name, last name in my database. Now to improve my profile page, I'm trying to also add a username, city & country blank The user will be able to set a username when he visits the profile page. Before that, the username blank in the database is empty. Now I tried to implement the INSERT method to my username form blank. But it adds a new row under the username column in the database. This is the example: http://imgur.com/pl1Aywd

My problem is similar to this: https://stackoverflow.com/questions/21994209/updating-a-user-profile-stored-in-session-data-from-an-sql-database-with-ajax

I want the username to appear in the logged in user's row e.g my account name is Hamza Ch so the username I set (pointz0r) should be in my row and not make a new row.

This is my HTML form: https://codeshare.io/5wyNbK

I have an action.php but It's really messed up. I was hoping someone can direct me to a blog post or a tutorial where I can find the solution. Or help me with the solution himself. I'm just a beginner in PHP and I really want to get this done at this once. Thanks in advance!

View » | Reply »

]]>
Fri, 30 Jun 2017 11:16:34 GMT http://www.elated.com/forums/topic/6335#post26698
Re: [Authoring and Programming] jQuery Mobile: What Can It Do for You? http://www.elated.com/forums/topic/5050/#post26697 From: cohenarik18


I have the same problem on this site http://seo-google.co.il/. Does anyone have an idea?

--
seo-google

View » | Reply »

]]>
Thu, 29 Jun 2017 11:30:18 GMT http://www.elated.com/forums/topic/5050#post26697
Re: [Graphics and Design] The New Photoshop: What We Need in a Proper Next-Generation Digital Design Tool http://www.elated.com/forums/topic/5151/#post26696 From: chrishirst


WTF has life assurance to do with Photoshop????

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Thu, 29 Jun 2017 10:12:48 GMT http://www.elated.com/forums/topic/5151#post26696
Re: [Graphics and Design] The New Photoshop: What We Need in a Proper Next-Generation Digital Design Tool http://www.elated.com/forums/topic/5151/#post26695 From: acanais72


Thank you for thinking to expand this publication is nice. Otherwise, I would like to make a small share http://www.comparateur-mutuelle-assurance-sante.com

View » | Reply »

]]>
Thu, 29 Jun 2017 03:54:21 GMT http://www.elated.com/forums/topic/5151#post26695
Re: [Webmasters' Lounge] HTML + PHP + Mysql help http://www.elated.com/forums/topic/6333/#post26694 From: chrishirst


This;

$myusername=$_POST['admin'];
$mypassword=$_POST['Abc123'];


Gets the values from two form fields, do you really have the input field with the name attribute exactly the same as the password???


" Access denied for user 'admin'@'185.176.43.78' (using password: YES) "

Says; your password is wrong or the user is not allowed to connect from that particular IP.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 28 Jun 2017 09:56:36 GMT http://www.elated.com/forums/topic/6333#post26694
[Authoring and Programming] HTML + PHP + Mysql help http://www.elated.com/forums/topic/6334/#post26692 From: Samuel Hulme


http://www.elated.com/forums/topic/6333/

is what is what i need help on

--
http://minersonl.mypressonline.com

View » | Reply »

]]>
Tue, 27 Jun 2017 17:50:05 GMT http://www.elated.com/forums/topic/6334#post26692
[Webmasters' Lounge] HTML + PHP + Mysql help http://www.elated.com/forums/topic/6333/#post26691 From: Samuel Hulme


I got a website http://minersonl.mypressonline.com but i am having a error can anyone fix it please

-----------------------------------------------
Error

Warning: mysqli_connect(): (28000/1045): Access denied for user 'admin'@'185.176.43.78' (using password: YES) in /srv/disk1/2317491/www/minersonl.mypressonline.com/checklogin.php on line 11
Wrong Username or Password

-----------------------------------------------
PHP Code

<?php

$host="fdb17.awardspace.net"; // Host name
$username="admin"; // Mysql username
$password="Abc123"; // Mysql password
$db_name="2317491_134"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select databse.
mysqli_connect("fdb17.awardspace.net", "admin", "Abc123");


// username and password sent from form
$myusername=$_POST['admin'];
$mypassword=$_POST['Abc123'];


$myusername = stripslashes("admin");
$mypassword = stripslashes("Abc123");


$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";

// If result matched admin and Abc123, table row must be 1 row

if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}
?>

-----------------------------------------------

PS ca anyone fix it please .

--
http://minersonl.mypressonline.com

View » | Reply »

]]>
Mon, 26 Jun 2017 18:21:02 GMT http://www.elated.com/forums/topic/6333#post26691
Re: [Website Marketing] SEO does it really work? http://www.elated.com/forums/topic/6226/#post26690 From: amirah


Thank you guyz's whoever post a useful information.

--
https://qatar.fugenx.com/mobile-application-development/

View » | Reply »

]]>
Mon, 26 Jun 2017 10:48:01 GMT http://www.elated.com/forums/topic/6226#post26690
Re: [Authoring and Programming] Trouble with JS code http://www.elated.com/forums/topic/6332/#post26689 From: chrishirst


"my first problem is that when i update the VAT % (MVA %) the calculation does not capture the changed %. it continue with 25%. how is that?
"

the first thing would be to use the correct elements for numeric input, a textarea (#paid) is NOT appropriate and using the html content of the element only compounds the problem.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Sat, 24 Jun 2017 11:20:55 GMT http://www.elated.com/forums/topic/6332#post26689
Re: [Authoring and Programming] Build a CMS in an Afternoon with PHP and MySQL http://www.elated.com/forums/topic/5114/#post26688 From: matt


@athleticstatto: I didn't read @csturner's comment properly. I wouldn't recommend just removing mysql_escape_string() - that's a security risk!

I think the best approach, if you are using PHP7, is probably this:

https://phpdelusions.net/pdo#prepared


Code:
--------------------
$orders = ["name","price","qty"]; //field names
$key = array_search($_GET['sort'],$orders); // see if we have such a name
$orderby = $orders[$key]; //if not, first one will be set automatically. smart enuf :)
$query = "SELECT * FROM `table` ORDER BY $orderby"; //value is safe
--------------------


i.e. use an unescaped string for the ORDER BY, *but* make sure that the string is pulled from a list of allowed values.

--
Matt Doyle, Elated

View » | Reply »

]]>
Sat, 24 Jun 2017 07:42:11 GMT http://www.elated.com/forums/topic/5114#post26688
[Authoring and Programming] Trouble with JS code http://www.elated.com/forums/topic/6332/#post26687 From: Wenaaz


Hi! im kinda new to building website with js, and therefore need a bit help with an error on my page. first of all, check www.nettnota.no/

basically free invoice generator (Norwegian) for small companies.

- my first problem is that when i update the VAT % (MVA %) the calculation does not capture the changed %. it continue with 25%. how is that?

- second problem is, how to i make MVA beløp (VAT amount) to get 2 decimals? same goes for Saldo (balance) :S

below you can see the whole js coding:


Code:
--------------------
function print_today() {
var now = new Date();
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
var today = months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear()));
return today;
}

// from http://www.mediacollege.com/internet/javascript/number/round.html
function roundNumber(number,decimals) {
var newString;// The new rounded number
decimals = Number(decimals);
if (decimals < 1) {
newString = (Math.round(number)).toString();
} else {
var numString = number.toString();
if (numString.lastIndexOf(".") == -1) {// If there is no decimal point
numString += ".";// give it one at the end
}
var cutoff = numString.lastIndexOf(".") + decimals;// The point at which to truncate the number
var d1 = Number(numString.substring(cutoff,cutoff+1));// The value of the last decimal place that we'll end up with
var d2 = Number(numString.substring(cutoff+1,cutoff+2));// The next decimal, after the last one we want
if (d2 >= 5) {// Do we need to round up at all? If not, the string will just be truncated
if (d1 == 9 && cutoff > 0) {// If the last digit is 9, find a new cutoff point
while (cutoff > 0 && (d1 == 9 || isNaN(d1))) {
if (d1 != ".") {
cutoff -= 1;
d1 = Number(numString.substring(cutoff,cutoff+1));
} else {
cutoff -= 1;
}
}
}
d1 += 1;
}
if (d1 == 10) {
numString = numString.substring(0, numString.lastIndexOf("."));
var roundedNum = Number(numString) + 1;
newString = roundedNum.toString() + '.';
} else {
newString = numString.substring(0,cutoff) + d1.toString();
}
}
if (newString.lastIndexOf(".") == -1) {// Do this again, to the new string
newString += ".";
}
var decs = (newString.substring(newString.lastIndexOf(".")+1)).length;
for(var i=0;i<decimals-decs;i++) newString += "0";
//var newNumber = Number(newString);// make it a number if you like
return newString; // Output the result to the form field (change for your purposes)
}

function update_total() {
var total = 0;
$('.price').each(function(i){
price = $(this).html().replace("","");
if (!isNaN(price)) total += Number(price);
});

total = roundNumber(total,2);

$('#subtotal').html(""+total);
var test4 = $('#subtotal').html();
var test5 = $('#paid').html() * 0.01;
var test6 = test4 * test5;
$('#total').html(""+test6);

update_balance();
}

function update_balance() {

var test1 = $("#subtotal").html();
var test2 = $("#paid").html() * 0.01;
var test7 = +test2 + 1;
var test3 = test1 * +test7;

$('.due').html(""+test3);

}


function update_price() {
var row = $(this).parents('.item-row');
var price = row.find('.cost').val().replace("","") * row.find('.qty').val();
price = roundNumber(price,2);
isNaN(price) ? row.find('.price').html("N/A") : row.find('.price').html(""+price);

update_total();
}

function bind() {
$(".cost").blur(update_price);
$(".qty").blur(update_price);
}

$(document).ready(function() {

$('input').click(function(){
$(this).select();
});

$("#paid").blur(update_balance);

$("#addrow").click(function(){
$(".item-row:last").after('<tr class="item-row"><td class="item-name"><div class="delete-wpr"><textarea>Item Name</textarea><a class="delete" href="javascript:;" title="Remove row">X</a></div></td><td class="description"><textarea>Description</textarea></td><td><textarea class="cost">0</textarea></td><td><textarea class="qty">0</textarea></td><td><span class="price">0</span></td></tr>');
if ($(".delete").length > 0) $(".delete").show();
bind();
});

bind();

$(".delete").live('click',function(){
$(this).parents('.item-row').remove();
update_total();
if ($(".delete").length < 2) $(".delete").hide();
});

$("#cancel-logo").click(function(){
$("#logo").removeClass('edit');
});
$("#delete-logo").click(function(){
$("#logo").remove();
});
$("#change-logo").click(function(){
$("#logo").addClass('edit');
$("#imageloc").val($("#image").attr('src'));
$("#image").select();
});
$("#save-logo").click(function(){
$("#image").attr('src',$("#imageloc").val());
$("#logo").removeClass('edit');
});

$("#date").val(print_today());

});
--------------------


--
Martin Vens

View » | Reply »

]]>
Thu, 22 Jun 2017 13:18:04 GMT http://www.elated.com/forums/topic/6332#post26687
Re: [Authoring and Programming] Extra Spaces on Page http://www.elated.com/forums/topic/6331/#post26686 From: chrishirst


". I have looked at the pages side-by-side and not seeing where the issue might be. Any help you can provide is GREATLY appreciated!"

Look at the rendered source code side by side to see what extra bits the M$ interference framework is adding.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Wed, 21 Jun 2017 11:13:20 GMT http://www.elated.com/forums/topic/6331#post26686
[Authoring and Programming] Extra Spaces on Page http://www.elated.com/forums/topic/6331/#post26684 From: ftbadolato


Hello,

First time poster...

I recently purchased a template, which you can see here:
http://re.eimpactweb.com/index.html

I am converting the template to a .ASPX Master Page, which I have started here:
http://re.eimpactweb.com/default.aspx

If you toggle between the two pages, you'll notice that the search box at the top is not right justified in the .ASPX page as it should be and there is additional white space between the main menu and the first set of images. I am not sure where these formatting inconsistencies are coming from. Other than the addition of some server-side code from the .ASPX page, the code should be identical. I have looked at the pages side-by-side and not seeing where the issue might be. Any help you can provide is GREATLY appreciated!

Thank you!

View » | Reply »

]]>
Tue, 20 Jun 2017 16:59:07 GMT http://www.elated.com/forums/topic/6331#post26684
Re: [Authoring and Programming] directories and paths http://www.elated.com/forums/topic/6330/#post26682 From: newbie1022


I have a folder called "HTML", where all my code files are stored. Usually, I go in there when I am writing something in an editor. I first save the work, put down the editor, go to that folder, and right click, and then click "open with". Is that folder the root directory?

--
Jim Williams

View » | Reply »

]]>
Fri, 16 Jun 2017 21:43:37 GMT http://www.elated.com/forums/topic/6330#post26682
Re: [Authoring and Programming] directories and paths http://www.elated.com/forums/topic/6330/#post26681 From: chrishirst


Okay,

Let's gauge how much you do know.

do you know what either of these are;

Site root, or document root directory?

Document level folder/directory?

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 16 Jun 2017 20:43:51 GMT http://www.elated.com/forums/topic/6330#post26681
Re: [Authoring and Programming] directories and paths http://www.elated.com/forums/topic/6330/#post26680 From: newbie1022


Clear as mud!

--
Jim Williams

View » | Reply »

]]>
Fri, 16 Jun 2017 20:01:35 GMT http://www.elated.com/forums/topic/6330#post26680
Re: [Authoring and Programming] directories and paths http://www.elated.com/forums/topic/6330/#post26679 From: chrishirst


Root relative addressing, which is always the same path no matter where it is called from in the website structure is always prefixed with a slash '/'

So, "/images/filename.ext is a root path to a file in the images folder that is in the root folder.

no leading slash "images/filename.ext" would reference a file in the folder as the document being accessed, as would a leading dot and a slash "./images/filename.ext"

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 16 Jun 2017 19:07:44 GMT http://www.elated.com/forums/topic/6330#post26679
[Authoring and Programming] directories and paths http://www.elated.com/forums/topic/6330/#post26678 From: newbie1022


I am having a problem with establishing a path to a file when the source is an image, or video. I see root directories, and such, but can't get my head around all that. Anybody got a tutorial on this? What I need is to know what to put in the line of code so the browser goes to the right file and folder. Thanks!

--
Jim Williams

View » | Reply »

]]>
Fri, 16 Jun 2017 14:33:32 GMT http://www.elated.com/forums/topic/6330#post26678
Re: [Authoring and Programming] Contact Form not working http://www.elated.com/forums/topic/6329/#post26677 From: chrishirst


Define "not working".

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/


View » | Reply »

]]>
Fri, 16 Jun 2017 09:22:53 GMT http://www.elated.com/forums/topic/6329#post26677
[Authoring and Programming] Contact Form not working http://www.elated.com/forums/topic/6329/#post26676 From: cwindfield


Can anyone PLEASE tell me why my contact form isnt working and how to make it secure? I have a php file on my server along with the form on my homepage index.html here is the php code saved in a php file called contact.php



Code:
--------------------
<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_about = $_POST['about'];
$field_message = $_POST['message'];

// Replace with your email adress here
$mail_to = 'chauncey@meetmckenziemason.com';

$subject = 'Message from a site visitor '.$field_email;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Talk about: '.$field_about."\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Your message has been sent');
window.location = 'index.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed!');
window.location = 'index.html';
</script>
<?php
}
?>
--------------------



And here is the form:


Code:
--------------------
<form id="main-contact-form" action="contact.php" method="post" name="contact" >
<div class="field">
<p>Name <span class="colored">*</span></p>
<input name="name" type="text" class="required" title="Please type your name." placeholder="Name...">
</div>

<div class="field">
<p>Email address <span class="colored">*</span></p>
<input name="email" type="text" placeholder="Email...">
</div>

<div class="field">
<p>Subject</p>
<input name="about" type="text" placeholder="Subject...">
</div>

<div class="field">
<p>Type a message <span class="colored">*</span></p>
<textarea name="message" cols="15" rows="5" class="required" placeholder="Message..." title="Please type a message."></textarea>
</div>

<div class="button-container">
<button class="btn btn-submit" type="submit" name="submit">Send Message </button>
</div>

</form>
--------------------



Also the web address is www.meetmckenziemason.com I used a simple html template that came with a mail form and its just not working. Can anyone help?

--
CW

View » | Reply »

]]>
Thu, 15 Jun 2017 21:40:01 GMT http://www.elated.com/forums/topic/6329#post26676