Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=nehkz;42406355]Alright then, I finally get to change my shitty hosting this month so I need some suggestions.
Here's what I need:
- Privacy conscious
- Offers shared, vps and dedicated hosting
- Doesn't recuire paypal or something similar
Any ideas?[/QUOTE]
What's wrong with paypal, pretty much every provider will use that
[QUOTE=Goz3rr;42406429]What's wrong with paypal, pretty much every provider will use that[/QUOTE]
See my first point. They aren't.
I boycott them a while back.
[QUOTE=Moofy;42403497]I forgot, where exactly is it now I place the
[code]"theme": "Soda Light 3.sublime-theme"[/code]
In my Sublime Text user preferences, I paste it almost everywhere in there, save and I get an error.[/QUOTE]
What's the error?
[QUOTE=borisjake;42404698]Hi, I'm playing around with javascript and trying to get classes to work.
I've got an class I've created called 'MovingBlock', here's the code I created:
[code]// Moving Object Class
function MovingBlock(x, y, image) {
//attributes
this.x = x;
this.y = y;
this.image = image;
}
MovingBlock.prototype.draw() = function () {
drawImage(this.x, this.y, this.image);
};
MovingBlock.prototype.update() = function () {
this.x++;
if (this.x > c.width)
this.x = -this.image.width;
};[/code]
I'm creating an instance of that class and for some reason when it comes to calling the 'draw' method I'm getting this error:
"Uncaught ReferenceError: Invalid left-hand side in assignment"
for the line:
[code]MovingBlock.prototype.draw() = function () {[/code]
and also for some reason the error:
"Uncaught TypeError: Object #<MovingBlock> has no method 'update' "
Could anyone give me a hand here?[/QUOTE]
Should be:
[code]MovingBlock.prototype.draw = function () {[/code]
I am willing to learn something special. What do you guys think about WebGL?
[QUOTE=alexanderk;42407139]What's the error?[/QUOTE]
Snipped, I figured it out. Erased everything in there and pasted that in. :)
[QUOTE=Moofy;42407497]Snipped, I figured it out. Erased everything in there and pasted that in. :)[/QUOTE]
You were probably just missing a comma somewhere. Sublime text config files have to be perfectly valid JSON or they give you errors.
[QUOTE=Superkipje;42405388]You might want to use some different colours or at least play around with them a bit more they don't really seem to fit. As for the coloured buttons, If you're going to use icons in the blocks you might want to align the text vertically
That's my opinion at least.[/QUOTE]
Do you mean the background color or the box colors?
Trying to make something "simple" with PHP.
I want to make some sort of input field that affects a part of my website, for instance a paragraph that can be edited with an input field and it changes when hit submit.
Sounds pretty simple, but is it? And where should I start, what sort of things should I look in PHP to make this happen?
[QUOTE=Moofy;42407889]Trying to make something "simple" with PHP.
I want to make some sort of input field that affects a part of my website, for instance a paragraph that can be edited with an input field and it changes when hit submit.
Sounds pretty simple, but is it? And where should I start, what sort of things should I look in PHP to make this happen?[/QUOTE]
It can't only be done with php (as far as I know.)
You need AJAX too.
(Jquery saves the day)
[editline]4th October 2013[/editline]
I think you could just as well use [URL="http://www.appelsiini.net/projects/jeditable"]Jeditable[/URL]
(Unless you want to do code all for yourself)
[QUOTE=gokiyono;42407961]It can't only be done with php (as far as I know.)
You need AJAX too.
(Jquery saves the day)
[editline]4th October 2013[/editline]
I think you could just as well use [URL="http://www.appelsiini.net/projects/jeditable"]Jeditable[/URL]
(Unless you want to do code all for yourself)[/QUOTE]
You don't need jquery to do this at all, what are you talking about?
[editline]4th October 2013[/editline]
[QUOTE=Moofy;42407889]Trying to make something "simple" with PHP.
I want to make some sort of input field that affects a part of my website, for instance a paragraph that can be edited with an input field and it changes when hit submit.
Sounds pretty simple, but is it? And where should I start, what sort of things should I look in PHP to make this happen?[/QUOTE]
Look up how to use forms with PHP to learn how to get the data from the form, and then look up how to use databases (I'd start with MySQL) with PHP to learn how to store/retrieve the data that is submitted through the form.
Gave up with the metro design, it didnt look right. Moved back onto the About.me design.
Thoughts?
[QUOTE][IMG]http://i.imgur.com/Q0JuQZr.jpg[/IMG][/QUOTE]
[QUOTE=Richy19;42408277]Gave up with the metro design, it didnt look right. Moved back onto the About.me design.
Thoughts?[/QUOTE]
Why "copy" some design if you code it yourself, think more unique!
[editline]4th October 2013[/editline]
[QUOTE=KmartSqrl;42408208]
Look up how to use forms with PHP to learn how to get the data from the form, and then look up how to use databases (I'd start with MySQL) with PHP to learn how to store/retrieve the data that is submitted through the form.[/QUOTE]
MySQL as well? Seems pretty advanced considering I just want it to be able to change some text, I thought I could just tell it to interact with a value and that value changes according to what the user puts in the form. :suicide:
[QUOTE=KmartSqrl;42408208]You don't need jquery to do this at all, what are you talking about?[/QUOTE]
I guess I just like the idea that you can click what you want to change, and then change it on the same page.
[QUOTE=Moofy;42408296]Why "copy" some design if you code it yourself, think more unique![/QUOTE]
Because im shit at design/creativity :(
[QUOTE=Richy19;42408381]Because im shit at design/creativity :([/QUOTE]
The only way to get better is to do it more.
[QUOTE=Richy19;42408381]Because im shit at design/creativity :([/QUOTE]
What I like to do is mark up some basic design in some illustration software and mark it up.
Or go free flow, choose some colours you like, look up their meaning and make it illustrate what suits you, then just edit along the way until you're finally struct with an idea and then you develop it.
[QUOTE=Moofy;42408296]
MySQL as well? Seems pretty advanced considering I just want it to be able to change some text, I thought I could just tell it to interact with a value and that value changes according to what the user puts in the form. :suicide:[/QUOTE]
Depends on what you want to do.
If you want the text to change realtime, you'd need AJAX or something Javascript-based, since the server can't change the client's page once sent.
If you want it to change after submitting a form:
-Do you want it to show only once? You don't need to store it then.
-Do you want it to be shown various times? You'll need to save it on a database/file/somewhere.
I guess it's only to be sent and shown once, so you'd just toy around with the text and <?php print htmlentities($_GET['bla']); ?> or <?php htmlentities($_POST['bla']); ?> , being 'bla' the name of the <input .... > in the form.
Well imagine that I have this piece of text "lorem ipsum dolor sie amet".. And I decide that I want to change that, of course I can edit the file such as index.html but just for fun I would like to make a input where I can edit it. So I can input in that textfield "Lorem ipsum I dont know this shit in my head" and it will update after I hit submit (and refresh the page of course, but I dont plan to have the form where you edit the stuff on the same page so it would refresh automatically when going back).
[QUOTE=Moofy;42408663]Well imagine that I have this piece of text "lorem ipsum dolor sie amet".. And I decide that I want to change that, of course I can edit the file such as index.html but just for fun I would like to make a input where I can edit it. So I can input in that textfield "Lorem ipsum I dont know this shit in my head" and it will update after I hit submit (and refresh the page of course, but I dont plan to have the form where you edit the stuff on the same page so it would refresh automatically when going back).[/QUOTE]
If you have the Lorem Ipsum in your database
You get it from the database and echo it on the page
And you have an input type text that updates the field Lorem Ipsum is in
Thank you! I knew it was a just one of them things that my eyes were refusing to look at...
[QUOTE=KmartSqrl;42407411]Should be:
[code]MovingBlock.prototype.draw = function () {[/code][/QUOTE]
[QUOTE=gokiyono;42408742]If you have the Lorem Ipsum in your database
You get it from the database and echo it on the page
And you have an input type text that updates the field Lorem Ipsum is in[/QUOTE]
Yes I realised that, but how to do it with PHP. That's what I don't know. I need to know what I should look into like forms :v:
[QUOTE=gokiyono;42408742]If you have the Lorem Ipsum in your database
You get it from the database and echo it on the page
And you have an input type text that updates the field Lorem Ipsum is in[/QUOTE]
Doing a database + tables + user + sql queries for just one piece of text looks overkill IMO, I'd just write it down to some .txt file with fopen,fwrite and fclose.
[QUOTE=Coment;42409036]Doing a database + tables + user + sql queries for just one piece of text looks overkill IMO, I'd just write it down to some .txt file with fopen,fwrite and fclose.[/QUOTE]
I didn't realise it took so much effort to make :o
[QUOTE=Moofy;42408980]Yes I realised that, but how to do it with PHP. That's what I don't know. I need to know what I should look into like forms :v:[/QUOTE]
[B]VERY [U]BASIC[/U][/B]
Just to give you an idea
[code]
<form action="path.php" method="POST">
<input type="text" name="field">
<input type="submit">
</form>
[/code]
[php]
$var = htmlentities($_POST['field'], ENT_QUOTES);
$con = new mysqli(connectionDetails);
$sql = "UPDATE table_name SET columnValue='" . $var . "' WHERE columnId='loremDiv';";
$con->query($sql);
[/php]
[php]
<php
$con = new mysqli(connectionDetails);
$sql = "SELECT columnValue FROM table_name WHERE columnId='loremDiv';";
$query = $con->query($sql);
$result = $query->fetch_object();
?>
<div id='content'>
<?php echo $result->columnValue; ?>
</div>
[/php]
KmartSqrl or CBastard might kill me for this
[QUOTE=Moofy;42408980]Yes I realised that, but how to do it with PHP. That's what I don't know. I need to know what I should look into like forms :v:[/QUOTE]
I already told you exactly what to look into lol
[QUOTE=Richy19;42407550]Do you mean the background color or the box colors?[/QUOTE]
Yes, I do. And you might want to try to fill up the box with the logo's and have the text on the bottom of the box overlapping the logo a bit.
[URL="http://chunkhost.com/"]So I found this host[/URL]. Anyone had experience with them?
[QUOTE=nehkz;42414421][URL="http://chunkhost.com/"]So I found this host[/URL]. Anyone had experience with them?[/QUOTE]
Not personally, but I found this.
Hope it helps.
[url]https://getsatisfaction.com/chunkhost/topics/free_chunk_pending_machine?utm_content=topic_link&utm_medium=email&utm_source=reply_notification[/url]
Ok so I'm trying to display images from a website on this webapp I'm making for university. The images I need to display are randomly selected, so they change. I can construct the url of a webpage that contains just the image and some text, but not the url of the image itself because the webpage generates temporary images every time.
So I've put that webpage into an object on the page but now i want to get rid of the text and just have the image. Is there anyway to access an image that is in text/html <object> tags?
Here is an example of the webpages i'm embedding [url]http://trove.nla.gov.au/ndp/del/printArticleJpg/131330226/3?print=n[/url]
The point of the webapp is to guess the decade in which the newspaper article was printed, so the text needs to be removed somehow.
Sorry, you need to Log In to post a reply to this thread.