PDA

View Full Version : url prefix error


craig
02-20-2007, 10:34 AM
hi dj

I was doing your php video tutorials last night and i am haveing a problem previewing what i have done in the browser. when defineing the website i type in to the url prefix in the test server catogary and i get a warning box pop up that says:

"The url prefix [/Test] for testing server does not match the site url prefix [] specified in HTTP address for the site.This may cause site relative links to display incorrectly at run time proceed anyway?"

This what i typed into that box:

http://localhost/Test/

Sorry if this is a stupid question and i am just being a dumb ass!!:lol:

Thanks for the help Dj and the tut's are awsome!!

Craig

davidj
02-20-2007, 11:27 AM
in dreamweaver you should have a php file your working on with the php extension

if you have setup your servers correctly and your Apache is running then if you press F12 you will launch the page in the browser.

try this and tell me what happens

craig
02-20-2007, 01:04 PM
Hi again

I have done the php files in the folders as explained in your tutorial for connection.php and dwc.php but when i press f12 i am getting this error:

Parse error: syntax error, unexpected $end in C:\wamp\www\Test\images\dwc.php on line 27

I have checked in my server error log and i have this error coming up:

[Tue Feb 20 13:47:26 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.1 configured -- resuming normal operations
[Tue Feb 20 13:47:26 2007] [notice] Server built: Jan 9 2007 23:17:20
[Tue Feb 20 13:47:26 2007] [notice] Parent: Created child process 2488
[Tue Feb 20 13:47:26 2007] [notice] Child 2488: Child process is running
[Tue Feb 20 13:47:26 2007] [notice] Child 2488: Acquired the start mutex.
[Tue Feb 20 13:47:26 2007] [notice] Child 2488: Starting 250 worker threads.
[Tue Feb 20 13:47:26 2007] [notice] Child 2488: Starting thread to listen on port 80.
[Tue Feb 20 13:50:03 2007] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/CFIDE
[Tue Feb 20 13:55:10 2007] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/CFIDE

HELP!!!:lol:

davidj
02-20-2007, 01:24 PM
post the code to dwc.php

craig
02-20-2007, 01:27 PM
<?php
require_once("_notes/connections/connection.php");//Database connection script
/////////////////////////////////////////////
$query = sprintf("SELECT * FROM table1");
$result = @mysql_query($query);
$row = mysql_fetch_array($result);
/////////////////////////////////////////////
do {
echo $row['field2'];
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

davidj
02-20-2007, 01:30 PM
i dont know what you have been doing but...

where you have require_once("_notes. this is incorrect. I dont know why you have this in _notes ???

also why do you have dwc.php in images dir ????

<?php
require_once("_notes/connections/connection.php");//Database connection script
/////////////////////////////////////////////
$query = sprintf("SELECT * FROM table1");
$result = @mysql_query($query);
$row = mysql_fetch_array($result);
/////////////////////////////////////////////
do {
echo $row['field2'];
?>

craig
02-20-2007, 01:49 PM
where you have require_once("_notes. this is incorrect. I dont know why you have this in _notes ???

I dont know why this has happend either i think it is because i moved the file at some point by accident? (i think) I have removed it now though.

also why do you have dwc.php in images dir ????

Becuse that is where it is in your video tutorial
EDIT (sorry it is not where you have it it is me reading your tree wrong sorry).

My code now looks like this:


<?php
require_once("connections/connection.php");//Database connection script
/////////////////////////////////////////////
$query = sprintf("SELECT * FROM table1");
$result = @mysql_query($query);
$row = mysql_fetch_array($result);
/////////////////////////////////////////////
do {
echo $row['field2'];
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

and when i press f12 i am still getting this error:


Parse error: syntax error, unexpected $end in C:\wamp\www\Test\connections\dwc.php on line 27

davidj
02-20-2007, 01:55 PM
so you now have dwc.php in your Connections dir ???

davidj
02-20-2007, 02:00 PM
your Do{ loop is incomplete

you need to follow the tuts to the letter but not autonomously. You need to understand and absorb the consept or your going to run into problems

craig
02-20-2007, 02:01 PM
so you now have dwc.php in your Connections dir ???

yes and i am now getting this error when pressing f12

Parse error: syntax error, unexpected $end in C:\wamp\www\Test\connections\dwc.php on line 27

Sorry for being such a pain in the ass

davidj
02-20-2007, 02:02 PM
please post all page code from dwc.php

craig
02-20-2007, 02:18 PM
<?php
require_once("connections/connection.php");//Database connection script
/////////////////////////////////////////////
$query = sprintf("SELECT * FROM table1");
$result = @mysql_query($query);
$row = mysql_fetch_array($result);
/////////////////////////////////////////////
do {
echo $row['field2'].<br>;
}while($row = mysql_fetch_array($result))
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

davidj
02-20-2007, 02:26 PM
this is different from what you posted earlier

also if you have your dwc.php in the Connection dir then it wont work because your calling in the connections.php incorrectly by using a path that doesnt exist...

require_once("connections/connection.php");// << you had dwc.php in connections dir

What is happening now??

your error is indicating a syntax error but i cant see $end var anywhere in your script??

i think your racing through the tuts which is why your making mistakes. You need to take your time and double check everything you write with what i write

craig
02-20-2007, 02:50 PM
Thanks Dj

I have sorted it now i deleted the site and started again like you said i think i was just rushing it and had not defined something correctly.
It is working now i will work through the rest of the tutorials a bit more closely this time thanks for all of your time .I aint alway this much of a pain i the ass just having one of those days!!!:roll:

davidj
02-20-2007, 03:00 PM
great mate

pleased its sorted

MarkDakers
03-09-2007, 10:57 AM
Hi

Whilst I appreciate the effort you have put into these, is it possible to post the code - I'm working on a small(ish) monitor and your code appears about 6 point in the vid tutorial. I have a similar error to one already posted (Parse error: syntax error, unexpected T_ECHO) but am finding debugging hard.

I am trying to understand as I type, but if I could print out your code to check my life would be as easy as Oba's last night when running at the non-existant dutch defence!

Mark

davidj
03-09-2007, 11:08 AM
Sorry mark

the laptop i developed the tutorials on is now a smoldering heap

I dont have access to the tuts and wont for a week or two (or until i get the balls to spend 3k on my next machine)

can anyone help who has followed the tuts and has the code to post. (Working Code Please).

Ideally could you just zip the code up and send it to Dom so he can include this as a link

I will be offline over the weekend so happy coding and ill be back on Monday

// *******************************************

That was a good game last night. Well the first Half anyway

MarkDakers
03-09-2007, 11:22 AM
Wow - sorry to hear about your laptop, I keep bracing myself to buy a new one, then chicken out at the prices.

I've solved my current problems (simple typos) and will keep going - I have been meaning to tackle php, videos with an English voice are really nice.

Thanks for the quick response!

I'm on to part 7, only started yesterday, have already done a login page - but now trying to understand how I did it.

Perhaps I'll drag a bigger monitor out of work......


Mark

PS I can't buy you a new laptop - but if you ever venture down South (Surrey) I'll cheerfully buy a beer as a thank you!