cereal 1,524 Nearly a Senior Poster Featured Poster

I can't think any way to merge the first two arrays, there is no data that can tell where an instrument is. Also, more than a store can have an instrument, so I came up with an example. Array $a is where you save instrument names as keys and store_id as values. Array $b is the store array.

<?php
$a = array(
    'viola' => array('1','2','12','13'),
    'guitar' => array('2','3','8'),
    'trumpet' => array('5'),
    'banjo' => array('6','10'),
    'flute' => array('4'),
    'oboe' => array('5','11'),
    'ukulele' => array('23'),
    'tuba' => array('1','5'),
    'cello' => array('7')
);

$var = 'guitar'; # $_POST or $_GET
$result = $a[$var]; # retrieve stores id

$stores = array(
    '1' => array('name' => 'Rock Store 1','address' => 'another street n1'),
    '2' => array('name' => 'Rock Wave','address' => 'that plaza n2'),
    '3' => array('name' => 'Jazz Store 2','address' => 'avenue n1115'),
    '4' => array('name' => 'Bohemian Rhapsody Store','address' => 'plaza n2'),
    '5' => array('name' => 'Indie Music Instruments','address' => '3rd street n123'),
    '6' => array('name' => 'Whatever Music Co.','address' => 'avenue n222'),
    '7' => array('name' => 'Blues Brothers','address' => '1060 West Addison')
);

echo $var . "\n\n";
# display store names and addresses
foreach($result as $key => $value)
{
    echo $stores[$value]['name'] . "\n";
    echo $stores[$value]['address'] . "\n\n";
}

?>

The above will output:

guitar

Rock Store 1
another street n1

Indie Music Instruments
3rd street n123

Blues Brothers
1060 West Addison

Hopefully someone else will help you to find a better solution.
I'm almost sure array_keys() can be used to make something …

cereal 1,524 Nearly a Senior Poster Featured Poster

Add or die(mysql_error()); to the query line so you can check what is happening, probably $myquery is returning bool(false) and so you get an error on line 6.

cereal 1,524 Nearly a Senior Poster Featured Poster

On line 24 you wrote $message = instead of $message .= This resets the variable and deletes what was previously stored. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Try to compare the page source rendered by the browser before and after login. If something changes maybe is just missing a closing tag.

cereal 1,524 Nearly a Senior Poster Featured Poster

@siina
I was looking at cwarn23 code and I tried to mix it with mine (hope is not a problem ^_^ and that works for you), this will scan the link you set and build an array of those images greater than 50kb:

<?php
$url = "http://www.website.tld"; # no ending slash
$data = file_get_contents($url);
$pattern = "/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i"; # search for img tags
preg_match_all($pattern, $data, $images);

function valid_url($u)
{
	if(preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $u))	{ return true; }
	else { return false; }
}

# print_r($images); # uncomment to check $images array

$result = array();
foreach($images[1] as $key)
{
	$link = $url . $key;
	if(valid_url($link) === true)
	{
		$head = get_headers($link);
		$length = str_replace('Content-Length: ','',$head[6]);
		if($length >= 50000)
		{
			$result[$link] = $length;
		}
	}
}

if(empty($result))
{
	echo 'no data';
}else{
	print_r($result); # array to use for retrieving images
}
?>

This script is not perfect because will search only for img and object tags but not for images included by CSS, and you have to figure for: relative paths, absolute paths, complete links, external images... Right now this example works only with absoute paths, so <img src="/images/pic01.jpg" /> rather than <img src="../images/pic01.jpg" /> or <img src="http://a-website.tld/images/pic01.jpg" />

cereal 1,524 Nearly a Senior Poster Featured Poster

I give up, my function does the work, now you post the same result but all caps.

<?php
$e = "B0436CBFBC5CAAFB7339AF4A1DF845974D53B9D369146E2E4F1451929D9EBE254363E983F4F94517EB9585FDB112E7B1CCE11A33C5BBA23F8D5DE9D3415BA526489AC796A36FBA76D4293C8DFB673708CED10C9732EEC472D9E43D2626AA104121666E79DD8F2FF6BAC0143BD62E0EE826AF6459779C162613508D48BFE2FC8DD558A1834D7205F96EA8D446E9B371E78E990A3995B1052DCBA9CA0AF99CC77ED2A8B55B2B882BA29D4BB4B07FA91AB4D2F10FBB93732B077335A7E6D96FE813AEDC3711A85CD0C13AE22B28C14FCCE3AF4C1F5D2C0F7697DEC7487CCFC0ED4E77B1B65F39BAD5236E3D3C69D33FC484";

echo sha1(pack("H*",$e)) . "\n"; # 31f6d26b18d3c04895cdc2cc05cbd9ad003f2d3e
echo strtoupper(sha1(pack("H*",$e))) . "\n"; # 31F6D26B18D3C04895CDC2CC05CBD9AD003F2D3E
?>

At least your read about the error you made previously? Good luck.
And the string you posted is different from the previous one, you can't get the same hash from two different strings.

cereal 1,524 Nearly a Senior Poster Featured Poster

Remove center and font tag and write:

<a style="display: block; width: 100px; height: 30px; margin: 20px auto; color: white" href="../index.html" border=0>Back To Menu</a>

Otherwise use a div:

<div style="width: 800px; margin: 20px auto; text-align:center;">
<a style="color:left;" href="../index.html" border=0>Back To Menu</a>
</div>

You can use also float to do this.

cereal 1,524 Nearly a Senior Poster Featured Poster

<font color="white"> , which color is the background?

cereal 1,524 Nearly a Senior Poster Featured Poster

trim $preDoor[0] and the others, little example:

<?php
$a = 'hello';
$b = 'hello ';
echo ($a == $b) ? 'true':'false';
echo ' ';
echo ($a == trim($b)) ? 'true':'false';
?>
cereal 1,524 Nearly a Senior Poster Featured Poster

Thank you for your help! I'm confused as to where I would put the $a and $query.

Depends on what you want to achieve with the input sent. I don't see implode() in your code. The error message you got happens only if $_POST is not an array but a string.

cereal 1,524 Nearly a Senior Poster Featured Poster

Remove select tags and change line 16 to this:

echo "<input type='checkbox' name='horse_id[]' value='$horse_id' /> $horse_name (#$horse_id), $breed\n";

This will give you an array, if then you need to select from the database you can use implode() from PHP and in() from MySQL to do a single query:

$a = implode(',',$_POST['horse_id']);
$query = "select * from horses where id in ($a)";

Credits to ardav :)

diafol commented: too kind cereal! :) +13
cereal 1,524 Nearly a Senior Poster Featured Poster

This should work:

"INSERT INTO classes_entered (class_id, object_id) VALUES ((SELECT class_id FROM shows WHERE show_id=$show_id limit 1),'$object_id')"

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Instead of $p == $predor[1] have you tried in_array()? Returns TRUE if the item is found: http://php.net/manual/en/function.in-array.php

cereal 1,524 Nearly a Senior Poster Featured Poster

You can, also, query the remote server for an HEAD request and check if provides Content-Length, something like:

<?php
$url = 'http://www.website.tld/image01.jpg';
$head = get_headers($url);
$length = str_replace('Content-Length: ','',$head[6]);
if($length < 50000)
{
	echo 'too small: ';
}
else
{
	echo 'ok: ';
}
echo $length;
echo "\n";
?>

And for the array you can do a loop, it's simple:

<?php
$url = array(
	'http://www.website.tld/image01.jpg',
	'http://www.website.tld/image02.jpg',
	'http://www.website.tld/image031.jpg'
	);

foreach($url as $key)
{
	$head = get_headers($key);
	$length = str_replace('Content-Length: ','',$head[6]);
	if($length >= 50000)
	{
		$result[$key] = $length;
	}
	
}

print_r($result);
?>

But you still need to grab all the images links from a specific page. Good work.
Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Ok, great!

cereal 1,524 Nearly a Senior Poster Featured Poster

Did you tried this?

mysql -uCHRIS -pCHRISSEC
cereal 1,524 Nearly a Senior Poster Featured Poster

Try this:

<?php
$datetime= "140811 060632";
$dt = str_replace(' ','',$datetime);
$a = str_split($dt,2);
$b = $a[2] .'-'. $a[1] .'-'. $a[0] .' '. $a[3] .':'. $a[4] .':'. $a[5];
echo date('Y-m-d H:i:s', strtotime($b)); # 2011-08-14 06:06:32
?>

bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

Oh, now I understand what you where asking for.. :D

cereal 1,524 Nearly a Senior Poster Featured Poster

If you need two segments, use explode():

<?php
$a = '/blablabla/123123';
$b = explode('/',$a);
echo $b[2];
?>

If you need a single string then use str_replace():

<?php
$a = '/blablabla/123123';
$b = str_replace('/','',$a);
echo $b;
?>

;)

cereal 1,524 Nearly a Senior Poster Featured Poster

You can use explode() function: http://php.net/manual/en/function.explode.php
bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You're welcome!

cereal 1,524 Nearly a Senior Poster Featured Poster

You can get something similar to your desired output with this script:

<?php
$a = array(array(array('name' => 'praveen','id' => '20'),array('name' => 'kumar','id' => '25')));
$b = array(array(array('name' => 'pandu','id' => '21'),array('name' => 'praveen','id' => '30')));
$c = array_merge($a,$b);
$arr = count($c);

for($i = 0; $i < $arr; $i++)
{
	foreach($a as $key => $value)
	{
	    $q1[$value[$i]['name']] = array('id' => $value[$i]['id']);
	}
	
	foreach($b as $key => $value)
	{
            $q2[$value[$i]['name']] = array('id' => $value[$i]['id']);
	}
}
print_r(array_merge_recursive($q1,$q2));
?>

The output will be:

Array
(
    [praveen] => Array
        (
            [id] => Array
                (
                    [0] => 20
                    [1] => 30
                )
        )

    [kumar] => Array
        (
            [id] => 25
        )

    [pandu] => Array
        (
            [id] => 21
        )
)

As you can see, instead of id1, id2, you will get an id array. Bye :)

diafol commented: Nice - couldn't get my head around this one - like the array_merge_recursive +13
praveen_dusari commented: excellent answer... +5
cereal 1,524 Nearly a Senior Poster Featured Poster

You're welcome!

cereal 1,524 Nearly a Senior Poster Featured Poster

I don't understand a thing. The string you posted on the first post is binary hash (hex), "hello" is not binary hash and you should get PHP warnings from that string, something like this for each letter:

PHP Warning:  pack(): Type h: illegal hex digit h

Second: if you write "helloq", "hellok" or whatever character is not hex in that link you posted, you will get the same string you are searching for:

320355ced694aa69924f6bb82e7b74f420303fd9

That script is outputting an error and the string above is an hash of that.
Try for example "hello2a" and "hell2a" you will get the same hash:

9aebada2aeb79fd1294d9df3c2ea782c00d7e61f

This happens because together with the error message got with "hello" and "hell", there is a good value: "2a". Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

You need to use pack() function:

<?php
$e = "B0436CBFBC5CAAFB7339AF4A1DF845974D53B9D369146E2E4F1451929D9EBE254363E983F4F94517EB9585FDB112E7B1CCE11A33C5BBA23F8D5DE9D3415BA526489AC796A36FBA76D4293C8DFB673708CED10C9732EEC472D9E43D2626AA104121666E79DD8F2FF6BAC0143BD62E0EE826AF6459779C162613508D48BFE2FC8DD558A1834D7205F96EA8D446E9B371E78E990A3995B1052DCBA9CA0AF99CC77ED2A8B55B2B882BA29D4BB4B07FA91AB4D2F10FBB93732B077335A7E6D96FE813AEDC3711A85CD0C13AE22B28C14FCCE3AF4C1F5D2C0F7697DEC7487CCFC0ED4E77B1B65F39BAD5236E3D3C69D33FC484";

echo sha1(pack("H*",$e));
?>

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

If you remove print_r() from line 64 and write $result, you can do this:

$result = array_merge_recursive($m2,$a4);
$q = '';
foreach($result as $key => $value)
{
	$name = trim($name);
	$location = trim($key);
	$utc = str_replace("\n",'',$utc);
	$coma = (empty($q)) ? '':',';
	$q .= "$coma values('$name', '$location', '$value[0]', '$utc', '$value[1]', '$value[2]', '$value[3]', current_timestamp())";
}

echo "INSERT INTO wetteroe (name, location, height, utc, temp, humidity, wind, DATEtime) $q"; #

This will give you two big inserts, basing on the names: Vorarlberg and Tirol.
I would use three tables, not only one: the first for the names, another for the locations and one for height, temp, humidity, wind and pressure. But that's just my opinion. Bye :)

Just a tip on previous code, online 4 and 5 I wrote:

$s = '1';
for( $i=0; $i<=$s; $i++){

The correct version is:

$s = count($arr);
for( $i=0; $i<$s; $i++){

Without equal ^__^'

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe I got some results, but I need to understand if you need to combine pressure values with locations, because the numbers are not the same and I getting some errors, here's what I've done:

<?php
$f = file_get_contents('js2.json');
$arr = json_decode($f,true);
$s = '1';
for( $i=0; $i<=$s; $i++){
	$name = $arr[$i]["name"][0];
	$location = $arr[$i]["location"];
	$height = $arr[$i]["height"];
	$utc = $arr[$i]["utc"][0];
	$temp = $arr[$i]["temp"];
	$humidity = $arr[$i]["humidity"];
	$wind = $arr[$i]["wind"];
	$pressure = $arr[$i]["pressure"];

	$arr1 = array();
	foreach($location as $key => $value)
	{
		$arr1[]= $value;
	}

	$arr2 = array();
	foreach($height as $key => $value)
	{
		$arr2[]= $value;
	}

	$arr3 = array();
	foreach($temp as $key => $value)
	{
		$arr3[]= $value;
	}

	$arr4 = array();
	foreach($humidity as $key => $value)
	{
		$arr4[]= $value;
	}

	$arr5 = array();
	foreach($wind as $key => $value)
	{
		$arr5[]= $value;
	}

	$arr6 = array();
	foreach($pressure as $key => $value)
	{
		$arr6[]= $value;
	}

	echo 'Name: '. trim($name) . "\n";
	echo 'UTC: ' . trim($utc) . "\n";
	echo "\n";
	
	$a1 = array_combine($arr1,$arr2);
	$a2 = array_combine($arr1,$arr3);
	$a3 = array_combine($arr1,$arr4);
	$a4 = array_combine($arr1,$arr5);
	$a5 = array_combine($arr1,$arr6);

	echo 'Merge: ';
	$m1 = array_merge_recursive($a1,$a2);
	$m2 = array_merge_recursive($m1,$a3);
	print_r(array_merge_recursive($m2,$a4)); # hide this if pressure array is fixed

	# uncomment below if pressure array is fixed
/*
	$m3 = array_merge_recursive($m1,$a4);
	print_r(array_merge_recursive($m3,$a5));

*/
}
?>

If you don't fix pressure array and you want to join it with location array you will get an error like this one:

array_combine(): Both parameters should have an equal number of elements ... on line 59

Probably there is a …

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe there's something wrong, to me that JSON doesn't seems to have two blocks. You could do something like this:

{
"first block":
    {
    "name":"value 1",
    "location":"value 2"
    },
"second block":
    {
    "name":"value 1",
    "location":"value 2"
    }
}

And in the PHP part:

<?php
$f = file_get_contents('j.json');
$j = json_decode($f,true);
echo $j['first block']['name'] . "\n";
echo $j['first block']['location'] . "\n";
echo $j['second block']['name'] . "\n";
echo $j['second block']['location'] . "\n";
?>

Hope it helps, bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

datetime column? Use strtotime():

<?php
$year = '2011';
$month = '9';
$day = '21';
echo date('Y-m-d',strtotime($year.'-'.$month.'-'.$day));
?>

In your case will be:

$sdate1 = date('Y-m-d',strtotime($_POST['sdate1year']."-".$_POST['sdate1month']."-".$_POST['sdate1day']));

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You are welcome!

cereal 1,524 Nearly a Senior Poster Featured Poster

Read what Karthik suggested to you. This happens because you're sending the same name field for day, month and year. An example, change names of select fields with these:

sdate1day
sdate1month
sdate1year
ddate1day
ddate1month
ddate1year

Change also the lines n.16 and 17, so they will be:

$sdate1=$_POST['sdate1year']."-".$_POST['sdate1month']."-".$_POST['sdate1day'];
$ddate1=$_POST['ddate1year']."-".$_POST['ddate1month']."-".$_POST['ddate1day'];
cereal 1,524 Nearly a Senior Poster Featured Poster

Or, just add this to your script:

print RandomList($WeekOfTheYear, $RandomItems);
print RandomList($WeekOfTheYear-1, $RandomItems);
print RandomList($WeekOfTheYear-2, $RandomItems);
print RandomList($WeekOfTheYear-3, $RandomItems);

You will have the same result without saving files. But this should be run directly on 3 different date('W') or you could get 0 or negatives numbers on January:

print RandomList($WeekOfTheYear, $RandomItems);
print RandomList(date('W')-1, $RandomItems);
print RandomList(date('W')-2, $RandomItems);
print RandomList(date('W')-3, $RandomItems);

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You need a foreach loop, and the code can be more simple:

$RandomItems = array(
    "<li><a href=\"#northern-germany\" title=\"Northern Germany\">North</a></li>","<li><a href=\"#southern-germany\" title=\"Southern Germany\">South</a></li>","<li><a href=\"#western-germany\" title=\"Western Germany\">West</a></li>","<li><a href=\"#eastern-germany\" title=\"Eastern Germany\">East</a></li>");

shuffle($RandomItems);
foreach($RandomItems as $r)
{
    echo $r;
}

But you still need to save the new order for a week otherwise at next refresh the order will change, you can save it into a database or into a file, here's an example with a file, after the file is generated the script, simply includes it into the page:

<?php

$week = date('W');
$file = $week.'.txt';

$previous = date('W')-1;
$oldfile = $previous.'.txt';

$rand = array(
	array('#northern-germany','Northern Germany','North'),
	array('#southern-germany','Southern Germany','South'),
	array('#western-germany','Western Germany','West'),
	array('#eastern-germany','Eastern Germany','East')
);

function RandomList($el)
{
	shuffle($el);
	$list = '';
	foreach($el as $key => $value)
	{
	    $list .= '<li><a href="'.$value[0].'" title="'.$value[1].'">'.$value[2].'</a></li>' . "\n";
	}
	return $list;
}


if(file_exists($file))
{
	if(file_exists($oldfile))
	{
		unlink($oldfile); # delete old file
	}

	include($file); # display new order for a week

}

# create file and save new order
else
{
	$myFile = $file;
	$fh = fopen($myFile, 'w') or die("can't open file");
	$stringData = RandomList($rand);
	fwrite($fh, $stringData);
	fclose($fh);
}


?>

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

And also your table name, return, is a reserved word, check this: http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
Use backticks if you want to use it:

"insert into `return` ..."

bye :)

karthik_ppts commented: Yes. +6
cereal 1,524 Nearly a Senior Poster Featured Poster

If I understood your question, write this:

$text = $_POST['FieldData2'];
$text .= ' your signature';

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Try to add:

$result = canUserSendSMS();
if($result == true)
{
    # send SMS code
}

else
{
    # exit
}

A suggestion: don't relate only on IP, most of the times users IP will change at next reconnect to internet, or it can be also changed by who wants to send more SMS and trick your limitation. And also consider that two, or more, users can share the same IP if they connect from the same LAN.

cereal 1,524 Nearly a Senior Poster Featured Poster

On my opinion it's never a waste of time :)
Your solution does the job without GMP extension, in some situations you can't install what you want, so that's perfect.

cereal 1,524 Nearly a Senior Poster Featured Poster

This loop won't timeout:

<?php
while(1)
{
   # run ftp connection

   # check for file
   if(file_exists('file.ext'))
   {
      break;
   }
   pause(10);
}
?>

You can also control ftp timeout, check this: http://www.php.net/manual/en/function.ftp-set-option.php

cereal 1,524 Nearly a Senior Poster Featured Poster

While reading ardav solution I thought another solution. Maybe is not clean but it should work:

<?php
function convert($number)
{
	$reverse = strpos(strrev($number),'.');
	$number = (strpos($number,'0') == '0') ? str_replace('0','',$number) : $number;
	
	$n1 = str_replace('.','',$number);
	$n2 = pow('10',$reverse);
	
	$a = gmp_gcd($n1,$n2);
	$b = gmp_strval($a); # display greatest common divisor
	
	return $n1 / $b . "/" . $n2 / $b . "\n";
}

echo convert('0.75');
?>

bye :)

diafol commented: Nice :) +13
cereal 1,524 Nearly a Senior Poster Featured Poster

Try to change i to $i And wrap $name value around quotes: $name = "James Cool Yang"; The easiest way to remove vowels is to use str_replace() check example #1 here: http://php.net/manual/en/function.str-replace.php
bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Great, bye!

cereal 1,524 Nearly a Senior Poster Featured Poster

This is what you should read at least once http://www.php.net/manual/
bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Check my reply, and the evolution of the script, in this thread http://www.daniweb.com/web-development/php/threads/375317
The solution is the same. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You need to change this:

imagecopyresampled($bgim_new,$bgim_old,0,0,600,200,$bgth_width,$bgth_height, $bgimage_attribs[0], $bgimage_attribs[1]);

This should be the values:

imagecopyresampled('newfile.jpg','original.jpg',0,0,600,200,400,500,1600,900);

In order to crop, GD needs to know where to start cropping. On a 1600px width, if you want 400px width, you have to do 1200px/2, so you end with 600px, the same is done for height, and you get 200.

With imagemagick all this is easier:

convert -crop 400x500 original.jpg newfile.jpg
cereal 1,524 Nearly a Senior Poster Featured Poster

You don't really need a file on your server, you can write a remote url:

simplexml_load_file('http://cars.website/path/file.xml', 'SimpleXMLElement',LIBXML_NOCDATA);

Or you can use simplexml_load_string()* which can be used with POST method.
If this is not enough, try to post an example here because the link you wrote is broken.

* http://www.php.net/manual/en/function.simplexml-load-string.php

cereal 1,524 Nearly a Senior Poster Featured Poster

Use SimpleXML: http://php.net/manual/en/book.simplexml.php
From that extension you can use simplexml_load_file() with LIBXML_NOCDATA, here's an example:

# XML file
<?xml version='1.0' standalone='yes'?>
<aaa>
	<bbb>
		<id>1</id>
		<title>title 1</title>
		<msg><![CDATA[hello world string]]></msg>
	</bbb>
	<bbb>
		<id>2</id>
		<title>another title</title>
		<msg>another message</msg>
	</bbb>
</aaa>

# PHP file
<?php 
$xml = simplexml_load_file('file.xml', 'SimpleXMLElement',LIBXML_NOCDATA); 
print_r($xml);
?>
cereal 1,524 Nearly a Senior Poster Featured Poster

Search for Error Handler. On "MySQL Stored Procedure Programming", written by Guy Harrison and Steven Feuerstein there's also a good example. you can find it searching on Google, bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You can use JSON if you want to write everything by yourself, otherwise search for Cassandra, Redis or CouchDB, for this last one check this tutorial:

http://www.ibm.com/developerworks/opensource/library/os-php-couchdb/index.html?ca=drs-

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

For a CakePHP controller the path is the directory that contains the app. So, probably, that's the root of your server. Is writable that path? Try to change it to something like this:

imagepng($dest,'/path/image.png'); # you can add also $_SERVER['DOCUMENT_ROOT']

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Explain better which files you want to limit access. Because CSS files can't be stored on that kind of directory.

And post a portion of code where you include the header.php that doesn't now work. So we can see what is happening. To include a file from that directory you should write something like this:

include('/path/to/file/header.php');

where the path is the server root, not an url. Bye :)