There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer bios black screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem ram router slow sound startup trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Small problemafter embedding PHP in HTML


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
moe70's Avatar
Junior Member with 6 posts.
 
Join Date: Feb 2006
11-Feb-2006, 03:43 PM #1
Small problemafter embedding PHP in HTML
I got a php website and it requires registration and login to enter... but i wanted to add background music in the login page so i embeded the php code in html... but now when i try to sign in my site it says cookies must be enabled.... i have themenabled and everything works fine on the index.php but not on index.html

does anyone know what could be the problem
jiml8's Avatar
Senior Member with 1,514 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
11-Feb-2006, 03:46 PM #2
If you have an index.php you should not have an index.html. In fact, I generally put a redirect into my sites so that those stupid browsers that come looking for an index.html will get my index.php instead.

In any case, without specific details of your problem - including code samples and exact error messages - no one here will be able to help you.
moe70's Avatar
Junior Member with 6 posts.
 
Join Date: Feb 2006
11-Feb-2006, 04:00 PM #3
ok heres the full story

this is the website with in it self original as php (use username: guest password:guest)

http://m-sn.myftp.org

here it is as html

http://84.9.109.183/indexhtml.html




i created a .htaccess so i woudnt have any problem with the embeddation (is that a word)

Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html


and here are the parts that involve cookies in php code

Code:
}

function infobox()
{
 	global $PHP_SELF, $u_cookieid, $u_id, $app_ver, $setctl, $u_id, $app_build, $homepage;
	$homepage = str_replace('KBUILD', $app_build, str_replace('KVER', $app_ver, $setctl->get('homepage')));
	?>	
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top" align="left">		
		<?php if ($setctl->get('showkeyteq')) 
		{
			?><span class="notice"><?php echo '<a href="http://keyteq.no" target="_blank">'.substr(get_lang(77),0,3).'</a>'.substr(get_lang(77),3); ?></span><?php
		}
		if ($setctl->get('showupgrade')) 
		{
			?><a title="<?php echo get_lang(120); ?>" href="http://m-sn.com/?ver=<?php echo $app_ver; ?>&amp;build=<?php echo $app_build; ?>" target="_blank">
			<font color="#CCCCCC"><?php echo get_lang(78); ?></font></a><br/><?php
		} else if ($setctl->get('showkeyteq')) echo '<br/>'; ?>



Code:
function webauthenticate()
{
	global $_POST, $u_cookieid, $phpenv, $setctl, $cfg, $u_id;
	if (!$cfg['disablelogin']) 
	{
		if (isset($_POST['user']) && isset($_POST['password']))
		{
			$user = mysql_escape_string($_POST['user']);
			$pass = mysql_escape_string($_POST['password']);
			if (!empty($user) && !empty($pass))
			{
				if (db_verify_user($user, $pass) == 1)
				{
					if ($cfg['demomode']) 
					{
						$result = db_execquery('SELECT u_sessionkey FROM '.TBL_USERS.' WHERE u_pass = "'.md5($pass).'" AND u_login = "'.$user.'"');
						$row = mysql_fetch_array($result);
						$num = $row['u_sessionkey'];
					} else
					{
						$u_cookieid = $num = getrand(1);
						db_execquery('UPDATE '.TBL_USERS.' SET u_status = 1, u_ip = "'.$phpenv['remote'].'", u_sessionkey = "'.$num.'", laston = u_time, u_time = '.time().' WHERE u_id = '.$u_id);						
					}
					if ($setctl->get('timeout') > 0 && isset($_POST['rememberme'])) $expiration = time() + $setctl->get('timeout'); else $expiration = 0;
					setcookie($cfg['cookie'],'');
					setcookie($cfg['cookie'], $num, $expiration);
					return true;
				}
			}
		}
	} else return true;
}

dont know if this one has go anyting to do with it

Code:
function httpstreamheader2($ftype=1, $sid, $keyint=0)
{
	global $phpenv, $streamtypes, $setctl, $u_cookieid, $cfg;
	$url = '';
	if (isset($streamtypes[$ftype]) && $streamtypes[$ftype][2] == 1)
	{
		$url = $setctl->get('streamurl').$phpenv['streamlocation'].'?streamsid='.$sid.'&c='.$u_cookieid;
		if (URLSECURITY) $url .= '&'.urlsecurity($keyint, $sid);
		if ($setctl->get('sendfileextension')) $url .= '&file=.'.$streamtypes[$ftype][0]; 		
	}
	return $url;
}

class asxgen




and here is the full code as i embeded it in html

http://sendmefile.com/00279164




thanks
moe70's Avatar
Junior Member with 6 posts.
 
Join Date: Feb 2006
11-Feb-2006, 04:25 PM #4
btw is there anyway to have a song playing in the background without having to do this whole embedding thing coz im not too good with php
jiml8's Avatar
Senior Member with 1,514 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
12-Feb-2006, 10:13 AM #5
I can't access either site you gave. Connection cannot be established.

In any case I don't see what the problem is; the code in webauthenticate clearly saying "set a cookie". You are setting a cookie if login is enabled, username and password is not blank, and these entries are found in your database.

And of course you can stream music. This would be set client-side in html. The details vary according to the format of the music to be streamed.
moe70's Avatar
Junior Member with 6 posts.
 
Join Date: Feb 2006
12-Feb-2006, 01:43 PM #6
ok is realised the problem now


wen i embed the php code in the html it works but it doesnt setcookie

why not i dunno

heres the site again

http://m-sn.myftp.org/index.php (original)

http://m-sn.myftp.org/indexhtml.html (embeded in html)
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:07 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.