Upon applying for a job, I was given a "tester". One of the questions was what does the php function ?header? do. I have not seen this syntax nor has it come up on any google search I've attempted. Could someone here please educate me on this item? Thanks

Recommended Answers

All 4 Replies

I know what header() does, I don't know what ?header? does.

ok, sorry i just thought you went crazy with question marks.

i don't think there is such a function in php. if it existed, php.net would have documentation for it.

hey

header is nothing but a php function its using to redirect from one page to another page

<?php
mysql_connect("localhost","root","rootwdp");
mysql_select_db("associates") or die("unable to select");
if(isset($_POST["update"]))
{
    $empid=$_POST['empid'];
    $username=$_POST['uname'];
    $dofjoin=$_POST['date'];
    $design=$_POST['design'];
    $exp=$_POST['exp'];
    $contact=$_POST['contact'];
    $pname=$_POST['pname'];
    $photo=$_POST['userfile'];
    if($_FILES['userfile']['size'] > 0)
        {

            $file_dir = "photos";
            foreach($_FILES as $file_name => $file_array) 
            $fileName = $_FILES['userfile']['name'];
            $fileSize = $_FILES['userfile']['size'];
            $fileType = $_FILES['userfile']['type'];
            $tmpName  = $_FILES['userfile']['tmp_name'];
            $file_array;
            $fileName = $empid.".jpg";
            if (is_uploaded_file($file_array['tmp_name'])) 
                {
                    $test=move_uploaded_file($file_array['tmp_name'],"$file_dir/$fileName") or die ("Couldn't copy");
                }
        }
        if(@$test)
        {

        $photo=$file_dir."/".$fileName;
        }
//echo "<img src='".$_SESSION['photopath']."'/>";
//echo "<a href='#' onclick='refreshParent()'>close</a>";

$remarks=$_POST['remarks'];
 $query = "UPDATE `jos_employee` SET name='$username', designation='$design', date_of_joining='$dofjoin', experience='$exp', contact='$contact', remarks='$remarks' ";
 if($test)
{
$query.= "photo_url ='$photo'";
}
else
{

}

$query.=" WHERE emp_id=$empid";
$run=mysql_query($query);
//header("Location:index.php?option=com_testingofupdatedelete&page=$currpage");
[COLOR="Green"]header("Location:index.php?option=com_completedetailsofassociate");[/COLOR]

}?>

i think the aboe programme is usefull to you i think

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.