Seeking advice.

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
I have come upon several questions that are on my mind and although I do a lot of online research, sometimes the obvious questions are overlooked in many tutorials and forums because of their simplicity or my lack of knowledge on what to search to find my answers. Maybe someone here could answer a few simple questions and set me in the right direction.

1. content management systems. I understand that you can keep the content separate from the layout, but I don't want to live by a premade template. Is there a way to simply specify in your website with brackets or something where to pull the content from? How exactly do these systems work? If you are not using a blog, is it even needed? I don't want to learn to use one if it's unnecessary. And at my grasp of knowledge at the moment, it would be a big sidetrack probably.

[del]2. is there a way to keep the template html separate from the content easily? The header/navbar/footer shouldn't change across 99% of my pages, so it seems foolish to have to copy and paste info into each page that way. If I wanted to change or add a link, for example, I would have to go edit all of my pages. At this point, it's not a problem, but I could imagine it being one in the future. Any advice on this subject?
edit: Dreamweaver template solves my problem for now, but it would still be nice to know that I could plug in a navbar with server scripts before the html is interpreted.[/del]

[del]3. PHP or ASP?[/del]

[del]4. I am using PHP at the moment. I have a form that uses an action to a PHP page for server-side stuff. Can I do this with all PHP related stuff? Or should I make the pages have the php extension instead of html? Javascript is really cool because you can have it in a separate file and just throw answers back to the original html. Can PHP be utilized this way or is it a stupid thought? It feels weird to have to lock a page into the php extension just to use one form for example.[/del]

[del]5. textfield has a drag spot at lower right side.... you can drag this sucker really big. css textarea{resize:none;} doesn't seem to change it as I have been told. why?[/del]

[del]6. how do i start learning about how to make a login and set up a session and then permit access to certain pages based on being logged in... I know this is broad which is why i need a bit of direction. I'm a database noob and it doesn't seem like you can find this stuff online in words and expressions that I understand. Sure i can learn some sql... but.... how do i actually use it in practice?[/del]

[del]7. can you use javascript to validate form fields BEFORE sending to action=whatever.php ?[/del]

If you can answer any of these areas I would appreciate it. I'm not being lazy... it's just hard to find some answers without bringing up 20 more while trying to research online. Thanks guys!
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
1. Content Management Server are important because they decrease the load on the servers. On it, you put static files such as images, stylesheets and scripts. Images, stylesheets and scripts should always be static as the browsers cache them. If you constantly change them, you lose the whole point of caching. What people usually do is that they output the changing things in the content, <script>var username='John Doe'</script>.

2. PHP has the include function which allows you to read another file, and execute it if possible. So in your PHP script, where your header should be simply put a include 'header.php'; and it will put that file right there. PS: Do not use Dreamweaver.

3. PHP

4. I'm not sure to understand your question, perhaps you misunderstand what each thing does. PHP is executed on the SERVER and is meant to echo html generated dynamically. JavaScript runs in the browser and handle user events and stuff like that. If you want to use a form, you'll need a php extension. It tells the server that it has to execute that file.

6. An excellent tutorial by our friend UndeadDragon: http://www.thehelper.net/forums/showthread.php/137076-How-to-create-a-PHP-MySQL-login

7. You can override the onsubmit event and control if the form is submitted. If you return false in the callback, the form is not sent. However, you must be careful. Everything client side can be hacked and therefore you must revalidate the information server side.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
1. what should I know about content management systems before I get into one?

2. I don't have to convert the file into a php extension to use include do I? why shouldn't I use dreamweaver?
I got server side includes (SSI) to work on my webpage. It seems pretty legit... but i hear there are some delay issues that can occur... probably nothing important with the scope of my project atm but still something to be conscious of. I really just want to know SHOULD I be using SSI, or is it bad form as a developer to do so?

4/7. I think I was getting impatient because whenever I uploaded my php scripts, the server wasn't updating them as fast as other pages. I'm guessing it checks all scripts or something before making them available. the onSubmit is working fine for me now... does the order matter where I put the onSubmit ? Could also have been the issue. I already have re-validation in my php script :) what type of things should I look out for when it comes to people trying to break my site btw?
 

Artificial

Without Intelligence
Reaction score
326
  1. GetTriggerUnit- is mixing content management systems (CMS) with content delivery networks (CDN). A CDN does what he explained, but a CMS is something like WordPress that allows you to manage your content from some kind of an interface instead of by having to get involved with the code so much. The best way to learn about them and to get experience with them is to just experiment. Install one and get familiar with its interface. After that you can see how plugins are made for that CMS and after that perhaps even take a look at the source code to see how it was created (the code base will likely be rather large, though, so it might be a bit tricky to understand).

    Most CMS's also don't tie you to a single template, rather they have a templating language in which templates are made. When a template is compiled to regular HTML, the templating language's special constructs are run with the values given in the context. Here's an example template made in one of those templating languages:
    Code:
    <ol>
      {% for user in users %}
        <li>{{user.name}}</li>
      {% endfor %}
    </ol>
    If this template was given a context that ties the name 'users' to a list of objects of which each has a name, the output could be for example the following:
    Code:
    <ol>
        <li>Dan</li>
        <li>GetTriggerUnit-</li>
        <li>Artificial</li>
    </ol>

    If you wish to learn to code a website, you shouldn't use a CMS to do so, as setting up a website using one requires no coding whatsoever. You shouldn't however completely forget them, as looking into how they work, how they're designed and how they've solved problems you have encountered can be enlightening.
  2. URLs do not need to be valid file paths. That means they don't actually need to end in an extension like .php or .html, which is why urls such as stackoverflow.com/questions can exist. But figuring out which file should be executed based on the URL is a lot easier if the URL is a valid file path, and that's why for example Apache does that. The majority of server software actually allow you to define your own "routes", meaning your own mappings that map a given URL to a given script that produces the response. If you use Apache, you should look into mod_rewrite to see how you can leave the extension out, or if you're making your own server (which I wouldn't really recommend unless you're using node.js or something similar) you could just implement a routing mechanism of your own.

    You should not use DreamWeaver, because it hides away the things you wish to/should learn.
  3. Whichever you are more conformatable with. PHP is a more traditional way to learn, though, and has probably a lot more information and tutorials available.
    [*]-
    [*]-
  4. If you can't understand it from a tutorial, I'd suggest breaking it down to pieces. The first piece is making a login script that doesn't store usernames or passwords, but uses a preset username-password pair defined in the script. In this part you need to only worry about allowing them to login (submit the login form and check the credentials), allowing them to logout, and keeping them logged in (sessions and cookies). The second piece is about the database part. In this part you should make a function that takes a username and a password and returns a boolean indicating whether the database has a user with that given name and if the password matches (do not store the password in plaintext).
  5. A couple of the most important things when it comes to site security are SQL injections and script injections. SQL injections can happen when you insert user-originated data in your SQL statements. In this scenario the data contains SQL commands in such a format that they will be executed with your statement. To avoid these you could look into mysqli's prepared statements. Script injections allow users to insert their own HTML or JavaScript code on your pages. This can happen if you for example retrieve user-originated data from your database and insert it in the result without making sure it doesn't contain HTML's special characters first. One way to do so is to convert them to their safe versions using htmlspecialchars.
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
1. what should I know about content management systems before I get into one?

2. I don't have to convert the file into a php extension to use include do I? why shouldn't I use dreamweaver?
I got server side includes (SSI) to work on my webpage. It seems pretty legit... but i hear there are some delay issues that can occur... probably nothing important with the scope of my project atm but still something to be conscious of. I really just want to know SHOULD I be using SSI, or is it bad form as a developer to do so?

4/7. I think I was getting impatient because whenever I uploaded my php scripts, the server wasn't updating them as fast as other pages. I'm guessing it checks all scripts or something before making them available. the onSubmit is working fine for me now... does the order matter where I put the onSubmit ? Could also have been the issue. I already have re-validation in my php script :) what type of things should I look out for when it comes to people trying to break my site btw?

I'm truly sorry mixing up CMS and CDN.

You shouldn't use Dreamweaver because as Artificial said it hides the things from you but it is also proprietary. If you want something WYSIWYG (what you see is what you get), you should use Kompozer. It's free, open source and just as good as Dreamweaver.

Also I recommend PHP but I haven't said why. PHP is widely used, open source, has tons and tons of frameworks, a neat documention and almost all shared webhosts use PHP. Of course there probably webhosts for ASP but much less than for PHP. Also PHP is meant for be used for web but you can also do script with it. If you install php you can easily run scripts from the command line. It might also be possible in ASP, but I've never seen ASP scripts so far.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
1. the reason I'm interested in CMS is that my friend wants to add in a blog to his site... which would require content management for HIM to be able to update the site without having to know anything about web design. Also, separating content from structure is always cool...right?

2.i thought that people got away without putting extensions by using a directory with an "index.html" and then only specifying the folder in the link... I'm confused.

so what about SSI? do you reccomend it? or is there another way to handle repetitive html...


I don't really use dreamweaver the way I assume some people do. I spend more time in the code section than anything else and i mostly just use it to help keep the files in order and for it's use as a ftp client. So I don't think I'm getting into any bad habits yet. I just don't want to develop any.

Web development has a lot of angles and no one tells you how to be a good web developer or how to conform to "standards" and have good habits. content is everywhere... and I've already been down a million paths to learn a few simple things. It's maddening but also seriously intriguing me.
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
1. the reason I'm interested in CMS is that my friend wants to add in a blog to his site... which would require content management for HIM to be able to update the site without having to know anything about web design. Also, separating content from structure is always cool...right?

2.i thought that people got away without putting extensions by using a directory with an "index.html" and then only specifying the folder in the link... I'm confused.

so what about SSI? do you reccomend it? or is there another way to handle repetitive html...

1. For a Blog WordPress is simply awesome. There's plenty of themes and extensions and is open source ( <3 )

2. Let's say we're using apache. The user asks for http://example.com/test/ in his browser. Apache will check if the folder test exists in the server's root and if it does, it will go in the folder. It will then look for the Directory Index. If the configuration file .htaccess file is there, it will look for it into it. If it doesn't find anything, it will use the default one, index.html, index.php, etc.

For server side includes, I've personally never used it. I've made a quick check and it requires some apache modules. If your host doesn't have those modules installed, they won't work. I'd recommend PHP in order to include stuff. This page shows how to use it, quite simple.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
php files are parsed by the server before being sent to the user am I right?
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
so each php file is similar to having one html page put together with different html pages through ssi "include"s. This makes sense, as you can have includes with php... php offers server side scripts though, so that's a plus.

(i know that i'm being a little silly here, but i'm getting at something)

my question then I guess, is the timing that it takes on the server to parse a php file. is it insignificant? My small site would be a cinch to parse, but I don't want to get into bad practices, that's all. If load speed is not part of the equation, then I wonder why any page would ever have an html extension... if server side code was ever needed on that page, it would have to be changed to a php extension and in order to not break links, and you would have to have a redirect...

soooo....


does this bring us to having our directories pointing to the default page through a .htaccess file?
should i have all (or major) pages point to a directory folder instead of the file itself?

are most webpages using php scripts?

I just really want to learn to do things the right way, and not start bad habits. should I default to making php files or just change them as necessary or what?
 

Slapshot136

Divide et impera
Reaction score
471
my question then I guess, is the timing that it takes on the server to parse a php file. is it insignificant?

if the only thing in your php file is includes, then yes, it would be practically the same as a html file

are most webpages using php scripts?

more complicated pages are usually .asp or .jsp pages
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
more complicated pages are usually .asp or .jsp pages
This isn't always true. Facebook uses a tool which converts PHP scripts to C++ programs for efficiency. They published thier solutions as open source software. PHP is as strong as JSP or ASP, the http server makes the difference. If scalability is an issue for you, I'd recommend using nginx or cherokee webserver with PHP FastCGI.

If this is still not enough then you should use facebook's server with facebook's converter with facebook's database (Cassandra) an apache project.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
hehe

I wish I was at a stage where I could speak about "if that isn't good enough" solutions to serious issues. right now i'm pretty small time.

I just want to know, if I am using includes for my header and footer and navbar (which I am for efficiency and consistancy atm) should I default to using shtml extensions or should I just start them off as php files and do a php include instead. right now i'm just naming all my files with the shtml extension so the server can parse them and include the redundant html code fragments.

I'm talking habits and the "right way" here. I don't want to be all weird with the way I go about things.

I'm currently using notepad++ to write my site. it has a built in ftp. :)
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
I thought that might be the case.

Thanks for the help guys. I'll probably keep adding questions to this or other threads on the subject when I need advice if you guys are willing to pop in from time to time. I appreciate the advice you guys have given me thus far.

:)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top