[], "reviews" => [ ["name" => "John D.", "role" => "CEO, Tech USA", "text" => "Hammad is a beast! He fixed my WooCommerce site in hours.", "rating" => 5], ["name" => "Sarah K.", "role" => "Marketing Director", "text" => "The affiliate system works flawlessly. Highly recommend!", "rating" => 5] ] ]; file_put_contents($data_file, json_encode($initial_data)); } $current_data = json_decode(file_get_contents($data_file), true); // --- HANDLE SUBMISSIONS --- if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST['type']) && $_POST['type'] == 'review') { $new_review = [ "name" => htmlspecialchars($_POST['name']), "role" => "Verified Client", "text" => htmlspecialchars($_POST['text']), "rating" => (int)$_POST['rating'] ]; array_unshift($current_data['reviews'], $new_review); $_SESSION['flash_msg'] = "Review posted successfully!"; } elseif (isset($_POST['type']) && $_POST['type'] == 'project') { $new_project = [ "title" => htmlspecialchars($_POST['title']), "desc" => htmlspecialchars($_POST['desc']), "link" => htmlspecialchars($_POST['link']), "tag" => "Client Project" ]; array_unshift($current_data['projects'], $new_project); $_SESSION['flash_msg'] = "Project added to portfolio!"; } file_put_contents($data_file, json_encode($current_data)); // REDIRECT TO CLEAN URL (This removes the ?success=1 problem) header("Location: " . strtok($_SERVER["REQUEST_URI"], '?')); exit(); } ?> Hammad Sandhu | Portfolio

Verified Development

I build stores that sell. Check my work or add your own project below.

Primary Project

AB Dallas Store

Custom WooCommerce & PHP Development.

Visit Site
Primary Project

ApnaMart4U

High-End Shopify Store Integration.

Visit Site

Latest Client Works

No client projects submitted yet. Be the first!

What Clients Say

'; ?>

""

Submit Your Project

Write a Review