Jump to content

How To Print Images with php print function


Recommended Posts

Please help me out. I av a form that collect picture from an  upload field in a client form and they want the picture to be printed out in the user page. this work perfectly well on localhost and it looks like the below

Ilamini Ayebatonye Thanks A lot 
          42-16583643.jpg    

NAME:     Ilamini Ayebatonye

EMAIL ADDRESS:     dagogodboss@yahoo.com

HOME ADDRESS:     Behind Maccoba WareHouse

PHONE NUMBER:     08132841856

QUALIFICATION:     I.C.T Certificate

SECTOR:     CCNA

INTEREST:     please put in your interest

 

Please Print this slip, attached your C.V and photocopies of your credentials and come with it to the day of the seminar.

but the problem with is that we i uploaded the site and i try registring the picture wont show again,

wot i see is the below

 

 

ECO9JA-CREATING JOBS IN ICT
          Backgrounds_15670_zps11bc080d.png    

NAME:     Ilamini Ayebatonye

EMAIL ADDRESS:     dagogodboss@yahoo.com

HOME ADDRESS:     Behind Maccoba WareHouse

PHONE NUMBER:     08132841856

QUALIFICATION:     I.C.T Certificate

SECTOR:     CCNA

INTEREST:     please put in your interest

 

Please Print this slip, attached your C.V and photocopies of your credentials and come with it to the day of the seminar.

THANKS FOR REGISTERING

 

the script is below for the image variable the form upload and the print fxn are as follows:

 

VARIABLE

<?php
$file= "file.csv";
$name = $_POST['name'];
$email = $_POST['email'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$qualification = $_POST['qualification'];
$sector = $_POST['sector'];
$interest = $_POST['interest'];
$image= $_POST['image'];
<input type="hidden" name="MAX_FILE_SIZE" value="500">
<P>
<br>
    <input type="file" name="image" value="upload" >

PRINT FXN CODE ON USERPAGE

<?php print"<img src=\"$image\" width=\"100px\" height=\"100px\"\/>";?>

pls help me i need the urgently u r my main hope google cant help me to rubbish

 

Link to comment
Share on other sites

Well first off you haven't shown us enough code to really understand how your system is working.  Second, you need to use the $_FILES array to deal with file uploads, $_POST doesn't hold that info in any way.  Is the print for the image on the same page as the processing for the form? 

Link to comment
Share on other sites

Well first off you haven't shown us enough code to really understand how your system is working.  Second, you need to use the $_FILES array to deal with file uploads, $_POST doesn't hold that info in any way.  Is the print for the image on the same page as the processing for the form? 

the print is not on the processing page i av three pages

form.html,

userpage.php,

register.php.

Processing page is register.php

print function is on userpage.php

 

 

 

all the for userpage.php

<?php

    require_once ("register.php");

?>
<html>
<head>
<title>
<?php print("$name page");?>
</title>
<style type="text/css">
.style1 {
	margin-left: 560px;
}
.style2 {
	margin-left: 40px;
}
.style3 {
	margin-left: 280px;
}
.style4 {
	margin-left: 388px;
	margin-top: 49px;
}
</style>
</head>
<body style="background-image:url(Quarter_Past_Midnight_Session1_by_Jesar.jpg);padding:10px;">
<div id="content"  style="width:77%; height:80%; background-color: rgb(232, 232, 232);left:87px; position: relative; top: 0px;">
<div align="center" style="display:block; background: rgb(162, 21, 204);text-transform: capitalize;  ">
<h1><?php print("$name");?> Thanks A lot </h1> </div>
<div id="print" style="left:50px">
          <?php print"<img src=\"$image\" width=\"100px\" height=\"100px\"\/>";?>
	   

<p class="style2">NAME:     <?php print"$name";?><P class="style2">
EMAIL ADDRESS:     <?php print"$email";?><p class="style2">
HOME ADDRESS:     <?php print"$address";?><P class="style2">
PHONE NUMBER:     <?php print"$phone";?><P class="style2">
QUALIFICATION:     <?php print"$qualification";?><P class="style2">
SECTOR:     <?php print"$sector";?><P class="style2">
INTEREST:     <?php print"$interest";?><P class="style1">

</div>

<p class="style2"> Please Print this slip, attached your C.V and photocopies of your credentials and come with it to the day of the seminar.



<div id="printOption">
<a href="javascript:window.print();" onclick="document.getElementById('printOption').style.visibility = 'hidden'; document.print(); return true;">Print</a>
</div>



	





















</div>
</body>
</html>

register.php that process the data

<?php
$file= "file.csv";
$name = $_POST['name'];
$email = $_POST['email'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$qualification = $_POST['qualification'];
$sector = $_POST['sector'];
$interest = $_POST['interest'];
$image= $_POST['image'];
$all=$image .",". $name .",". $email .",". $address .",". $phone .",". $qualification .",". $sector .",". $interest;
$pfw_header = "From: $name\n";
$pfw_subject = "ECO9JASUMIT REGISTRATION";
$pfw_email_to = "dagogodboss@gmail.com";
$pfw_message = "Visitor's IP: $pfw_ip\n"
. "name: $name\n"
. "email: $email\n"
. "address:$address\n"
. "phone: $phone\n"
. "qualification: $qualification\n"
. "sector: $sector\n"
. "interest:$interest\n"
. "image: $image\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
file_put_contents($file, $all . PHP_EOL, FILE_APPEND);
include("userpage.php");
?>

form.html

<html><head>
<title>eco9ja sumit
</title>
</head>
<body>
<form id='register' action='register.php' method='post'
    accept-charset='UTF-8'>
<fieldset >
<legend>Register</legend>
<input type='hidden' name='submitted' id='submitted' value='1'>
<label for='name' >Your Full Name*: </label><P>
<input type='text' name='name' id='name' maxlength="150" placeholder="surname firstName" ><p>
<label for='email' >Email Address*:</label><P>
<input type='text' name='email' id='email' maxlength="50" placeholder="info@domain.com">
 <p>
<label for='username' >Address*:</label><P>
<input type='text' name='address' id='username' maxlength="50"placeholder="Home Address" >
 <p>
<label for='Phone Number' >Phone number*:</label><P>
<input type='number' name='phone' id='phone' maxlength="11" placeholder="080number" ><P>
<label for="Qualification">Qualification*:</label><P>
<select name="qualification">
<option value="Bachelor Degree">Bachelor Degree</option>
<option value="Master Degree">Master Degree</option>
<option value="Under Graduate">Under Graduate</option>
<option value="SSCE">SSCE</option>
<option value="I.C.T Certificate">I.C.T Certificate</option>
</select><P>
Sector*:<P>
<input type="text" name="sector" maxlength="150" placeholder="law or medicine">
<P>
Interest*:<P>
<textarea rows="6" cols="20"  name="interest">please put in your interest</textarea>

<input type="hidden" name="MAX_FILE_SIZE" value="500">
<P>
<br>
    <input type="file" name="image" value="upload" >
 <P> </P>
<P>
<input type='submit' name='Submit' value='Submit' ></P>
 </fieldset>
</form>
</body>
</html>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.