Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6919003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:56:00+00:00 2026-05-27T09:56:00+00:00

I have an image submission form that just uses a simple action= to get

  • 0

I have an image submission form that just uses a simple action=”” to get to a PHP page that adds the submission details to the DB and creates a unique page for the submission. That works fine. However, I want it to redirect to their submission page (created with fwrite()) How would I do this? Code below.

<?php
// For use in creating individual page
$tpl_file = "submission.php";
$tpl_path = "templates/";
$submissions_path = "submissions/";



// For use in querying submitter name

$username = $_GET['username'];
session_start();
$_SESSION['username'] = $username; 

//Database Information

   $dbhost = ""; 
   $dbname = ""; 
   $dbuser = ""; 
   $dbpass = ""; 

//Connect to database

mysql_connect ($dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());


$name = $_GET['right_form_title'];
$filename = $_GET['right_form_url'];   
$submitter = $username;
$type = exif_imagetype($_GET['right_form_url']);

list($width, $height) = getimagesize($filename);

$query = "INSERT INTO images (name, filename, submitter, width, height, type)
VALUES('$name', '$filename', '$submitter', '$width', '$height', $type)";
mysql_query($query) or die(mysql_error());
mysql_close();

$php_file_name = $name.".php";
$path_for_link = $submissions_path.$php_file_name;


$tpl = file_get_contents($tpl_path.$tpl_file);
$tpl_and_values = preg_replace("(%([a-z_][a-z0-9_]*)%)ie",'$$1',$tpl);

$fh = fopen($submissions_path.$php_file_name, "w");
fwrite($fh, $tpl_and_values);
fclose($fh); 

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:56:01+00:00Added an answer on May 27, 2026 at 9:56 am

    Adding this after you close the file would work just fine.

    header('location: '.$submissions_path.$php_file_name);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML/PHP form that needs to get converted to a PDF or
I have an image that I get and attempt to load into a graphics
I have this form that pops up in a modal window like so: <?php
I have a form that has Submit button in form of an Image. When
Here is the site. I have the submit page, and a form action to
I have that code: jQuery(document).ready(function () { // binds form submission and fields to
I have image data and i want to get a sub image of that
I currently have an enquiry submission form that can only be completed by registered
I have a php script which uses the following line to submit a form
I have image tag on my page . I need that tag shows different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.