totalnewbie Posted May 7, 2006 Share Posted May 7, 2006 hi guysive made some webpages in dreamweaver using mysql db. when i try and load my pages on my virtual server, the pages load up with the information from my live database!now when i load the pages up onto my live server, they dont work! these are PHP pages.im getting the error:Fatal error: Call to undefined function: virtual() in D:\inetpub\websitename\subfolder\dpage.php on line 1(the address above is edited)can anyone tell me what might be wrong?? im really struggling at this. thanks for ur help! Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/ Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 Like the error message says ... the script is trying to access a function named 'virtual' which it cannot find. Maybe there are other files you need to upload to your live server and/or put them in the expected folder. Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34034 Share on other sites More sharing options...
totalnewbie Posted May 7, 2006 Author Share Posted May 7, 2006 [!--quoteo(post=372014:date=May 7 2006, 09:54 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 7 2006, 09:54 AM) [snapback]372014[/snapback][/div][div class=\'quotemain\'][!--quotec--]Like the error message says ... the script is trying to access a function named 'virtual' which it cannot find. Maybe there are other files you need to upload to your live server and/or put them in the expected folder.[/quote]hiwell, what ive done is make my entier site using dreamweaver, so i dont know much about the rest. it has made a folder called 'connections' and a php file inside it which contains the username and password etc to connect to my database. the rest of my pages connect to this file in order to connect to my database. where can i find this file which has a virtual function?? im using a virtual server program on my pc which uses the apache server.can you please tell me how i can fix this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34040 Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]where can i find this file which has a virtual function?? [/quote]That's pretty well impossible for me to tell you - after all, these are your scripts - and I don't use DreamWeaver . Maybe someone else has a clue as to what DW has done for you. Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34044 Share on other sites More sharing options...
wildteen88 Posted May 7, 2006 Share Posted May 7, 2006 Well theres a clue in the error message. virtual is being called on line 1 in [b]dpage.php[/b].If you post the code here we should be able to help. As far as I know virtual is used to include and parse shtml files and is an Apache specific function. Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34045 Share on other sites More sharing options...
totalnewbie Posted May 7, 2006 Author Share Posted May 7, 2006 [!--quoteo(post=372025:date=May 7 2006, 10:21 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 7 2006, 10:21 AM) [snapback]372025[/snapback][/div][div class=\'quotemain\'][!--quotec--]Well theres a clue in the error message. virtual is being called on line 1 in [b]dpage.php[/b].If you post the code here we should be able to help. As far as I know virtual is used to include and parse shtml files and is an Apache specific function.[/quote]right guys this is the real code. the above one was edited.<?php virtual('/Connections/salford.php'); ?><?php$maxRows_Recordset1 = 10;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;mysql_select_db($database_salford, $salford);$query_Recordset1 = "SELECT * FROM asif_planets, asif_images WHERE asif_images.Related_to = asif_planets.Planet_name";$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $salford) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;?>The virtual function connects to this:<?php# FileName="Connection_php_mysql.htm"# Type="MYSQL"# HTTP="true"$hostname_salford = "213.171.193.146";$database_salford = "salford";$username_salford = "";$password_salford = "";$salford = mysql_pconnect($hostname_salford, $username_salford, $password_salford) or trigger_error(mysql_error(),E_USER_ERROR); ?>any ideas??thanks! Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34055 Share on other sites More sharing options...
wildteen88 Posted May 7, 2006 Share Posted May 7, 2006 I see the error now. Change this:[code]<?php virtual('/Connections/salford.php'); ?>[/code]to[code]<?php require_once('/Connections/salford.php'); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34057 Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 Replace:[code]<?php virtual('/Connections/salford.php'); ?>[/code]With this:[code]<?php require('/Connections/salford.php'); ?>[/code]edit ... too slow :) Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34058 Share on other sites More sharing options...
totalnewbie Posted May 7, 2006 Author Share Posted May 7, 2006 [!--quoteo(post=372038:date=May 7 2006, 10:53 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 7 2006, 10:53 AM) [snapback]372038[/snapback][/div][div class=\'quotemain\'][!--quotec--]Replace:[code]<?php virtual('/Connections/salford.php'); ?>[/code]With this:[code]<?php require('/Connections/salford.php'); ?>[/code]edit ... too slow :)[/quote]hii now get this error:Fatal error: main(): Failed opening required '/Connections/salford.php' (include_path='.;c:\php\pear') in D:\inetpub\csesalford\asiffyp\planets.php on line 1what can this mean and how do i rectify this? also when i preview the page on my localhost server, it no longer shows up. Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34062 Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 It appears that your connection information resides in a file named Connection_php_mysql.htm. Assuming that's true, then that is the file you need to include - if that file is in the same folder as the script that's looking for it (otherwise, adjust the filename in the require function below):[code]<?php require('Connection_php_mysql.htm'); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9239-web-pages-wont-load-once-i-upload-them/#findComment-34173 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.