Copy link to clipboard
Copied
Hi
Like most on here I am new to Dreamweaver, a FrontPage convert! I am trying to setup a form which will allow people to register on the site and I want to automatically add their details into a MySQL database when they click the submit button. I have setup the database on the hosting server, Network Solutions is the hosting company, I have setup a connection etc and everything seems ok locally.
The page in question is http://www.petergwynne.com/prize.php
When I try and load it I get the error message
" Fatal error: Call to undefined function virtual() in /data/19/1/47/45/1862045/user/2022132/htdocs/prize.php on line 1"
It seems to be saying that it cannot find the 'connection' which I have setup, but I can check on the site and all files seem to be there.
Has anybody got any ideas?
Sean
Copy link to clipboard
Copied
What that error message means is that the virtual() function doesn't exist. The virtual() function works on Apache only, so I imagined your site was hosted on a Windows server. Amazingly, it's not. It's Apache, but virtual() appears to have been disabled by the hosting company. That's not a bad thing, because virtual() causes endless problems for Dreamweaver users. Fear not, the solution is simple...
Dreamweaver automatically uses virtual() to include files, such as the MySQL connection file, when you set your site definition to use links relative to the site root. Simply replace virtual() with require_once(). However, require_once() needs a relative link to the include file.
So, at the top of your page, you probably have something like this:
<?php virtual('/Connections/mylink.php'); ?>
Change it like this:
<?php require_once('Connections/mylink.php'); ?>
Note that I have removed the forward slash at the beginning of the path to the connections file. The path needs to be relative to the document. Also, change the name of mylink.php to match the actual file you're using.