Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-02-2003, 08:35 PM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Anything wrong (NOT VB-RELATED)

This install script won't work for the project I'm working on.
When it comes to step 3, writing the file, it comes up as a blank page.
Here is the file.
[high]THIS FILE IS NOT THE VB-INSTALL FILE, IT IS NOTHING TO DO WITH VB I CANNOT STRESS THAT ENOUGH KTHX[/high]
Reply With Quote
  #2  
Old 06-03-2003, 04:53 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"is_writable("./config.php")"

this will just be true, if file config.php already exists and php can write into it, but you are in the part of the file_exists("./config.php") - if clause where the file surely isn't created, so this condition can never be true

if you replace is_writable("./config.php") with a true, you will see that it'll work then (or at least gives you a no permission error if php has no permissions to create files)
Reply With Quote
  #3  
Old 06-03-2003, 07:32 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I kinda fixed it.
This is part of the code:
PHP Code:
    } else {
        
$handle fopen('config.php','a');
        
$temp[00] = "" chr(60) . chr(63) . chr(112) . chr(104) . chr(112) . ""// < ? p h p line
        
$temp[01] = "error_reporting(7);";
        
// chr(36) is '$'
        
$temp[02] = "" chr(36) . "mysql[host] = \"" $_POST['mysqlhost'] . "\";";
        
$temp[03] = "" chr(36) . "mysql[user] = \"" $_POST['mysqluser'] . "\";";
        
$temp[04] = "" chr(36) . "mysql[pass] = \"" $_POST['mysqlpass'] . "\";";
        
$temp[05] = "" chr(36) . "mysql[data] = \"" $_POST['mysqldata'] . "\";";
        
$temp[06] = "" chr(36) . "dbset = mysql_connect(" chr(36) . "mysql[host]," chr(36) . "mysql[user]," chr(36) . "mysql[pass]);";
        
$temp[07] = "mysql_select_db(" chr(36) . "mysql[data]);";
        
$temp[08] = "" chr(36) . "admin[user] = \"" $_POST['adminuser'] . "\";";
        
$temp[09] = "" chr(36) . "admin[pass] = \"" $_POST['adminpass'] . "\";";
        
$temp[10] = "" chr(36) . "admin[email] = \"" $_POST['adminemail'] . "\";";
        
$temp[11] = "?" chr(62) . "";
        
$temp[12] = "" $temp[00] . "\n" $temp[01] . "\n\n" $temp[02] . "\n" $temp[03] . "\n" $temp[04] . "\n" $temp[05] . "\n\n" $temp[06] . "\n" $temp[07] . "\n\n" $temp[08] . "\n" $temp[09] . "\n" $temp[10] . "\n\n" $temp[11] . "";
        
fwrite($handle,$temp[12]);
        
fclose($handle); 
The config.php file is written out like this now:
Code:
$adminpass = "sdfasdf";
error_reporting(7);

$mysql[host] = "localhost";
$mysql[user] = "username";
$mysql[pass] = "password";
$mysql[data] = "database";

$dbset = mysql_connect($mysql[host],$mysql[user],$mysql[pass]);
mysql_select_db($mysql[data]);

$admin[pass] = "sdfasdf";
$admin[pass] = "sdfasdf";
$admin[email] = "blah@whtevr.com";

?>
Dave.
Reply With Quote
  #4  
Old 06-03-2003, 07:36 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


you're welcome
Reply With Quote
  #5  
Old 06-03-2003, 08:46 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um lol.
Look at the 2nd [code] tag.
Where's <?php
And why is $admin[pass] in place of <?php and $admin[user]?

Dave.
Reply With Quote
  #6  
Old 06-03-2003, 09:23 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, sorry i didn't see it, and i don't see why it's creating that erros, but why are you doing that in a so complex way?

try this:

PHP Code:
} else {
        $handle = fopen('config.php','a');
$tempfiledata ='<?php
error_reporting
(7);
$mysql[host] = "' . $_POST['mysqlhost'] . '";
$mysql[user] = "' . $_POST['mysqluser'] . '";
...
...
...
?>';
   fwrite($handle,$tempfiledata);
        fclose($handle);
remember variables are not parsed in ' strings
Reply With Quote
  #7  
Old 06-03-2003, 07:42 PM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought they were.

Dave.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:58 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04369 seconds
  • Memory Usage 2,246KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete