vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Fwrite,Fopen,Fread...in admincp (https://vborg.vbsupport.ru/showthread.php?t=209990)

kiril_cvetkov 03-31-2009 08:34 PM

Fwrite,Fopen,Fread...in admincp
 
Can we use Fopen,Fwrite,Fread php functions in admincp programming
here is my code

PHP Code:

if($_REQUEST['do'] == 'addplaylist')
{    
                            
print_form_header('admin_podcast_box''do_addplaylist');

    
print_table_header('Add podcast playlist song'3);
    
print_input_row('Podcast Name''podcastname'''0'50');
    
print_input_row('Podcast(url)','podcasturl','',0,50);

    
print_submit_row($vbphrase['add']);
}
//Do Add Category
if($_REQUEST['do'] == 'do_addplaylist')


{
    
$file "music.xml";
$fh fopen($file'a');
$string "New text\n";
fwrite($fh$string);
fclose($fh);
    
$vbulletin->input->clean_array_gpc('p', array(
    
'podcastname' => TYPE_STR,
    
'podcasturl' => TYPE_STR,
));
    
  

    
$db->query_write("
        INSERT INTO " 
TABLE_PREFIX "podcastinfo
        (
      name
        ) VALUES (
    '" 
$db->escape_string($vbulletin->GPC['podcastname']) . "'
)"
);


define('CP_REDIRECT'"admin_podcast_box.php?do=deletepodcast");
    
print_stop_message('droplink_category_added'$vbulletin->GPC['deftitle']);
   


I don't get nothing in the text file, nothing is writed, i am using app serv on windows xp (maybe there are no permissions for writing)

Any help or sugestions?

Dismounted 04-01-2009 07:06 AM

Check the error logs, are there any errors from that script?

Why don't you just use file_put_contents()?

kiril_cvetkov 04-01-2009 08:05 AM

:) Omg all is ok I just have checked bad directory


All times are GMT. The time now is 11:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00944 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete