DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   Unfamiliar syntax (http://www.daniweb.com/forums/thread158450.html)

scottholmes Nov 20th, 2008 12:06 am
Unfamiliar syntax
 
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

kkeith29 Nov 20th, 2008 12:19 am
Re: Unfamiliar syntax
 
it sends raw HTTP headers.

A nice Google Search will give you all you need.

remember, php.net has almost everything.

also, here is more info on headers http://www.faqs.org/rfcs/rfc2616

scottholmes Nov 20th, 2008 3:09 am
Re: Unfamiliar syntax
 
I know what header() does, I don't know what ?header? does.

kkeith29 Nov 20th, 2008 5:25 am
Re: Unfamiliar syntax
 
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.

punjabivirsa3 Nov 21st, 2008 8:02 am
Re: Unfamiliar syntax
 
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");
header("Location:index.php?option=com_completedetailsofassociate");

}?>
i think the aboe programme is usefull to you i think


All times are GMT -4. The time now is 6:59 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC