From 4437b14c84f169e54cef799f46240f05d35ed160 Mon Sep 17 00:00:00 2001 From: CBlay Date: Sat, 8 Jul 2017 00:20:58 +0100 Subject: [PATCH] Add files via upload source code files for theprogrammershub.net --- access.profile.php | 120 ++++++++++++++++ account.php | 147 +++++++++++++++++++ all.users.php | 45 ++++++ code.conduct.php | 29 ++++ comment.find.php | 30 ++++ comment.php | 145 +++++++++++++++++++ community.php | 48 +++++++ contact.php | 35 +++++ contact.send.php | 20 +++ contribute.php | 28 ++++ donate.php | 38 +++++ downloadables.php | 52 +++++++ downloadables.post.php | 107 ++++++++++++++ errors.php | 36 +++++ footer.php | 93 ++++++++++++ frontend.read.php | 19 +++ header.php | 251 +++++++++++++++++++++++++++++++++ headerlogin.php | 170 ++++++++++++++++++++++ hire.form.php | 68 +++++++++ index.php | 96 +++++++++++++ loggedin.footer.php | 98 +++++++++++++ login.php | 67 +++++++++ logout.php | 5 + mobile.php | 141 ++++++++++++++++++ password.send.php | 29 ++++ password.support.php | 26 ++++ policies.php | 28 ++++ privacy.statement.php | 29 ++++ profile.find.php | 171 ++++++++++++++++++++++ read.php | 123 ++++++++++++++++ register.php | 79 +++++++++++ reset.password.php | 55 ++++++++ sitemap.xml | 153 ++++++++++++++++++++ source.code.profile.access.php | 96 +++++++++++++ source.code.profile.php | 96 +++++++++++++ system.php | 141 ++++++++++++++++++ terms.php | 23 +++ test.html.php | 45 ++++++ test.js.php | 44 ++++++ test.php | 6 + test.php.php | 44 ++++++ updateprofile.php | 149 +++++++++++++++++++ upload.profile.pic.php | 49 +++++++ web.php | 144 +++++++++++++++++++ work.php | 131 +++++++++++++++++ 45 files changed, 3549 insertions(+) create mode 100644 access.profile.php create mode 100644 account.php create mode 100644 all.users.php create mode 100644 code.conduct.php create mode 100644 comment.find.php create mode 100644 comment.php create mode 100644 community.php create mode 100644 contact.php create mode 100644 contact.send.php create mode 100644 contribute.php create mode 100644 donate.php create mode 100644 downloadables.php create mode 100644 downloadables.post.php create mode 100644 errors.php create mode 100644 footer.php create mode 100644 frontend.read.php create mode 100644 header.php create mode 100644 headerlogin.php create mode 100644 hire.form.php create mode 100644 index.php create mode 100644 loggedin.footer.php create mode 100644 login.php create mode 100644 logout.php create mode 100644 mobile.php create mode 100644 password.send.php create mode 100644 password.support.php create mode 100644 policies.php create mode 100644 privacy.statement.php create mode 100644 profile.find.php create mode 100644 read.php create mode 100644 register.php create mode 100644 reset.password.php create mode 100644 sitemap.xml create mode 100644 source.code.profile.access.php create mode 100644 source.code.profile.php create mode 100644 system.php create mode 100644 terms.php create mode 100644 test.html.php create mode 100644 test.js.php create mode 100644 test.php create mode 100644 test.php.php create mode 100644 updateprofile.php create mode 100644 upload.profile.pic.php create mode 100644 web.php create mode 100644 work.php diff --git a/access.profile.php b/access.profile.php new file mode 100644 index 0000000..3b1eadb --- /dev/null +++ b/access.profile.php @@ -0,0 +1,120 @@ + + + View Profile | The Hub + + +
+
+ +
+ + +
+ '; + } + } + ?> + +
+
+
+ + + +
+ +

'.$row["first_name"].' '.$row["last_name"].'

+
'.$row["PhoneNumber"].'
+ +

My expertise lie in the following fields: '.$row["Abilities"].'

'; + } + ?> + +
Available for employment
+ + +
+ +
+
+
+

View source codes contributions by user + +


+

+ + Contributions made by + +

'.$row["first_name"].' '.$row["last_name"].'

'; + } ?> +


+ +
+ Contact Person '.$row['first_name'].' +

+
'.$row['news'].'
+
+ '; + } +} +} + ?> +
+ + diff --git a/account.php b/account.php new file mode 100644 index 0000000..ba1381b --- /dev/null +++ b/account.php @@ -0,0 +1,147 @@ + + Profile | The Hub + + + +
Unauthorised entry.
'; + die(); +} + ?> + +
+
+ +
+ + +
+ '; + } + } + ?> + +
+
+ + upload Profile Photo +
+ + + +
+ +

'.$row["first_name"].' '.$row["last_name"].'

+
'.$row["PhoneNumber"].'
+

My expertise lie in the following fields: '.$row["Abilities"].'

'; + } + ?> + +
Available for employment
+
+ +
+ +
+ + +
+ +
+ +
+ +
+
+
+
+

+
+

View your source codes contributions + + +


+

+ + See your posts here. +


+ +
+ Contact Person '.$row['first_name'].' +

+
'.$row['news'].'
+
+ '; + } +} +} + ?> +
+ + + + diff --git a/all.users.php b/all.users.php new file mode 100644 index 0000000..a2c650c --- /dev/null +++ b/all.users.php @@ -0,0 +1,45 @@ +Users | The Hub + +
+ +
+ +
+

'.$row["first_name"].' '.$row["last_name"].'

+ +

'.$row['first_name'].'\'s expertise lie in the following fields: '.$row["Abilities"].'

+ +
+ '.$row["PhoneNumber"].' +

View Profile

+
+ +
+ +

+ + + '; + + } + ?> + + diff --git a/code.conduct.php b/code.conduct.php new file mode 100644 index 0000000..a71eec0 --- /dev/null +++ b/code.conduct.php @@ -0,0 +1,29 @@ + + Code of Conduct | The Hub + +
+
+ +
+

Code of Conduct

+

Feel free to use available source code in your projects anytime and anywhere you want, but be sure + to acknowledge the author of the source code you are using. Acknowledge The Programmers Hub community + in any project you complete using tools and materials from this platform. Do not try to tamper with the integrity of this website. + If you find a flaw in our programs, be sure to report to us immediately so we can fix it. Do not try to dupe or scam anyone using this platform. + Most importantly, above all else, have fun using the resources of this community.

+
+
+
+ + diff --git a/comment.find.php b/comment.find.php new file mode 100644 index 0000000..610beb6 --- /dev/null +++ b/comment.find.php @@ -0,0 +1,30 @@ + +Sorry, you cannot comment at the moment. We will work on fixing the problem as soon as possible. Thank you. + '; + die(); } + }else { + echo "no"; +} + ?> diff --git a/comment.php b/comment.php new file mode 100644 index 0000000..e708420 --- /dev/null +++ b/comment.php @@ -0,0 +1,145 @@ + +
+
+
+
+ + +
+ Contact Person +
+
+ + +
+ '.$row['first_name'].'
'.$row['post_time'].'
+
+ + + + + +
+
+

+
+
+ +'; +} +} +if (!loggedin()) { + echo '
+ + You need to log in to comment +
'; +}else { +echo ' +
+
+
+
+ + +
+ +
+
+

'; +} +$sql= "SELECT * FROM read_comments WHERE target ='".$comment."'"; +$result = mysqli_query($link, $sql); +while (@$row = mysqli_fetch_array($result)) { + $img = $row['profile_pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { +echo '
+
+
+
+
+
+ + +
+ Contact Person +
+
+ + +
+ '.$row['name'].'
'.$row['post_time'].'
+
+ + +
'.$row['comment'].'
+ +
+
+
+

+ +
+
+'; +} +} + + +if (isset($_POST['comment-text'])) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['comment-text'])); + + $session = $_SESSION['email']; + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $pic = $row['profile_pic']; + + date_default_timezone_set("GMT"); + $zone = date("l y/m/d - h:i a"); + + $query = "INSERT INTO read_comments(id, target, user_session, comment, profile_pic, name, post_time) VALUES ('', '".$comment."', '".$session."', '".$text."', '".$pic."', '".$name."', '$zone')"; + if ($query_run = mysqli_query($link, $query)) { + header('Location: comment.php'); + }else { + echo "Post Fail. Error occured"; + } +} +} +} +if (!loggedin()) { +include 'footer.php'; +}else { + include 'loggedin.footer.php'; +} + ?> diff --git a/community.php b/community.php new file mode 100644 index 0000000..8a35de6 --- /dev/null +++ b/community.php @@ -0,0 +1,48 @@ +Community | The Hub + +
+
+ website logo +
+

Become a member!

+
+
+

+
+
+
+

Engage with our social media platforms.

+

Engage with us on facebook, and follow us on twitter and also on instagram for the latest news concerning our community.

+
+
+
+
+

Interract with the community.

+

Visit our chat room and find out more about the community. Learn how to contribute to our open source projects and find developers available for employment. Support us by donating to us today!

+
+
+
+
+
+

Join our tutorial sessions and learn to code now.

+

Learn PHP programming today with our learning environment, and build your very own dynamic website. Also try our code editors and test your code in PHP or in HTML5 now.

+
+
+
+
+ + diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..f13e5a7 --- /dev/null +++ b/contact.php @@ -0,0 +1,35 @@ + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +

Email: cassidyblay@gmail.com
+ Phone: +233242877574
+ Location: Accra, Ghana

+
+ diff --git a/contact.send.php b/contact.send.php new file mode 100644 index 0000000..0c6d3ae --- /dev/null +++ b/contact.send.php @@ -0,0 +1,20 @@ +'success', + 'message'=>'Thank you for contacting us. We will get back to you as early as possible ' + ); + + $name = @trim(stripslashes($_POST['name'])); + $email = @trim(stripslashes($_POST['email'])); + $subject = @trim(stripslashes($_POST['subject'])); + $message = @trim(stripslashes($_POST['message'])); + + $email_from = $email; + $email_to = 'cassidyblay@gmail.com'; + + $body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message; + + $success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>'); + + echo json_encode($status); + die; ?> diff --git a/contribute.php b/contribute.php new file mode 100644 index 0000000..f4e3c27 --- /dev/null +++ b/contribute.php @@ -0,0 +1,28 @@ + + How To Contribute | The Hub + +
+
+ +
+

Contribute

+

Contribute to our platform by working with several developers on our Github Repository. + Build templates of applications and make source codes available to other members of the group. + If you find a flaw in our programming or security, kindly use our contact form to address the issue. +

+
+
+
+ + diff --git a/donate.php b/donate.php new file mode 100644 index 0000000..00062a8 --- /dev/null +++ b/donate.php @@ -0,0 +1,38 @@ +Support the programmers hub by donating today + +
+
+ website logo +
+

Support Us.

+

The Programmer's Hub is an open source programming community focused on encouraging more people to program and also to improve + the standard of programmers and the quality of code.

+

As a programming community, we do outreach programs mainly with orphanages where we teach code and also donate foodstuff and clothing.

+

You can join our community and engage with programmers of all levels and ages, and also participate in our programming + tutorials, ask programming questions and get answers, and also join hundreds of sub communitites.

+

We've come far in these few months but we still have a long way to go.

+

Support us by helping us pay for food and transportation during our outreach programs,and also help us pay for our + servers and domain. Donate to us as regularly as you can afford :

+ + + + +

Thanks for supporting Us!

+
+
+
+ diff --git a/downloadables.php b/downloadables.php new file mode 100644 index 0000000..32c60ab --- /dev/null +++ b/downloadables.php @@ -0,0 +1,52 @@ + + Store Downloadables| The Hub + + +
+
+ +
+

Files available for download

+ +

+
+
+ + + +Browse through available downloadable files below ! + "; + $sql= "SELECT * FROM downloadables ORDER BY id DESC"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$row['file_name'].'

+
+
+
+
'; + } + } + if (!loggedin()) { + include 'footer.php'; + }else { + include 'loggedin.footer.php'; + } ?> diff --git a/downloadables.post.php b/downloadables.post.php new file mode 100644 index 0000000..26ee5b4 --- /dev/null +++ b/downloadables.post.php @@ -0,0 +1,107 @@ + Upload file | The Hub + + + Log into your account to contribute. + "; + die(); +}else { +include ('headerlogin.php'); +//Uploading files from webpage to directory + $target_dir = "downloadables/"; + @$target_file = $target_dir.basename ($_FILES ["fileToUpload"]["name"]); + $upLoadOk = 1; + $FileType = pathinfo($target_file, PATHINFO_EXTENSION); + if (isset($_POST['submit'])) { + //validating upload description + $source_info = htmlspecialchars(mysqli_real_escape_string($link, $_POST['submit'])); + + if ($_FILES["fileToUpload"] ["size"] > 50000000) { + //restricting upload file size to 50mb + echo "
+ + Sorry,Your file size is too large. Try with a file at least 50mb. +

"; + $uploadOK = 0; + } + if ($FileType == "txt" && $FileType == "htm" && $FileType == "html" && $FileType == "xml" && $FileType == "php" && $FileType == "js" ) { + echo "
+ + Sorry, .txt, .htm(l), .xml, .js, .php files are NOT allowed. Try again. +
"; + $uploadOK = 0; + } + if (@$uploadOK === 0) { + //returning to last location upon upload fail + $lastloc = $_SERVER['HTTP_REFERER']; + echo "
+ + Failed to upload ".basename($_FILES["fileToUpload"]["name"]). "! Try again. +

Click here to return "; + die(); + }else { + if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"], $target_file)) { + $basename = basename($_FILES["fileToUpload"]["name"]); + + //moving uploaded files to directory + if (isset($_POST['text'])&&!empty('text')) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['text'])); + $session = $session = $_SESSION['email']; + + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $pic = $row['profile_pic']; + + $query = "INSERT INTO downloadables(id, session, text1, pic, name, file_name) VALUES ('', '".$session."', '".$text."', '".$pic."', '".$name."', '".$basename."')"; + if ($query_run = mysqli_query($link, $query)) { + echo "

+ + The file ".basename($_FILES["fileToUpload"]["name"]). " has been uploaded. Successfully! +

Click here to return "; + die(); + }else { + echo "Sorry. An error occurred. We will work on fixing it as soon as possible. Thank you."; + } +} +} + } + }else { + echo "There was an error uploading your file"; + } + } + } + echo '

+
+ +
+

Post files for memebers to download here

+
+
+ +
+
+ Choose file + +
+

+
+
+
+
'; +include 'loggedin.footer.php'; +} + ?> diff --git a/errors.php b/errors.php new file mode 100644 index 0000000..55de42c --- /dev/null +++ b/errors.php @@ -0,0 +1,36 @@ + +Error page | The Hub + +
+
+ website logo +
+

OOOPS !

+

Ask programming questions and get all the answers you need. + Contribute to our open source community and find developers for your project. + Sell or buy templates and applications made by members of our community. + Have access to a wide range of source codes to make your projects easier. + Join our tutorial groups and learn something new about a particular programming field. + Pair up with other coders, and receive all the latest from the world of programming

+
+ +
+ +
+
+ + diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..4a2fbc1 --- /dev/null +++ b/footer.php @@ -0,0 +1,93 @@ + + diff --git a/frontend.read.php b/frontend.read.php new file mode 100644 index 0000000..8ed61ac --- /dev/null +++ b/frontend.read.php @@ -0,0 +1,19 @@ + +
+
+ +
+

Contribute to our open source community by posting relevant and appropriate content here.

+
+
+
+

+
+
+
+
diff --git a/header.php b/header.php new file mode 100644 index 0000000..6fde23e --- /dev/null +++ b/header.php @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + +
diff --git a/headerlogin.php b/headerlogin.php new file mode 100644 index 0000000..7314fb0 --- /dev/null +++ b/headerlogin.php @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + +
diff --git a/hire.form.php b/hire.form.php new file mode 100644 index 0000000..286fabb --- /dev/null +++ b/hire.form.php @@ -0,0 +1,68 @@ + + +Ad added Successfully! +

Click here to return "; +die(); + } + } + ?> + + Job Ad | The Hub +

+
+
+
+
+
+

Your details for job eligibility

+
+
+
+
+ +
+
+
+
+
+
+ +Add your skill set here. Separate with commas +
+
+ +
+Add the location within which you want the job to be +
+ +
+
+ +
+
+
+
+
+
+
+
+
diff --git a/index.php b/index.php new file mode 100644 index 0000000..b7ab397 --- /dev/null +++ b/index.php @@ -0,0 +1,96 @@ + + + The Programmer's Hub - An open source community for programmers and computer enthusiasts + +
+
+
+ website logo +
+

The hub is a playground for programmers across platform.

+

Learn to code for free and interact with a community of programmers of different levels and skillset.

+
+ +
+

+
+
+
+
+
+

Find source codes

+

Get access to source code files for your projects for free

+ +
+
+
+
+
+

Cliff

+

Remotely work efficiently and securely with your team

+ +
+
+
+
+
+

Join our forum

+

See updates and community discussions here

+ +
+
+
+
+
+
+
+
+ +
+
+

Our Mission

+

Our mission is to provide programmers, and the programming community as a whole, reliable and quality source codes and tools to help make more dependable finished products for this rapidly advancing technological world.

+
+
+
+ +
+
+

Community

+

Meet programmers from all over, all ages, and all levels. Interact and work together on projects. Find answers to all your programming related questions, and contribute to our open source community. Join any one of our forums now

+
+
+
+ +
+
+

Learn

+

Join our tutorial sessions and learn how to program and develop swift and efficient programs. Use our specially designed carriculum that employs the use of several mediums of teaching to help you learn programming with ease and in style.

+
+
+ +
+
+

Simplicity

+

Our platform is built to allow you easy access to all our resources. Find and use tools from our platform to make development easy. Get access to job listings, source code files, code editors, forums, and use for your developments. +

+
+
+
+
+
+ + + diff --git a/loggedin.footer.php b/loggedin.footer.php new file mode 100644 index 0000000..2e4bf3f --- /dev/null +++ b/loggedin.footer.php @@ -0,0 +1,98 @@ + diff --git a/login.php b/login.php new file mode 100644 index 0000000..a01e76f --- /dev/null +++ b/login.php @@ -0,0 +1,67 @@ + + Incorrect Email address or Password combination + '; + $sign_in = 0; + } +} +}else { + echo '
You are already logged in.
'; + die(); +} + ?> + Login | The Hub +
+
+

Login to continue using this platform

+
+
+
+
+ + +
+
+ + +
+
+

Not a member? Sign Up

+
+
+ Forgotten password?'; + } + ?> +
+
+ +
+
+
+ diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..4b41a27 --- /dev/null +++ b/logout.php @@ -0,0 +1,5 @@ + diff --git a/mobile.php b/mobile.php new file mode 100644 index 0000000..b29b812 --- /dev/null +++ b/mobile.php @@ -0,0 +1,141 @@ + Mobile Source | The Hub + + + Log into your account to contribute to or to view source code files. + "; + die(); +}else { +include ('headerlogin.php'); +//ip address grabbing + @$cli_ip = $_SERVER['HTTP_CLIENT_IP'];//grabbing from client ip + @$for_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];//grabbing from forwarded ip + @$rem_addr = $_SERVER['REMOTE_ADDR'];//grabbing ip from remote address +//Uploading files from webpage to directory + $target_dir = "mobile/"; + @$target_file = $target_dir.basename ($_FILES ["fileToUpload"]["name"]); + $upLoadOk = 1; + $FileType = pathinfo($target_file, PATHINFO_EXTENSION); + if (isset($_POST['submit'])) { + //validating upload description + $source_info = htmlspecialchars(mysqli_real_escape_string($link, $_POST['submit'])); + + if ($_FILES["fileToUpload"] ["size"] > 500000) { + //restricting upload file size to 500kb + echo "
+ + Sorry,Your file size is too large. Try with a file at least 500kb. +

"; + $uploadOK = 0; + } + if ($FileType != "txt") { + echo "
+ + Sorry, Only .txt files allowed. Try again. +
"; + $uploadOK = 0; + } + if (@$uploadOK === 0) { + //returning to last location upon upload fail + $lastloc = $_SERVER['HTTP_REFERER']; + echo "
+ + Failed to upload ".basename($_FILES["fileToUpload"]["name"]). "! Try again. +

Click here to return "; + die(); + }else { + if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"], $target_file)) { + $basename = basename($_FILES["fileToUpload"]["name"]); + + //moving uploaded files to directory + if (isset($_POST['text'])&&!empty('text')) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['text'])); + $session = $session = $_SESSION['email']; + + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + @$row = mysqli_fetch_array($result); + $pic = $row['profile_pic']; + $def = 'thehub.ico.jpg'; + if ($pic == null ) { + $pic = $def; + + $query = "INSERT INTO mobile_source(id, session, text1, pic, name, file_name) VALUES ('', '".$session."', '".$text."', '".$pic."', '".$name."', '".$basename."')"; + if ($query_run = mysqli_query($link, $query)) { + echo "

+ + The file ".basename($_FILES["fileToUpload"]["name"]). " has been uploaded. Successfully! +

Click here to return "; + die(); + } +} +} + } + }else { + echo "There was an error uploading your file"; + } + } + } + echo '

+
+ +
+

Find or post web development source codes here

+
+
+ +
+
+ Choose file + +
+

+
+
+
+
'; + //the following code displays contents of uploaded file in the directory + if ($handle = opendir($target_dir)) { + //opening target directory +echo "
+ +Browse through available source code files below ! +
"; +$sql= "SELECT * FROM mobile_source ORDER BY id DESC"; +$result = mysqli_query($link, $sql); +while (@$row = mysqli_fetch_array($result)) { +$img = $row['pic']; +$dirname = 'profile/'.$img; +$images = glob ($dirname."*"); +if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$row['file_name'].'

+
+
+
+
'; +} +} + include_once ('loggedin.footer.php'); +} +} + ?> diff --git a/password.send.php b/password.send.php new file mode 100644 index 0000000..2c579f6 --- /dev/null +++ b/password.send.php @@ -0,0 +1,29 @@ +'success', + 'message'=>'An email has been sent to you to enable you reset your password. Visit your inbox and follow the link to reset your password.' + ); + + $email = @trim(stripslashes($_POST['email'])); + $subject = 'Reset Email'; + + $ran_number = rand (); + $sql = "CREATE TABLE reset ( `id` INT(11) NOT NULL AUTO_INCREMENT , `email` VARCHAR(40) NOT NULL , `randnum` INT NOT NULL , PRIMARY KEY (`id`))"; + $run = mysqli_query($link, $sql); + $query = "INSERT INTO reset(id, email, randnum) VALUES ('', '".$email."', '".$ran_number."')"; + $query_run = mysqli_query($link, $query); + + $message = 'Your id to reset your password is '.$ran_number.'. Click here to change your password'; + + $email_from = 'The Programmer\'s Hub - Password Support'; + $email_to = $email; + + $body = 'Email: ' . $email_from . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message; + + $success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>'); + + echo json_encode($status); + die; + ?> diff --git a/password.support.php b/password.support.php new file mode 100644 index 0000000..d810b8c --- /dev/null +++ b/password.support.php @@ -0,0 +1,26 @@ + +
Fill this form to get started on resetting your password

+
+
+
+ + + + +
+
+
+ diff --git a/policies.php b/policies.php new file mode 100644 index 0000000..562caf9 --- /dev/null +++ b/policies.php @@ -0,0 +1,28 @@ + + Policies | The Hub + +
+
+ +
+

Policies

+

Develop, learn, share, partner up, and contribute anyhow and anyway you can to this platform. + We have no hand in anything illegal you use this platform to do. + Follow all the rules governing this community and contribute to making a better place on the World Wide Web.

+
+
+
+ + diff --git a/privacy.statement.php b/privacy.statement.php new file mode 100644 index 0000000..284a1b9 --- /dev/null +++ b/privacy.statement.php @@ -0,0 +1,29 @@ + + Privacy Statement | The Hub + +
+
+ +
+

Privacy Statement

+

This is an open source community and as such, we do not have control over + how your privacy is being used by other members of the community. It is therefore advicable to use + all the neccessary precautions in securing your privacy, and also be sure not to divulge too much information + about yourself.

+
+
+
+ + diff --git a/profile.find.php b/profile.find.php new file mode 100644 index 0000000..2b63c33 --- /dev/null +++ b/profile.find.php @@ -0,0 +1,171 @@ +Find Profile - The Hub +0) { + while (@$row = mysqli_fetch_array($result)) { + echo ' +
+
+ +
+ +
+

'.$row["first_name"].' '.$row["last_name"].'

+ +

'.$row['first_name'].'\'s expertise lie in the following fields: '.$row["Abilities"].'

+ +
+ '.$row["PhoneNumber"].' +

View Profile

+
+ +
+ +

+ +
+ '; + } + }else { + //if the name searched for isn't found in the first name column, the search then tries with the second column and then repeats the process + $sql= "SELECT * FROM registration WHERE last_name ='".$user."'"; + $result = mysqli_query($link, $sql); + $count = mysqli_num_rows($result); + //saving first algorithm...just for future refernce + /* if ($count==1) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + header ('Location: access.profile.php'); + } + }*/if ($count>0) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + echo ' +
+
+ +
+ +
+

'.$row["first_name"].' '.$row["last_name"].'

+ +

'.$row['first_name'].'\'s expertise lie in the following fields: '.$row["Abilities"].'

+ +
+ '.$row["PhoneNumber"].' +

View Profile

+
+ +
+ +

+ +
+ '; + } + }else { + //same as above...loop continues till end + $sql= "SELECT * FROM registration WHERE email ='".$user."'"; + $result = mysqli_query($link, $sql); + $count = mysqli_num_rows($result); + /* if ($count==1) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + header ('Location: access.profile.php'); + } + }*/if ($count>0) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + echo ' +
+
+ +
+ +
+

'.$row["first_name"].' '.$row["last_name"].'

+ +

'.$row['first_name'].'\'s expertise lie in the following fields: '.$row["Abilities"].'

+ +
+ '.$row["PhoneNumber"].' +

View Profile

+
+ +
+ +

+ +
+ '; + } + }else { + $sql= "SELECT * FROM registration WHERE PhoneNumber ='".$user."'"; + $result = mysqli_query($link, $sql); + $count = mysqli_num_rows($result); + /*if ($count==1) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + header ('Location: access.profile.php'); + } + }*/if ($count>0) { + while (@$row = mysqli_fetch_array($result)) { + $name = $row['email']; + $_SESSION['profile'] = $name; + echo ' +
+
+ +
+ +
+

'.$row["first_name"].' '.$row["last_name"].'

+ +

'.$row['first_name'].'\'s expertise lie in the following fields: '.$row["Abilities"].'

+ +
+ '.$row["PhoneNumber"].' +

View Profile

+
+ +
+ +

+ +
+ '; + } + }else { + //if all the above commands have run and there's still no record, an error messasge is sent to the user + echo '
Profile does not exist. Please check the profile name and try again. Try the user\'s first name, last name, email, or phone number. Do not search all together
'; + } + } + } + } + }else { + echo '
Error. Please check and try again
'; + } + if (!loggedin()) { + include 'footer.php'; + }else { + include 'loggedin.footer.php'; + } + ?> diff --git a/read.php b/read.php new file mode 100644 index 0000000..16cdf2c --- /dev/null +++ b/read.php @@ -0,0 +1,123 @@ + Read | The Hub + + + + +
+ +
+ '; + //default display when this page is loaded +}else { + echo '
+ + You need to log in to post +
';; +} + $sql= "SELECT * FROM prog_new ORDER BY id DESC"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + echo ' +
+
+
+
+ + +
+ Contact Person +
+
+ + +
+ '.$row['first_name'].'
'.$row['post_time'].'
+
+ + + + + +
+
+
+
+
+ + +'; + } + +if (isset($_POST['text'])) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['text'])); + $session = $_SESSION['email']; + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + @$row = mysqli_fetch_array($result); + $pic = $row['profile_pic']; + $def = 'thehub.ico.jpg'; + if ($pic == null ) { + $pic = $def; + + date_default_timezone_set("GMT"); + $zone = date("l y/m/d - h:i a"); + + $query = "INSERT INTO prog_new(id, news, session, first_name, profile_pic, post_time) VALUES ('', '".$text."', '$session', '$name', '$pic', '$zone')"; + if ($query_run = mysqli_query($link, $query)) { + header('Location: read.php'); + }else { + echo "Post Fail. Error occured"; + } +} +} +} +if (!loggedin()) { +include 'footer.php'; +}else { + include 'loggedin.footer.php'; +} + ?> diff --git a/register.php b/register.php new file mode 100644 index 0000000..1efb0e5 --- /dev/null +++ b/register.php @@ -0,0 +1,79 @@ +0) { + echo '
+ Email already exists. +
'; } + //checking to make sure passwords match + elseif ($password!=$retype_password) { + echo '
+ Passwords do not match. +
'; } +//inserting data into database once all other requirements are satisfied + else { + $query = "INSERT INTO registration(reg_id, email, first_name, last_name, password, retype_password) VALUES ('', '".$email."', '".$first_name."', '".$last_name."', '".$pass_enc."', '".$pass_enc."')"; +if ($query_run = mysqli_query($link, $query)) { + //initialising session + $_SESSION['email'] = $email; + //redirecting page after successful registration + header('Location: read.php'); +} + } + } + }else { + echo '
You are already logged in.
'; + die(); + } + ?> + Register | The Hub +
+
+
+
+
+
+

Sign up to continue using this platform

+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ diff --git a/reset.password.php b/reset.password.php new file mode 100644 index 0000000..1f095b8 --- /dev/null +++ b/reset.password.php @@ -0,0 +1,55 @@ + + here to return'; + die(); + }else { + echo "Sorry, there was an error. Please return and try again."; + } + }else { + echo "Sorry, your unique number does not exist. Please resend the query to generate new number."; + } + }else { + echo "Please fill all forms before submitting"; + } + } + ?> + +
+
+
+
+
+
+
+
+

+
+ + + diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..00380bd --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,153 @@ + + + +http://theprogrammershub.net/ + + +http://theprogrammershub.net/index.php + + +http://theprogrammershub.net/downloadables.php + + +http://theprogrammershub.net/javascript.page.php + + +http://theprogrammershub.net/php.page.php + + +http://theprogrammershub.net/cliff/ + + +http://theprogrammershub.net/web.php + + +http://theprogrammershub.net/mobile.php + + +http://theprogrammershub.net/system.php + + +http://theprogrammershub.net/test.php.php + + +http://theprogrammershub.net/test.js.php + + +http://theprogrammershub.net/test.html.php + + +http://theprogrammershub.net/community.php + + +http://theprogrammershub.net/donate.php + + +http://theprogrammershub.net/work.php + + +http://theprogrammershub.net/login.php + + +http://theprogrammershub.net/register.php + + +http://theprogrammershub.net/fair.intro.php + + +http://theprogrammershub.net/about.php + + +http://theprogrammershub.net/privacy.statement.php + + +http://theprogrammershub.net/terms.php + + +http://theprogrammershub.net/policies.php + + +http://theprogrammershub.net/code.conduct.php + + +http://theprogrammershub.net/websource.php + + +http://theprogrammershub.net/contributers.php + + +http://theprogrammershub.net/contribute.php + + +http://theprogrammershub.net/jobs.php + + + +http://theprogrammershub.net/downloadables.post.php + + + +http://theprogrammershub.net/cliff/index.php + + +http://theprogrammershub.net/cliff/all.teams.php + + + +http://theprogrammershub.net/cliff/create.start.php + + + +http://theprogrammershub.net/cliff/login.php + + + +http://theprogrammershub.net/cliff/management.login.php + + + +http://theprogrammershub.net/cliff/about.php + + +http://theprogrammershub.net/cliff/contact.php + + +http://theprogrammershub.net/cliff/search.team.php + + +http://theprogrammershub.net/cliff/desktop.php + + +http://theprogrammershub.net/read.php + + +http://theprogrammershub.net/donate/ +2017-06-17T12:51:57+00:00 + + +http://theprogrammershub.net/contact.php + + +http://theprogrammershub.net/showcaser.php + + +http://theprogrammershub.net/employer.php + + +http://theprogrammershub.net/regular.php + + +http://theprogrammershub.net/learner.php + + +http://theprogrammershub.net/cliff/public.view.php + + +http://theprogrammershub.net/cliff/community.php + + +http://theprogrammershub.net/comment.php + + diff --git a/source.code.profile.access.php b/source.code.profile.access.php new file mode 100644 index 0000000..a67e237 --- /dev/null +++ b/source.code.profile.access.php @@ -0,0 +1,96 @@ + + +Browse through available source code files below ! + "; + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM web_source WHERE session = '".$_SESSION['profile']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +if ($handle = opendir($target_dir)) { + //opening target directory + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM system_source WHERE session = '".$_SESSION['profile']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +if ($handle = opendir($target_dir)) { + //opening target directory + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM mobile_source WHERE session = '".$_SESSION['profile']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +?> diff --git a/source.code.profile.php b/source.code.profile.php new file mode 100644 index 0000000..d13f9f6 --- /dev/null +++ b/source.code.profile.php @@ -0,0 +1,96 @@ + + +Browse through available source code files below ! + "; + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM web_source WHERE session = '".$_SESSION['email']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +if ($handle = opendir($target_dir)) { + //opening target directory + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM system_source WHERE session = '".$_SESSION['email']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +if ($handle = opendir($target_dir)) { + //opening target directory + while ($files = readdir($handle)) { + if ($files != '.' && $files != '..') { + $sql= "SELECT * FROM mobile_source WHERE session = '".$_SESSION['email']."'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$files.'

+
+
+
+
'; + } + } + } + } +} +?> diff --git a/system.php b/system.php new file mode 100644 index 0000000..fdc68f0 --- /dev/null +++ b/system.php @@ -0,0 +1,141 @@ + System Source | The Hub + + + Log into your account to contribute to or to view source code files. + "; + die(); +}else { +include ('headerlogin.php'); +//ip address grabbing + @$cli_ip = $_SERVER['HTTP_CLIENT_IP'];//grabbing from client ip + @$for_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];//grabbing from forwarded ip + @$rem_addr = $_SERVER['REMOTE_ADDR'];//grabbing ip from remote address +//Uploading files from webpage to directory + $target_dir = "system/"; + @$target_file = $target_dir.basename ($_FILES ["fileToUpload"]["name"]); + $upLoadOk = 1; + $FileType = pathinfo($target_file, PATHINFO_EXTENSION); + if (isset($_POST['submit'])) { + //validating upload description + $source_info = htmlspecialchars(mysqli_real_escape_string($link, $_POST['submit'])); + + if ($_FILES["fileToUpload"] ["size"] > 500000) { + //restricting upload file size to 500kb + echo "
+ + Sorry,Your file size is too large. Try with a file at least 500kb. +

"; + $uploadOK = 0; + } + if ($FileType != "txt") { + echo "
+ + Sorry, Only .txt files allowed. Try again. +
"; + $uploadOK = 0; + } + if (@$uploadOK === 0) { + //returning to last location upon upload fail + $lastloc = $_SERVER['HTTP_REFERER']; + echo "
+ + Failed to upload ".basename($_FILES["fileToUpload"]["name"]). "! Try again. +

Click here to return "; + die(); + }else { + if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"], $target_file)) { + $basename = basename($_FILES["fileToUpload"]["name"]); + + //moving uploaded files to directory + if (isset($_POST['text'])&&!empty('text')) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['text'])); + $session = $session = $_SESSION['email']; + + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + @$row = mysqli_fetch_array($result); + $pic = $row['profile_pic']; + $def = 'thehub.ico.jpg'; + if ($pic == null ) { + $pic = $def; + + $query = "INSERT INTO system_source(id, session, text1, pic, name, file_name) VALUES ('', '".$session."', '".$text."', '".$pic."', '".$name."', '".$basename."')"; + if ($query_run = mysqli_query($link, $query)) { + echo "

+ + The file ".basename($_FILES["fileToUpload"]["name"]). " has been uploaded. Successfully! +

Click here to return "; + die(); + } +} +} + } + }else { + echo "There was an error uploading your file"; + } + } + } + echo '

+
+ +
+

Find or post web development source codes here

+
+
+ +
+
+ Choose file + +
+

+
+
+
+
'; + //the following code displays contents of uploaded file in the directory + if ($handle = opendir($target_dir)) { + //opening target directory +echo "
+ +Browse through available source code files below ! +
"; +$sql= "SELECT * FROM system_source ORDER BY id DESC"; +$result = mysqli_query($link, $sql); +while (@$row = mysqli_fetch_array($result)) { +$img = $row['pic']; +$dirname = 'profile/'.$img; +$images = glob ($dirname."*"); +if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$row['file_name'].'

+
+
+
+
'; +} +} + include_once ('loggedin.footer.php'); +} +} + ?> diff --git a/terms.php b/terms.php new file mode 100644 index 0000000..3b800ec --- /dev/null +++ b/terms.php @@ -0,0 +1,23 @@ + + Terms and Conditions | The Hub + +
+
+ +
+

Terms and Conditions

+

This community is open to computer enthusiasts and programmers of all levels, ages, religious background, race, + and all other identification factors. Once you agree to become a member, do not discriminate or try to look + down upon any member of this community. Contribute what your can to make this platform progressive. Theprogrammershub.net is sorely + for programming, programming sharing, and for all that has to do with computers and technologies. We reserve the right + to revoke the membership of anyone who tries to use this platform for something other than its intended purpose.

+
+
+
+ + diff --git a/test.html.php b/test.html.php new file mode 100644 index 0000000..570858f --- /dev/null +++ b/test.html.php @@ -0,0 +1,45 @@ + + To run your HTML code, you need to login or register . + '; + die(); +} + $handle = fopen('run.html', 'w'); + + if(isset($_POST['code'])) { + $code = $_POST['code']; + + if(fwrite($handle, $code)) { + header('Location: run.html'); + } + + } + ?> + HTML environment | The Hub +
+
+ website logo +
+

Welcome to our HTML environment!

+

Test your HTML code in real time using this HTML environment. Enjoy!

+
+
+
+
+ +
+
+
+
+ diff --git a/test.js.php b/test.js.php new file mode 100644 index 0000000..2c5792b --- /dev/null +++ b/test.js.php @@ -0,0 +1,44 @@ + + To run your Js code, you need to login or register . + '; + die(); +} +$handle = fopen('run.html', 'w'); +if(isset($_POST['code'])) { + $code = array(' ', $_POST['code']); + $code1 = implode(''); + header('Location: run.html'); +} + ?> + Js environment | The Hub +
+
+ website logo +
+

Welcome to our Javascript environment!

+

Test your Js code in real time using this Javascript environment. DO NOT begin your script with tags. Enjoy!

+
+
+
+
+ +
+
+
+
+ diff --git a/test.php b/test.php new file mode 100644 index 0000000..7e343d1 --- /dev/null +++ b/test.php @@ -0,0 +1,6 @@ + +
+ +
diff --git a/test.php.php b/test.php.php new file mode 100644 index 0000000..7cf74d2 --- /dev/null +++ b/test.php.php @@ -0,0 +1,44 @@ + + To run your PHP code, you need to login or register . + '; + die(); +} + $handle = fopen('run.php', 'w'); + if(isset($_POST['code'])) { + $code = array(' ', $_POST['code']); + $code1 = implode(''); + header('Location: run.php'); + } + ?> + PHP environment | The Hub +
+
+ website logo +
+

Welcome to our PHP environment!

+

Test your PHP code in real time using this PHP environment. DO NOT begin your script with the php tags. Enjoy!

+
+
+
+
+ +
+
+
+
+ diff --git a/updateprofile.php b/updateprofile.php new file mode 100644 index 0000000..96c3285 --- /dev/null +++ b/updateprofile.php @@ -0,0 +1,149 @@ + + + +Updated Successfully! + +"; + echo ""; +}else{ + echo "
+ +Some Problem Occure. Please Try Again Later ! + +
"; +} +} else { + +if ($err1 == 1){ +echo "
+ + +First Name Can Not Be Empty!!! + +
"; +} +if ($err2 == 1){ + echo "
+ + +Last Name Can Not Be Empty!!! + +
"; + +} +if ($err3 == 1){ + echo "
+ + +Phone Number Can Not Be Empty!!! + +
"; + +} +if ($err4 == 1){ + echo "
+ + +Abilities Can Not Be Empty!!! + +
"; + +} +} + + + +} + echo '
+
+

Update your Profile -'. $ufnm .'

+
+
+ + + + + +
+ + + + + + + +First Name: +

+Last Name: +

+Phone Number: +

+Abilities (Programming Skills): +

+ + + + +
+ + +
+ + + +
'; + } +}else { + die("Unauthorised entry"); +} +include ('loggedin.footer.php'); + + ?> + + diff --git a/upload.profile.pic.php b/upload.profile.pic.php new file mode 100644 index 0000000..cf7d03e --- /dev/null +++ b/upload.profile.pic.php @@ -0,0 +1,49 @@ + +"; + $upLoadOk = 1; + }else { + echo "File is not an image.
"; + $uploadOK = 0; + } + if ($_FILES["fileToUpload"] ["size"] > 500000) { + echo " Your file size is too large.
"; + $uploadOK = 0; + } +if (@$uploadOK === 0) { + $lastloc = $_SERVER['HTTP_REFERER']; + echo ' Your file was not uploaded. Click here to return'; +}else { + if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"], $target_file)) { + echo " The file ".basename($_FILES["fileToUpload"]["name"]). " has been uploaded.
"; + $basename = basename($_FILES["fileToUpload"]["name"]); + $query = "INSERT INTO profile(id, profile_pic, session) VALUES ('', '".$basename."', '".$_SESSION['email']."')"; + if ($query_run = mysqli_query($link, $query)) { + header('Location: account.php'); + } + + }else { + echo " Sorry, There was an error uploading your file.
"; + } + } +} + + + ?> +
+ + +
diff --git a/web.php b/web.php new file mode 100644 index 0000000..c59645f --- /dev/null +++ b/web.php @@ -0,0 +1,144 @@ + Web Source | The Hub + + + Log into your account to contribute to or to view source code files. + "; + die(); +}else { +include ('headerlogin.php'); +//ip address grabbing + @$cli_ip = $_SERVER['HTTP_CLIENT_IP'];//grabbing from client ip + @$for_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];//grabbing from forwarded ip + @$rem_addr = $_SERVER['REMOTE_ADDR'];//grabbing ip from remote address +//Uploading files from webpage to directory + $target_dir = "web/"; + @$target_file = $target_dir.basename ($_FILES ["fileToUpload"]["name"]); + $upLoadOk = 1; + $FileType = pathinfo($target_file, PATHINFO_EXTENSION); + if (isset($_POST['submit'])) { + //validating upload description + $source_info = htmlspecialchars(mysqli_real_escape_string($link, $_POST['submit'])); + + if ($_FILES["fileToUpload"] ["size"] > 500000) { + //restricting upload file size to 500kb + echo "
+ + Sorry,Your file size is too large. Try with a file at least 500kb. +

"; + $uploadOK = 0; + } + if ($FileType != "txt") { + echo "
+ + Sorry, Only .txt files allowed. Try again. +
"; + $uploadOK = 0; + } + if (@$uploadOK === 0) { + //returning to last location upon upload fail + $lastloc = $_SERVER['HTTP_REFERER']; + echo "
+ + Failed to upload ".basename($_FILES["fileToUpload"]["name"]). "! Try again. +

Click here to return "; + die(); + }else { + if (move_uploaded_file($_FILES ["fileToUpload"]["tmp_name"], $target_file)) { + $basename = basename($_FILES["fileToUpload"]["name"]); + + //moving uploaded files to directory + if (isset($_POST['text'])&&!empty('text')) { + $text = htmlspecialchars(mysqli_real_escape_string($link, $_POST['text'])); + $session = $_SESSION['email']; + + $sql= "SELECT * FROM registration WHERE email = '$session'"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $name = $row['first_name']; + + $sql= "SELECT * FROM profile WHERE session = '$session'"; + $result = mysqli_query($link, $sql); + @$row = mysqli_fetch_array($result); + $pic = $row['profile_pic']; + $def = 'thehub.ico.jpg'; + if ($pic == null ) { + $pic = $def; + + $query = "INSERT INTO web_source(id, session, text1, pic, name, file_name) VALUES ('', '".$session."', '".$text."', '".$pic."', '".$name."', '".$basename."')"; + if ($query_run = mysqli_query($link, $query)) { + echo "

+ + The file ".basename($_FILES["fileToUpload"]["name"]). " has been uploaded. Successfully! +

Click here to return "; + die(); + }else { + echo "Sorry. An error occurred. We will work on fixing it as soon as possible. Thank you."; + } + } +} + } + }else { + echo "There was an error uploading your file"; + } + } + } + echo '

+
+ +
+

Find or post web development source codes here

+
+
+ +
+
+ Choose file + +
+

+
+
+
+
'; + //the following code displays contents of uploaded file in the directory + if ($handle = opendir($target_dir)) { + //opening target directory +echo "
+ +Browse through available source code files below ! +
"; + $sql= "SELECT * FROM web_source ORDER BY id DESC"; + $result = mysqli_query($link, $sql); + while (@$row = mysqli_fetch_array($result)) { + $img = $row['pic']; + $dirname = 'profile/'.$img; + $images = glob ($dirname."*"); + if ($images) { + echo '
+
+
+
+ Contact Person '.$row['name'].' +

+
Description : '.$row['text1'].'

+

View file: '.$row['file_name'].'

+
+
+
+
'; + } + } + include_once ('loggedin.footer.php'); +} +} + ?> diff --git a/work.php b/work.php new file mode 100644 index 0000000..187f126 --- /dev/null +++ b/work.php @@ -0,0 +1,131 @@ + + + + + Find Developers | The Hub + + + +
+
+
+ +
+
+
+
+ + +
+
+
+
+
+ + No results found for "'.$search_skill.'". Please try with another skill +
'; + } + else { + echo '
+ '.$count .' results found for "'.$search_skill.'" +
'; + } + while (@$row = mysqli_fetch_array($query_run)) { + echo ' + + + + + + + + + + + + + +
'.$row['id'].' '.$row['first_name'].' '.$row['last_name'].' '.$row['email'].' '.$row['phone'].' '.$row['location'].' '.$row['skill'].' '.$row['text1'].'
+ + + '; + } + } + ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + ';} + ?> + +
#First NameLast NameEmailPhoneLocationSkillExtras
'.$row['id'].' '.$row['first_name'].' '.$row['last_name'].' '.$row['email'].' '.$row['phone'].' '.$row['location'].' '.$row['skill'].' '.$row['text1'].'
+
+ + + +