Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=Banshee FrieNd;33309377]That doesn't tell me a damn thing. My question has nothing at all to do with the code. It's about hosting it with my server computer and linking my Domain name to the html file on my server computer.[/QUOTE]
Alright then.
Start your sever app on your computer (This would be apache or something)
Make your HTML file (If you don't have this yet refer to my post)
Put your website HTML file in the server app's website directory (if you don't know what it is post the name of your web server software so we can find out) its sometimes in like c://program files/apache/www/ or something
Get your IP address [url]www.whatismyip.com[/url]
Assign IP address to DNS entry (This means register your IP to a DNS entry, This part requires money unless you are using a free DNS or something)
Point your browser to your DNS Address (Aka type in your website name into the browser)
the browser will look for an index.html or index.htm or index.php file if it exists you will just get there by going to [url]www.yoursite.com[/url]
But if you don't have an index file you will need to specify the file by going to [url]www.yoursite.com/nameoffile.html[/url]
If this doesn't work make sure your router (the blue thing with black antennas and blinking lights with wires going out of it) has port 80 forwarded otherwise no web traffic is going to leave your house.
[QUOTE=false prophet;33303505]Why does firefox throw an error saying "evt is undefined" when I do something like this:
[code]<script type="text/javascript">
var mouse_x = 0;
var mouse_y = 0;
function getCursorPosition(evt) { mouse_x = evt.offsetX; mouse_y = evt.offsetY; }
</script>
<div id="poop" onmousemove="getCursorPosition(evt)"></div>[/code]
Chrome doesn't have this issue and I don't even care about IE.[/QUOTE]
Maybe it is because the fact that evt IS undefined... use event instead:
onmouseover="getCursorPosition(event);"
but preferably you should bind it through JS and not attributes.
[QUOTE=reeferdk;33313024]Maybe it is because the fact that evt IS undefined... use event instead:
onmouseover="getCursorPosition(event);"
but preferably you should bind it through JS and not attributes.[/QUOTE]
good to know, thanks upside down head guy. I did it through attributes because I wanted to quickly fool around with a project.
[QUOTE=lkymky;33310170]Alright then.
Start your sever app on your computer (This would be apache or something)
Make your HTML file (If you don't have this yet refer to my post)
Put your website HTML file in the server app's website directory (if you don't know what it is post the name of your web server software so we can find out) its sometimes in like c://program files/apache/www/ or something
Get your IP address [url]www.whatismyip.com[/url]
Assign IP address to DNS entry (This means register your IP to a DNS entry, This part requires money unless you are using a free DNS or something)
Point your browser to your DNS Address (Aka type in your website name into the browser)
the browser will look for an index.html or index.htm or index.php file if it exists you will just get there by going to [url]www.yoursite.com[/url]
But if you don't have an index file you will need to specify the file by going to [url]www.yoursite.com/nameoffile.html[/url]
If this doesn't work make sure your router (the blue thing with black antennas and blinking lights with wires going out of it) has port 80 forwarded otherwise no web traffic is going to leave your house.[/QUOTE]
There's what I'm looking for, Server Software. Where do I get it and what's the best.
I and everyone else in this thread would probably recommend a Linux distro. I would personally suggest Debian, but that's up to you.
[QUOTE=Banshee FrieNd;33319201]There's what I'm looking for, Server Software. Where do I get it and what's the best.[/QUOTE]
use linux with lamp(I would think)
"PHP force download of an image from another website"
Possible?
[QUOTE=Sprite;33321885]"PHP force download of an image from another website"
Possible?[/QUOTE]
You could do that from the command line with curl or wget, you don't need PHP, but what's stopping you from finding the image URL in the source code and downloading it from there?
Okay, but how do I connect Apache with MY Domain Name Website? My Ip address goes to my router diagnostic login.
[QUOTE=Banshee FrieNd;33322574]Okay, but how do I connect Apache with MY Domain Name Website? My Ip address goes to my router diagnostic login.[/QUOTE]
Apatche broadcasts your website from your IP address, your domain name is linked to your IP address.
There is no linking between Apache and your domain name.
The problem is your router is using port 80 (the internet port) and is broadcasting also on port 80.
You need to tell your router to use another port for web access. Usually its :8080
[editline]17th November 2011[/editline]
[QUOTE=lkymky;33323794]Apatche broadcasts your website from your IP address, your domain name is linked to your IP address.
There is no linking between Apache and your domain name.
The problem is your router is using port 80 (the internet port) and is broadcasting also on port 80.
You need to tell your router to use another port for web access. Usually its :8080
[editline]17th November 2011[/editline][/QUOTE]
Oh, I forwarded 80. Thanks.
[QUOTE=Octave;33322518]You could do that from the command line with curl or wget, you don't need PHP, but what's stopping you from finding the image URL in the source code and downloading it from there?[/QUOTE]
Ah nice. I'll use cURL. I'll try to figure how that works.
It's not me. It's just to make it easier for my users
[QUOTE=theJohn;33299098]Does anyone know how to implement fonts from a .tcc-file with CSS? It works right now but it gets the regular-font and I want it to get the light-font.[/QUOTE]
You'd have to find some tool to be able to extract the plain fonts out of the collection file, since @font-face is meant to designate a specific face, not a whole family.
I've got a bunch of files and folders that I want to display on my website. They're just assorted code snippets and the like. I want to be able to show them in a sort of directory view, but I'm not sure what approach I should take. It would be easy enough to just list all files in the folder, but I also want files to have metadata too - information such as description which will display when you mouse over a certain file. This is the point where I'm not sure how I want to go about implementing this, once metadata/descriptions is in the equation that information itself has to be stored somewhere. Any ideas on how you guys would go about doing this?
[QUOTE=AMD 32;33341775]I've got a bunch of files and folders that I want to display on my website. They're just assorted code snippets and the like. I want to be able to show them in a sort of directory view, but I'm not sure what approach I should take. It would be easy enough to just list all files in the folder, but I also want files to have metadata too - information such as description which will display when you mouse over a certain file. This is the point where I'm not sure how I want to go about implementing this, once metadata/descriptions is in the equation that information itself has to be stored somewhere. Any ideas on how you guys would go about doing this?[/QUOTE]
[url=https://github.com/FilipeD/dirp]dirp[/url], by yours truly, can do what you're looking for, if you're up for writing an extension for it - you can store that metadata in a database, or as a second metadata file which doesn't show up on the listing. If you decide to use it I'll help you out with any issues you may come across, particularly since there's no official documentation outside the code.
[img]http://i.fildob.com/20111119144554199.png[/img]
I'm sure this is a dumb question, but how would you use $variable->some_variable?? ?
[editline]21st November 2011[/editline]
like how turb made it "php on rails" :v:
[QUOTE=zzlawlzz;33371330]I'm sure this is a dumb question, but how would you use $variable->some_variable?? ?
[editline]21st November 2011[/editline]
like how turb made it "php on rails" :v:[/QUOTE]
You mean...an object property?
[code]
$foo = new stdClass;
$foo->bar = 'hello';
print $foo->bar;
[/code]
[QUOTE=StinkyJoe;33371575]You mean...an object property?
[code]
$foo = new stdClass;
$foo->bar = 'hello';
print $foo->bar;
[/code][/QUOTE]
-snip-
php.net gave me answers :v:
I am having a small problem with background-position for my CSS menu. The css menu uses a sprite, I have set the default state for the menu items using background-position and the same when you hover over each item.
The problem is, is that it's ignoring the default state and showing Home as all the links, but the hover state works fine. I know the alignment is a little off, that easy to fix.
This is the website: [url]http://www.meikledesign.co.uk/host/tls/[/url]
CSS:
[code]
@charset "utf-8";
/* CSS Document */
body {
margin:0px;
background:#570111 url(images/bodyBg.jpg) top center no-repeat;
background-attachment:fixed;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
}
a:link, a:visited, a:active {color:#FFF}
p {margin:0px}
h4 {margin:0px 0px 10px 0px; font-size:16px}
.clearLeft {clear:left}
.imgLeft {margin:0px 10px 0px 0px; float:left; padding:5px; border:1px solid #CCC}
#imagePreload {display:none}
#wrapper {
width:800px;
height:auto;
margin:0px auto 0px auto;
}
#header {
width:800px;
height:100px;
background:url(images/header_tls.png) center top no-repeat;
}
#title {
width:200px;
height:200px;
margin:0px 10px 0px 0px;
padding:0px;
float:left;
}
#slideshow {
margin:0px 0px 0px 210px;
width:480px;
height:200px;
float:left;
}
#navMenu {
width:800px;
height:40px;
margin:10px 0px 10px 0px;
}
#navMenu ul {
margin:0px;
padding:0px;
width:800px;
height:40px;
list-style:none;
}
#navMenu li a {
display:block;
margin:0px 5px 0px 5px;
padding:10px 0px 0px 0px;
float:left;
width:150px;
height:30px;
text-align:center;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:14px;
text-decoration:none;
background:url(images/nav/navSprite.png);
}
a#home {background-position:0px 0px;}
a#home:hover {background-position:0px -40px;}
a#events {background-position: -150px 0px}
a#events:hover {background-position: -150px -40px}
a#photo_gallery {background-position: -300px 0px}
a#photo_gallery:hover {background-position: -300px -40px}
a#menu {background-position: -450px 0px}
a#menu:hover {background-position: -450px -40px}
a#contact {background-position:-600px 0px}
a#contact:hover {background-position: -600px -40px}
#mainContent {
margin:0px 0px 0px 0px;
padding:10px;
width:580px;
height:auto;
min-height:480px;
float:left;
background:#F1F1F1;
border:1px solid #000;
border-radius:3px 3px 3px 3px;
}
#rightContent {
margin:0px 0px 0px 600px;
padding:8px 0px 0px 8px;
width:190px;
height:auto;
min-height:245px;
}
#news {
margin:0px 0px 0px 600px;
padding:8px 0px 0px 8px;
width:190px;
height:auto;
min-height:192px;
}
.cboard {
width:130px;
height:190px;
padding:25px;
background:url(images/chalk_board.png) top center no-repeat;
text-align:left;
font-family:"Comic Sans MS", cursive;
font-size:14px;
color:#FFF;
}
#footer {
width:798px;
height:200px;
margin:20px 0px 0px 0px;
background:#FFF;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:14px;
border:1px solid #000;
border-radius:3px;
}
#footer p {margin:5px 0px 0px 0px; text-align:center}
.footerPanels {
margin:10px 10px 10px 10px;
width:179px;
height:180px;
float:left;
border-bottom:2px solid #333;
}
.footerPanelsList {
margin:0px;
padding:0px;
list-style:none;
}
#footer_copyright {
width:800px;
height:35px;
margin:10px 0px 20px 0px;
text-align:center;
font-size:12px;
color:#FFF;
}
/*Home Page */
#welcome {
margin:0px auto 0px auto;
width:580px;
height:160px;
}
/*Menu Page*/
#menuWrapper {
width:550px;
height:auto;
margin:15px auto 0px auto;
}
.menuItem {
width:520px;
height:100px;
margin:0px auto 10px auto;
border:1px solid #333;
border-radius:3px;
font-size:14px;
padding:5px;
}
.menuPrice {
float:right;
width:50px;
height:25px;
}
[/code]
So I'm trying to read my this table in order to get the data, send it to php, and update something in a mysql db. Only problem is for some godforsaken reason my array isn't being written to. Here's my entire function:
[code]
function submitvalues()
{
var things = new Array();
$(".exc").each(function(index,element)
{
things[$(element).find("td").first().find("span").eq(1).attr('rel')] = new Array();
$(this).nextUntil(".editrow").filter(".datarow").each(function(index2,element2)
{
things[$(element).find("td").first().find("span").eq(1).attr('rel')][$(element2).find("td").eq(2).attr('rel')] = $(element2).find("td").eq(3).html();
console.log("Array["+$(element).find("td").first().find("span").eq(1).attr('rel')+"]["+$(element2).find("td").eq(2).attr('rel')+"] = "+$(element2).find("td").eq(3).html());
});
});
console.log(things);
$.ajax({
type: "POST",
url: "ajax/dataupdate.php",
data: things,
}).done(function( msg ) {
var wat = jQuery.parseJSON(msg);
switch(wat.status)
{
case "error":
//alert("Was not okay.");
break;
case "okay":
//alert("Was okay.");
break;
}
//console.log( wat );
});
}
[/code]
"things" should have some shit written to it, but it doesn't. The logs all show the proper data (this):
[code]
Array[pushups][1321379365] = 93
Array[pushups][1321379300] = 5
Array[pushups][1321379294] = 103
Array[pushups][1321379244] = 118
Array[situps][1321379316] = 86
Array[situps][1321379277] = 114
Array[situps][1321379266] = 90
Array[situps][1321379244] = 42
Array[mile][1321379357] = 38:44
Array[mile][1321379356] = 50:1
Array[mile][1321379290] = 30:36
Array[mile][1321379244] = 5:8
[]
[/code]
Any ideas?
[QUOTE=Meekal;33372433]I am having a small problem with background-position for my CSS menu. The css menu uses a sprite, I have set the default state for the menu items using background-position and the same when you hover over each item.
The problem is, is that it's ignoring the default state and showing Home as all the links, but the hover state works fine. I know the alignment is a little off, that easy to fix.
CSS:
[code]
-snip-
[/code][/QUOTE]
You could use text instead of images.
[code]font-family: Georgia, 'Times New Roman', serif;[/code]
This seems a bit of a trivial thing for a "web design company".
[editline]21st November 2011[/editline]
[QUOTE=jmazouri;33373181]So I'm trying to read my this table in order to get the data, send it to php, and update something in a mysql db. Only problem is for some godforsaken reason my array isn't being written to. Here's my entire function:
[code]
-snip-
[/code]
"things" should have some shit written to it, but it doesn't. The logs all show the proper data (this):
[code]
-snip-
[/code]
Any ideas?[/QUOTE]
Please learn to use variables, then post again. I can't read a damn thing.
How can I make a column on a wordpress blog change when the person is viewing a differnt page or article?
[QUOTE=Dubbed Demon;33376529]How can I make a column on a wordpress blog change when the person is viewing a differnt page or article?[/QUOTE]
You can use [url=http://codex.wordpress.org/Conditional_Tags]Conditional Tags[/url] and change the style or structure.
[QUOTE=jaybuz;33373482]
Please learn to use variables, then post again. I can't read a damn thing.[/QUOTE]
Apologies, I've been at this for a while now, I probably should have noticed that my code looked like arse :v:.
I've cleaned it up here:
[code]
function submitvalues()
{
var things = new Array();
$(".exc").each(function(index,element)
{
var firstindex = $(element).find("td").first().find("span").eq(1).attr('rel');
things[firstindex] = new Array();
$(this).nextUntil(".editrow").filter(".datarow").each(function(index2,element2)
{
var secondindex = $(element2).find("td").eq(2).attr('rel');
var value = $(element2).find("td").eq(3).html();
things[firstindex][secondindex] = value;
console.log("Array["+firstindex+"]["+secondindex+"] = "+value);
});
});
console.log(things);
}
[/code]
Again, my issue is that "things" is always empty after the function is run, whether I check it inside the function or out. However, when checking the data that's actually being put in the array, it always outputs correctly, as if there were no issues.
Works?
[code]
function submitvalues()
{
var things = [],
exc = $(".exc"),
index1,
index2;
for(index1 in exc)
{
var item = $(exc[index1]),
exercise = item.find("td").first().find("span").eq(1).attr('rel'),
watisthis = item.nextUntil(".editrow").filter(".datarow");
things[exercise] = [];
for(index2 in watisthis)
{
var item = $(watisthis[index2]),
id = item.find("td").eq(2).attr('rel'),
val = item.find("td").eq(3).html();
things[exercise][id] = val;
console.log("Array[" + firstindex + "][" + id + "] = " + val);
}
}
console.log(things);
}
[/code]
[editline]22nd November 2011[/editline]
You should use variable names that relate to the contents more because it's still a bit messy.
[QUOTE=jaybuz;33378700]Works?
//code
[/QUOTE]
That seems to cause the entire page to freeze when the function is run :c
Another lame question,
[quote]
<div id="globalnav" class="box">
<h3><font color="white">Links<font color="white"/></h3>
<font color="white"><ul class="link-list">
<li><a href="http://xxx">yyy</a></li>
<li><a href="http://xxx">yyy</a></li>
<li><a href="http://xxx">yyy</a></li>
</div>
[/quote]
How do I indent the title "yyy"? when I use spaces, blockquote, and   it still doesn't indent
[QUOTE=Dubbed Demon;33379125]Another lame question,
How do I indent the title "yyy"? when I use spaces, blockquote, and * it still doesn't indent[/QUOTE]
In CSS you can use the text-indent property, if you were to use embedded styles it would look like this (though you should use an external stylesheet):
[quote]
<div id="globalnav" class="box">
<h3><font color="white">Links<font color="white"/></h3>
<font color="white"><ul class="link-list">
<li><a href="http://xxx" style="text-indent:40px;">yyy</a></li>
<li><a href="http://xxx" style="text-indent:40px;">yyy</a></li>
<li><a href="http://xxx" style="text-indent:40px;">yyy</a></li>
</div>
[/quote]
If you were to use an external stylesheet, you could do something like
HTML
[quote]
<link rel="stylesheet" href="style.css" type="text/css">
<div id="globalnav" class="box">
<h3><font color="white">Links<font color="white"/></h3>
<font color="white"><ul class="link-list">
<li><a href="http://xxx">yyy</a></li>
<li><a href="http://xxx">yyy</a></li>
<li><a href="http://xxx">yyy</a></li>
</div>
[/quote]
style.css
[quote]
li a { text-indent:40px; }
[/quote]
[QUOTE=Meekal;33372433]I am having a small problem with background-position for my CSS menu. The css menu uses a sprite, I have set the default state for the menu items using background-position and the same when you hover over each item.
The problem is, is that it's ignoring the default state and showing Home as all the links, but the hover state works fine. I know the alignment is a little off, that easy to fix.
This is the website: [url]http://www.meikledesign.co.uk/host/tls/[/url]
CSS:
[code]
-snip-
[/code][/QUOTE]
You need to change how you refer to each element (a#events, a#events:hover, etc) to be the same as how you referred it when setting the background (#navMenu li a). So just change each to #navMenu li a#id and #navMenu li a#id:hover. Not entirely sure why this has to be done, but it should make for more readable css anyway.
Another way would be to put !important after the css rules changing the background-position, but I don't think that would be the best way to go about it.
[QUOTE=R1Z3;33377464]You can use [url=http://codex.wordpress.org/Conditional_Tags]Conditional Tags[/url] and change the style or structure.[/QUOTE]
And/or body classes.
[url]http://codex.wordpress.org/Function_Reference/body_class[/url]
Sorry, you need to Log In to post a reply to this thread.