error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 18, 2013 05:39PM

Apologies first please try to speak in beginner language. I am about to try and learn PHP. I've managed to install WAMP. And have got a site on localhost. The images show, the menu appears, and everything looks fine. But I have dynamic pages and these are generated from a link that was created by a web developer

echo '<a class="nav" href="genre_lp-'.$row['genre_id'].'"> '.$row['genre'].' </a><br />'; }

The link passes (is that the right word?) when clicked on the live site but adds the following page error when clicked on local

The requested URL /genre_cd.php was not found on this server.

I assume its something I have to do to htaccess or config?

The only thread I could find here suggested turning registered globals on...did that but it made no difference
Any ideas?

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: RiggsFolly (---.as13285.net)
Date: March 18, 2013 07:26PM

Looks like that may be coming from a database query, have you loaded the database?

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 18, 2013 07:49PM

Ah thanks, yes the database is all copied over and looks correct, but I may not have connected it correctly to local?

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 18, 2013 09:50PM

hmm yes it seems it's a database issue I followed instructions on how to connect and I don't get a connection or error message just a blank white page

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: RiggsFolly (---.as13285.net)
Date: March 19, 2013 03:39AM

Post your mysql_connect change the userid and password so something silly

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 19, 2013 11:45AM

thanks for helping

// set your infomation.
$dbhost = 'localhost';
$dbuser = 'myuserid';
$dbpass = 'mypass';
$db = 'mydb';

// connect to the mysql database server.
$link_id = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to connect to SQL server"winking smiley;

// select the specific database name we want to access.
$my_db = @mysql_select_db($db) or die("Unable to select database"winking smiley;

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: RiggsFolly (---.as13285.net)
Date: March 19, 2013 11:59AM

When you setup the mysql userid 'myuser' and gave it a password 'mypass' did you also give that user basic privilages on the 'mydb' database?

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: RiggsFolly (---.as13285.net)
Date: March 19, 2013 12:06PM

Also check php error log ( use the wampmanager menus to get to it )

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 19, 2013 04:16PM

Thanks for your help

yes user is set to all privileges. I checked by changing user to another name and got an access denied message. So it seems to be working with the details I have but just takes me a to a white page

When I went to look at log it said a page didn't exits so I created one. It doesn't seem to be recording errors in the log? But I assume that's a problem I can look at later!

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: RiggsFolly (---.as13285.net)
Date: March 19, 2013 04:45PM

If you want I can try a Team Viewer session with you to identify what the problem is.

If you like this idea, install Team Viewer, its free.

Start it and leave it running, then send me a private message with the ID and PASSWROD that TV gives you.

This is only good for one session so as soon as your terminate the TV Session I cannot get in and when you start another it will give yo a new PASSWORD so again I cannot get in.

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: zdy (27.17.16.---)
Date: March 21, 2013 07:38AM

I am using dynamic urls such as 'category.aspartist=Georges-Gardet&movement=AnI amalier'
This is more for security and usability that anything else, but say if a user enters the URL with a mistake in, I wana to response.write, 'Sorry, but the page you tried to access does not exist'. So for instance, if a user entered the following incorrect URL:-Code:
category.aspartist=Georges-Gardet&movement=Ani
then I wana the error message above to applicationear.
Currently, if the wrong URL is entered, the following error message applicationears,Code:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record
Could this be done in an IF statement, so if the URL entered doesn;t exactly match my variables within my database, the error message applicationears
If this is possible, would some body pls be able to give me an example of how it can be written
Kind
monoclonal antibody drugs www.cusabio.com/s_monoclonal.html

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 21, 2013 02:42PM

thanks I'm uncomfortable at this stage of giving access to my computer...sorry. If you still feel like helping I do not think it's a database issue. I've been looking further and because I don't know what to search I keep thinking I've found the answer and then it doesn't work!

It's all way above my head at the moment. But I intend to crack it smiling smiley

So back to the problem.

the database is being accessed because it's pulling out data that I've set for the alt/title of the item in images on the site home page. It's when that item is then clicked on to go to a new dynamic page where it says

The requested URL /genre_cd.php was not found on this server.

Is it something to do with a rewrite rule that's working fine on my web site but not on local? Due to probably a badly written rewrite rule in the first place possibly?

Options: ReplyQuote
Re: error passing dynamic urls
Posted by: peter23 (---.as13285.net)
Date: March 23, 2013 02:41AM

thanks for you help. It turns out I had the host file incorrectly set up. Problem solved. I'm up and running :-)

Options: ReplyQuote


Sorry, only registered users may post in this forum.