Web Development

I want to be able to change and style the same header and footer on every page on a site. Without editing multiple pages. Is this only possible through PHP includes?

webdev: reddit for web developers - 25 min 15 sec ago

So basically I have the same header and footer on every page. It seems pointless having to edit multiple pages for just one change or even an entire change to both the header and footer. I've done this once on a wordpress site years ago, can re-wrap my head around it, but just wanted to know if this was still the current practice as i've been out of the game for a number of years and am having to re-learn everything.

submitted by /u/KungFuSue
[link] [comments]
Categories: Web Development

Is there a free way to get a domain name and set up free hosting for it? I want to learn how to develop websites from start to finish.

Sorry if this isnt the right place to ask these questions, i am not asking for freebies or anything like that I just want to learn how to set up a web domain to a host for free.

Lately i learned how to make a website with HTML,CSS,JS,Bootsrap and etc, but now i want to learn Php and mySQL, but to do so i need to actually set up a site with a server and ftp, so i just want to know if anyone can point me in the right direction where i can find a free domain name or subdomain name if that works and a free host so i can practice and learn.

Thanks in anticipation.

P.S. : I do not post often on any subreddit and i apologize if i broke some of the rules of this /r/. Thanks.

submitted by /u/Vlad246
[link] [comments]
Categories: Web Development

Weekly useful Drupal things to know thread

What's a useful tip or technique or tool (or anything) that you picked up and think others should know about?

(Check out the weekly post schedule in the sidebar)

submitted by /u/AutoModerator
[link] [comments]

What are the general rules for images on a website?

webdev: reddit for web developers - 1 hour 33 sec ago

I mean in terms of sizing and optimizing. Let's say i want to use 5 thumbnails and a hero picture. this site says thumbnails should be 30kb and "larger ones" 60-100kb. I saw that google has a tool to reduce file size in pictures but if i was about to crop them first for my own usability, what are the things i should look out for?

submitted by /u/LeBigMac84
[link] [comments]
Categories: Web Development

New website advice

webdev: reddit for web developers - 1 hour 25 min ago

Hi reddit,

(first of all, my apologies if I break the rules if this question is too much in line with the "how to get started" FAQ

So, as a sort of hobby/project I want to create a website that I want to use for playing and keeping track of a D&D campaign. For those that do not know what that means, the website will have to do sort of the following tasks:

  • keep character sheet information: this is basically a bunch of text and number in editable fields with some simple calculation.
    Made into a nice looking page
  • character inventory: also some basic editable text and stats with some simple calculations, mainly needs to look nice
  • crafting: simple calculations and some random numbers to simulate dice rolls
  • campaign diary: just text with maybe some pictures and a map

At the moment I have no experience with WebDev, but I work in IT and I am fairly quick in learning new stuff. I hope I can get some pointers on language, tools, editors,.... that would be most beneficial to learn for this (with hopefully a low difficulty entry point). I know I could probably do all of this in Google Spreadsheets, but it is more about the building than the result.

Thank you for any advice.

submitted by /u/gjerdsen
[link] [comments]
Categories: Web Development

Google indexes random spammy links from my Wordpress website

webdev: reddit for web developers - 1 hour 31 min ago

Hello everyone,

I've been battling with one frustating issue regarding my Wordpress installation.

Recently I noticed that Google started to index my website - so far all good. What's not good is that one day I decided to scroll a few Google result pages and I noticed that something is off. There are spammy links coming from my Wordpress website, that, if clicked on, return a 404 error. After some time new spammy links appear, but I haven't had more than 10-15 spammy links.

The actual links of pages my website has are indexed with priority so that is at least good. You can see the spam only if you go multiple pages back.

Has anyone ever experienced something like this?

Things I've tried:

  • Reinstall Wordpress installation, rebuild the website from scratch
  • Reinstall Apache
  • Update everything
  • Request Google URL removal (but they appear again after some time - meaning Google thinks these are actual pages - malware makes Google think that and I need to get rid of it). Google states, that in order for removal tool to be permanent, actual pages need to be removed. I don't know what to do.

Things I haven't tried:

  • Reinstall the machine it's hosted on (I will do this if there's absolutely no way of pinpointing the issue or at least finding the source of the malware). It's ran on Ubuntu 16.04. Reinstalling is the last resort.

Links look like this (I have removed the domain name from images for privacy. I will reveal it if it will be necessary to find out the issue).


Mind you, the spammy links date way back to 2013-2014. The website was launched late 2018. I host it on a private machine and have applied all server related security measurements I could've thought of at the time

Has anyone got any idea? The site is registered in Webmaster Tools and Analytics, if anything.

If any of you indeed are able to pinpoint the issue and the root of the malware and how to get rid of it, please do so. If, after whatever fix needs to be applied, everything works as expected, I will do my best to reward you (Paypal only).

submitted by /u/NKNZ
[link] [comments]
Categories: Web Development

Creating a composer file for a custom module. How should I test it?

I've been working on a D8 module Flot, and I want to get it so simplytest.me can install it for users and developers to test. I was trying to get a drush make file set up for it, but I just read that drush make is deprecated, so I'm moving to composer. This module depends on a javascript library that is not in composer. simplytest.me says , " Composer support for modules should now be functional " and that, " it will execute composer install in the projects root directory. "

Here is my composer.json.

{ "name": "drupal/flot", "description": "This module provides a wrapper for the javascript FLOT library.", "type": "drupal-module", "homepage": "https://drupal.org/project/flot", "minimum-stability": "dev", "repositories": [ { "type": "package", "package": { "name": "flot/flot", "version": "master", "type": "drupal-library", "source": { "type": "git", "url": "https://github.com/flot/flot.git", "reference": "master" } } } ], "require": { "flot/flot": "master" }, "extra": { "installer-paths": { "../../libraries/{$name}": [ "type:drupal-library" ] } } }

I'm having a hard time getting the libraries installed correctly. If I just have this file and type composer require flot/flot it will download. If I install drupal and type composer require drupal/flot it does not. Any advice on changes I should make?

submitted by /u/TheRealBeakerboy
[link] [comments]

Beginner Questions - January 18, 2019

webdev: reddit for web developers - 1 hour 41 min ago

If you're new to web development and would like to ask experienced and professional web developers a question, please post below.

  • Remember, that questions that have context and are clear and specific generally are answered while broad, sweeping questions are generally ignored.

  • Be polite and consider upvoting helpful responses.

  • If you can answer questions, take a few minutes to help others out as you ask others to help you.

submitted by /u/AutoModerator
[link] [comments]
Categories: Web Development

Website for plex/emby users

webdev: reddit for web developers - 1 hour 46 min ago

I would like to make a simpel website so people using the sites doesn't have to type in the ip for plex or emby. I was thinking something like a black page and there would be square icons for each of the ip's i just don't know how to get started doing something like this.

I will also be hosting the site on my own server and id like to know how to do this ?

submitted by /u/luka1745
[link] [comments]
Categories: Web Development

What are the tell tales of a lazy, unprofessional, poorly financed website?

webdev: reddit for web developers - 2 hours 43 sec ago

Background - I work in IT Security and one of the threats we face is an attacker setting up a malicious website and spear-phishing a user in order to get them to visit the site and become infected by malware. The attackers are typically not professional web developers and their website/domains often don't include privacy policies, use free "Lets Encrypt/Comodo" 90 day certificates, register the domain for only a year (because it's for a bespoke phish), don't use their own mailservers for email etc etc. What other things would you expect to see (in terms of HTML/CSS/Javascript) that would suggest the site is transient or has been produced by an amateur?

My plan is eventually to write some code that will visit websites and detect all of these tell-tales, then score the site and alert if it looks suspicious. Many thanks.

submitted by /u/m0wax
[link] [comments]
Categories: Web Development

Help with ajax request in php/js

webdev: reddit for web developers - 2 hours 17 min ago

The following is the code:(I took from w3schools php ajax and modified a bit)

function showHint(str,value\pr) {)

var val\obt= str*value_pr;)

var xhttp;

var xmlhttp = new XMLHttpRequest(;)

xmlhttp.onreadystatechange = function( {)

if (this.readyState == 4 && this.status == 200 {)

document.getElementById("print\ajax").innerHTML = this.responseText;)


xmlhttp.open("GET", "calculate.php?q="+str, true;)




The calculate.php has only one line of code,echo $res === "" ? "" : $q;

I might be doing it hugely wrong, help me please.Also I've tried using this line to pass the 2 values to php as follows:

xmlhttp.open("GET", "calculate.php?q="+str\value_pr, true);)

and I used explode function to separate the text before and after * in the string and multiplied and echo the result. Nothing worked.

submitted by /u/NinjaKnock
[link] [comments]
Categories: Web Development

Nginx serving old version of website

webdev: reddit for web developers - 3 hours 2 min ago

Please help for some unknown reason, an old version of my website is now being served and none of the css files that relate to it actually exist on my dev laptop or the server. I had the site working fine yesterday and just pushed an update only for the original version to be the one that is shown in the browser.

Website is using django - manage.py collectstatic has been done.

Nginx status is running and healthy - sendfile is set to off.

gunicorn is up and running

Postgresql is also upto data and running

all migrations have been done and the settings.py file is the production version with allowed hosts correct and debug set to off.

It seems to me that Nginx is serving cached files from somewhere, but I can't find where that folder is. I don't know what to do, the site is down purely because the wrong versions of static files are being served

submitted by /u/iFunktion
[link] [comments]
Categories: Web Development

Free PHP Google Maps private API

webdev: reddit for web developers - 3 hours 14 min ago

Words of my friend juanmipw, all credits for him:

I want you to know i'm developing a "free gmaps private api" you can check at github page.


What does gmaps-facade do?

Main features:

  • Get Location name by geocoords.
  • Get geocoords by name location.
  • Get satellite image by coords (in progress).
  • And much more to develop...


Using Composer:

composer require juanmicl/gmaps-facade <---- PHP CODE ----> include __DIR__ . "/../vendor/autoload.php"; $gmaps = new \GmapsFacade\Gmaps(); <---- PHP CODE---->


Get Location name:

<---- PHP CODE ----> include __DIR__ . "/../vendor/autoload.php"; $gmaps = new \GmapsFacade\Gmaps(); $data = $gmaps->getPlace(40.4167754,-3.7037902); echo json_encode($data, JSON_UNESCAPED_UNICODE); <---- PHP CODE ---->


<---- JSON ----> {"0":{"name":"Madrid","x":40.4167754,"y":-3.7037902,"m":"40.4167754,-3.7037902"},"success":true} <---- JSON ---->

Get Coordinates by location name:

<---- PHP CODE ----> include __DIR__ . "/../vendor/autoload.php"; $gmaps = new \GmapsFacade\Gmaps(); $data = $gmaps->getPlace(40.416775,-3.703790); echo json_encode($data, JSON_UNESCAPED_UNICODE); <---- PHP CODE ---->


<---- JSON ----> {"0":{"place":"Puerta del Sol","cp":"28013","location":"Madrid"},"success":true} <---- JSON ---->

Online examples:



submitted by /u/BISH4
[link] [comments]
Categories: Web Development