Jump to content

Search the Community

Showing results for tags 'file'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 15 results

  1. Hi guys I have uploaded a document with html and css in the file manager of my Wordpress blog. The html is the image of horse and the css is used to turn the horse into a galloping horse. Unfortunately, the code doesn't work on my blog as it does on codepen https://codepen.io/dannyku18/pen/yLYJXMV I think the connection between html and css is missing. How can I make this code work? Best, Daniele
  2. I copied the code straight from https://www.w3schools.com/nodejs/shownodejs_cmd.asp?filename=demo_events_open open.js var fs = require('fs'); var readStream = fs.createReadStream('./demofile.txt'); /*Write to the console when the file is opened:*/ readStream.on('open', function () { console.log('The file is open'); }); Upon executing "node open.js" in the terminal, "The file is open" appears in the terminal, then the program terminates. It always happens, even if I don't have demofile.txt open in Notepad or any other program. Not sure why this is happening? When I instead use the string 'close', the console never prints anything out, regardless as to demofile.txt is open or closed. This behavior has happened on both my Windows machine and Raspberry Pi. Tried putting the above code inside a http.createServer statement, but then I get no output at all in the console. Although I suppose that would be unnecessary.
  3. Hey there, I have followed the tutorial for the w3 raspberry pi led pwm Gpio controller using node.js (https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp) unfortunately though it uses internal scripts and stylesheets. I have tried using express.static to set up file hosting but I couldn’t get it to work. I am needing to host additional files for the web server to read. I am fairly new at node.js so it might have been the way I was trying to implement it that caused the issue. Thanks in advance
  4. This is my page, where i have 2 contact forms, i need to fix the one in the bottom: http://ciudadcapital.agencialosnavegantes.cl/contacto/ I want the input-type file to have a black background, so i do this: div.wpcf7 input[type="file"] { cursor: pointer; padding-bottom: 50px; background-color: #0000 !important; } But it doesn't work, it's still white. Is something missing?
  5. I have students creating sites that have multiple pages that link together through a nav bar and also have images with an external file source. When students send them to me obviously the images don't work because I don't have them saved in folders with their sites and also the links don't work to the other .htm pages for the same reason. My first thought was to have students send me all files so that they would all be in my downloads folder and in theory work. They work to an extent but images are distorted. My second solution was to use a zip file but that doesn't seem to work either. Any help with this is much appreciated.
  6. Hello W3S! It's been a while since i've been online here... sorry about that Anyways. I have some trouble with a dynamic menu i'm trying to make with MySQLI... not sure if that is the problem anyhow... Here is the code as a start, i will explain under the code below what i'm trying to do: // File that we are on (viewing / watching)$tab = pathinfo( $_SERVER['SCRIPT_NAME'], PATHINFO_FILENAME );$menu_res = query("SELECT * FROM menu WHERE menu_file_url = ".$tab);$menu_row = mysqli_fetch_row($menu_res);if( $tab == $menu_row['menu_file_url'] || $menu_row['menu_accessible'] == "no" ) stderr("Page Error", "We are currently working on this page! Go to another page to keep browsing! Thanks for your patience! :)");if(isset($CURUSER)){ $menu_while_res = query(" SELECT * FROM menu WHERE menu_accessible = 'yes' AND menu_view = 'user' OR menu_view = 'both' ORDER BY menu_order_id ASC");}else{ $menu_while_res = query(" SELECT * FROM menu WHERE menu_accessible = 'yes' AND menu_view = 'guest' OR menu_view = 'both' ORDER BY menu_order_id ASC");}$HTMLOUT .= "<ul class='nav_first'>"; while ($menu_while_row = mysqli_fetch_array($menu_while_res, MYSQLI_ASSOC)) { // Menu Items Loaded Here $tabarray = array( $menu_while_row['menu_array_id_name'] => "<li><a href='".$menu_while_row['menu_file_url']."'>".$menu_while_row['menu_name']."</a></li>", ); // K = Key // V = Value foreach($tabarray as $k => $v) { if( $tab == $k ) $HTMLOUT .= str_replace("<li>", "<li class='nav_active'>", $v); else $HTMLOUT .= $v; } // Unset Menu For re-load again unset($tabarray); }$HTMLOUT .= "</ul>"; Currently i'm trying to make a dynamic menu with MySQLI! It's working perfectly... but when i tried to "expand" the project a bit longer and try to make a dynamic menu with errors on pages if the users are not allowed to view a specific file, then i get nothing... What i'm trying to do is to controle in the database with "Enum" as my DB setup that is "no" is has been set on one of the menu items (menu_accessible).. then the item will NOT show on the menu! AND if the user still tries to enter that specific page by URL, he will then get an error message saying that we are working on the website page... The code i'm trying to insert into this project is this little peace of code here: // File that we are on (viewing / watching)$tab = pathinfo( $_SERVER['SCRIPT_NAME'], PATHINFO_FILENAME );$menu_res = query("SELECT * FROM menu WHERE menu_file_url = ".$tab);$menu_row = mysqli_fetch_row($menu_res);if( $tab == $menu_row['menu_file_url'] || $menu_row['menu_accessible'] == "no" ) stderr("Page Error", "We are currently working on this page! Go to another page to keep browsing! Thanks for your patience! :)"); However, i get no respond on the code! Even when i have checked if the "$tab" variable is real and related to the name inside the DB (which it is!)... so if possible, can anyone help and tell me what i'm doing wrong here Oo? Thanks alot by the way! And sorry for the long goodbye hehe ...studies and all, killing me! -.-' Anyways, hope some answers or good tips... really need this one Thanks in advance! Mr rootKID
  7. I would like to know what are the files (.txt,.jpeg,.png) we can read using only with fread function.I know there are some other in build functions there to read .xls,.xml & .csv files.Recently I have an issue to read a .doc or .docx file using fread. finally I modified that file into .txt file and read the same.Please need a solution.
  8. Hello, I have the following code in a file called upload_file.php: <?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; $filename = $_FILES["file"]["name"]; $filetype = $_FILES["file"]["type"]; $title = $_POST['title']; $content = $_POST['content']; $image_pos = $_POST['image_pos']; $publisher = $_POST['publisher']; mysqli_query($con,"INSERT INTO news (title,content,image,image_pos,publisher) VALUES ('{$title}','{$content}','{$filename}','{$image_pos}','{$publisher}')"); if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } }?> and I get the following error: Can someone please help me, my file permissions in the upload folder are 777 and the directory exists. Can you please help with the SQL problem and the File upload? Thanks in advance!
  9. Okay, this is a little hard to explain, but i try. As you see on the attached/uploaded picture, i wish to make a div like the page i found some days ago, it's easy i know.. BUT, here comes my problem. I am using a template/global design via a file called template.php inside (root/templates/template.php), and in there i have my menu to be shown... now, i wish this sub-menu to be shown, and i have done that, only problem is, that file is to be used on global design, meaning this div will be shown on ALL files (pages). Now my question, is it possible with if and else statements (possible functions also), to make it show only on 1 file, the file called: webshop.php this is how my code inside template.php looks like right now: //=======MENU$HTMLOUT .= "<div id='menu'>"; $HTMLOUT .= "<a href='#'>123</a>"; $HTMLOUT .= "";$HTMLOUT .= "</div>";//=====SUB$HTMLOUT .= "<div id='under_menu'>"; $HTMLOUT .= "123";$HTMLOUT .= "</div>";//=====SUB//=======MENU my first thought was to use a if isset statement saying if a file was open, i did try search on google and other few forums/places, but without luck.. any ideas would be awsome!
  10. dedi

    upload many files

    I want to upload multiple files only with php.for example like my picture.when pressing the Add button, the file appears under the Add button.and after selecting a file, press the update button when the data is saved to the database.I want your help.I was confused to find references to complete my work.thank you
  11. Hi all, My task is when user upload the data by excel file it should save into database, present i have done this concept with CSV file but i don't know that how to convert the excel file to CSV format please anybody can help me........
  12. jrppse7en

    VBScript

    Hey guys. Hope everyone here had a great 4th of July holiday! I am building an internal site that of course is only accessible via intranet. Its primary coding is very simple. Its HTML based with some Javascript and some VBScript. I will be honest. I am not an expert programmer by any means. So here is the issue. We have no access to the server logs as we do not admin the logs nor are we allowed to request them. We are basically borrowing the space. My management wants to have each page, when accessed or clicked on (either one) to log the hit to a csv file and a txt file saved on the server. I know a lot of people dont think VBScript is the way to go. This is what is needed in each column in the log: Date\Time stamp \ Hostname \ NT Login \ Page that was loaded We are in a Windows XP\7 Environment. We know this server supports IIS. We are also currently using SSI for our DHMTL menu. I was hoping someone could help me use the DHTML menu as an "onclick" so that any option clicked on the menu by the client would log the above information to a specific file. We are very limited on the access we have on the server. I am not very skilled in VBS at all and this is simply a last minute side project they want to test out. So if someone could help me with this that would be excellent. Thank you in advance.
  13. so I've figured out how to read an array and place it into a file with a single array...$matrix[10] and have it save onto a file all of the data with a new line per databut it gets kind of unnecessary and messy, however it's still readable. When it comes to $matrix[10][10] it becomes UNREADABLE, basically what I do isrun it through [0][0-10] and then [1][0-10] etc until its done all the values which isfine because its reparsable but for convenience I want it so I can quickly edit the numberson the txt file. ex:1,1,2,3,5,6,7,2,4,62,4,5,6,7,8,5,3,1,3 instead of112356724624...etc I want some form of code that can easily parse onto a text file and read it, I haven't posted my code because I like to implement the code in myself to have it work efficiently Here's what I have tried which has...failed.. $matrix [10][10];if(isset($_POST['mapname'])){$file = fopen('file.txt', 'w');foreach($matrix as &$array){fwrite($file, $array ."\n". '');}} P.s. Excuse my informality, I've been quite stomped and I apologize for the lack of an introduction thread. Edit: Changed the first line, it was creating a syntax error
  14. dalawh

    Writing into a file

    I was wondering if there was any way to set a file to write to beginning? It seems I am only allowed to do one or the other. Is there an alternative to this?
  15. What is the difference between using the directory functions to change the directory and opening file as opposed to just opening the file straight? I am not sure if you can open a file in a different directory by using the directory function or not, so correct me if it is not possible. chdir("info/");$fileName="info.txt";$file=fopen($fileName,"r+"); VS $directory="info/";$fileName="info.txt";$file=fopen($directory.$fileName,"r+"); If we use the first, how do we change back to the previous directory? If both is possible, which is the better method? Outside of opening files, which is better? Using strings or directory functions?
×
×
  • Create New...