DO NOT DEAL WITH THIS MEMBER
Mar 28, 2018 01:59 PM
(This post was last modified: Mar 28, 2018 01:59 PM by yrnGarry.)
Make a file, called core.php
and in this write this code.
PHP Code
<?php require_once('dbinit.php'); require_once('session.php');
and then in your database file, include your database connection.
For the session.php file, use this code.
PHP Code
<?php session_start(); session_regenerate_id(true); //Endless Possibilities
and then include the core.php inside all of your pages. Most likely, if you know a lot of php, you do not need this but for newcomers this makes things MUCH easier.
Hi, where is dbinit.php and session.php ? I dont understand the purpose of this code...
(Mar 29, 2018 10:34 PM)maype Wrote: Hi, where is dbinit.php and session.php ? I dont understand the purpose of this code...
Read the post. It says it.
Not the best way to do this but it’ll work.z
DO NOT DEAL WITH THIS MEMBER
(Mar 29, 2018 10:38 PM)Charger Wrote: Read the post. It says it.
Not the best way to do this but it’ll work.z My posts here are dedicated to beginners.
Wtf is this? How can you even call it structure? It's just two damn files without anything interesting in it. Oo
I do not feel like this will help people. Beginners more than likely are not going to have the files you have already included. You haven't even explained what this even does and why it would be useful.
DO NOT DEAL WITH THIS MEMBER
(Apr 1, 2018 12:52 PM)Anxuein Wrote: I do not feel like this will help people. Beginners more than likely are not going to have the files you have already included. You haven't even explained what this even does and why it would be useful.
Most beginners are opening a new database connection on every page and adding session start on each page.
Apr 1, 2018 01:54 PM
(This post was last modified: Apr 1, 2018 01:54 PM by Nachfolger.)
(Apr 1, 2018 01:28 PM)yrnGarry Wrote: Most beginners are opening a new database connection on every page and adding session start on each page. You seem like a nice guy so I'm not going to be mean.
But he's right. I never messed with databases until later on, and if I did, I still wouldn't understand the purpose of this code. One of the first posts in this thread shows that a beginner has no idea what any of this means. Perhaps you should elaborate more on what this and the files are.
Je t'aime
(Apr 22, 2022 04:39 PM)-Scrub Wrote: Jokes on you, I'm not smart enough to know what he's talking about.
DO NOT DEAL WITH THIS MEMBER
(Apr 1, 2018 01:54 PM)Nachfolger Wrote: You seem like a nice guy so I'm not going to be mean.
But he's right. I never messed with databases until later on, and if I did, I still wouldn't understand the purpose of this code. One of the first posts in this thread shows that a beginner has no idea what any of this means. Perhaps you should elaborate more on what this and the files are.
Alright
if your code is for beginners you should probably document what each line is doing so a beginner would understand this instead of just copying snippets lol
(Apr 1, 2018 04:19 PM)Jоey Wrote: if your code is for beginners you should probably document what each line is doing so a beginner would understand this instead of just copying snippets lol This.
I've seen a post of yours saying that your are planning on making a "Security Tutorial"
I think you should make it now. We'll see how "advanced" you are with PHP actually.
“Whatever Your Mind Can Conceive and Believe, It Can Achieve.” – Napoleon Hill
(Mar 28, 2018 01:59 PM)yrnGarry Wrote: Make a file, called core.php
and in this write this code.
PHP Code
<?php require_once('dbinit.php'); require_once('session.php');
and then in your database file, include your database connection.
For the session.php file, use this code.
PHP Code
<?php session_start(); session_regenerate_id(true); //Endless Possibilities
and then include the core.php inside all of your pages. Most likely, if you know a lot of php, you do not need this but for newcomers this makes things MUCH easier. Or just make a file called config.php with session and db and include it in your header ?
|