HTML - Web Page Creating Input File For Python Calculation
Hello All,
I am new to this, and not sure if this is the right forum. But, I have a simple web page with drop down menus where I can put values for a calculation. I would like to have the values saved as an input file for a python script that resides on the server. I would like the input file to be created and then the script executed and the output appear as a new page. I have googled this and have come up empty. Can someone point me in the right direction. Thanks, Bryan Similar Tutorialsok people this is what i'm trying to do i have html.. calls cgi ..(using python).. through cgi i wanna be able to display a file back on html this is what i'm trying print '''<button type="button" onclick='window.location.href="file.txt"'>new</button>''' so basically on click i want it to display contentts of file.txt.. just not happening path and all is correct another thing.. without cgi.. just in windows and notepad this works fine.. i feel it can't be a cgi problem as other variables and all are getting printed fine through cgi back on html thanks in advance for your help Following proper new-person-at-a-forum etiquette, I've searched for an answer to my question in the archives, and have been unable to find one. So, here goes. My webapp is uses a bit of asynchronous Javascript and CGI to allow users to change parameters in a serverside povray script (say, colors, positions, textures, etc) to allow users to create custom car designs. The server renders the images realtime and sends them back to the client's browser. What should be the hard part (all of this asynchronous javascript and CGI stuff), I'm having no trouble with. I am having trouble, however, with the scrollbar inputs needed for moving things around (without making users have to type in coordinates). I attempted to do my scrollbars with overflowing DIVs, such as: <DIV CLASS="scrollbar" STYLE="width: 230px;" ID="frequency_scroll" onScroll="change_scroll('frequency', 0, 50, 2, true);"><DIV STYLE="width: 2000px;"> </DIV></DIV> Where class scrollbar is: .scrollbar { overflow: auto; overflow-x: scroll; overflow-y: hidden; font-size: 11px; margin-top: -6px; } To break it down, we're creating an outer div that forces a horizontal scrollbar, and an inner div that makes it wide enough that you can actually scroll it. There are several hacks in this code trying to minimize the annoying phenominon that I can't seem to get around: spacing between scrollbars. I've been testing in two versions of firefox for Linux, one older and one newer, although eventually I'm going to need this to be crossplatform. If I leave out the nbsp in the inner div, in one version of firefox, the scrollbars vanish altogether; it seems to insist that there be content inside. When there is content, however, the scrollbar shifts down on the page significantly to make room for the line with the nbsp, making the scrollbars very spread out and the page very long. My first solution was margin-top: -20px in the scrollbar div; however, the invisible spot it reserves for the line that has the nbsp in it prevents you from accessing the scrollbar above it (and z-indices don't seem to make it accessible). Only the bottommost scrollbar in a group works when you do that, as it's the only one that doesn't have an invisible line of text blocking it. I tried javascript to prevent the user from getting focus on the invisible line, but that didn't help. I then tried shrinking the font size down, hoping the height occupied by the invisible line would shrink. Unfortunately, when you drop the font size below the height of the scrollbar, the scrollbar disappears for some reason, and there seems to be nothing I can do to force it to stay. I've also tried alternatives, such as scaled invisible images inside the scrollbar div; no luck. Firefox seems to simply refuse to draw the scrollbar on the div unless it can have an invisible area above it of equal or greater size in comparison to the scrollbar itself. The above code -- a font size of 11px and a margin-top of -6 -- seems the closest I can space the bars (about one scrollbar's height between each of them) I'm trying to figure out what my options are here, and right now, all I'm seeing as possibiltiies is to write my own code in Javascript to generate scrollbars made of inset/outset DIVs and lots of mouse event captures. And I have a feeling that will get ugly. Anyone have any ideas? The following common code is not working in Firefox (3.0.11). It works in Safari (4.02) and IE7. When I say not working, I mean that when I click the submit button, the address does not change to the form processing url: Code: <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="mp3file" type="file" /> <input type="submit" name="submit" value="Send File" /> </form> The file uploader.php does nothing, it is blank, I'm merely trying to establish communication. Once again, the code functions in IE and Safari so I dont think this is PHP related. Hi guys, this is my first post an ive only started to use HTML, PHP and mySQL so here goes. The problem I am having is that i want a single line table to duplicate more lines of code when an onClick button is pressed. it basically goes Staff name Wage hours worked I:::::::I I:::::::::::::I I:::::::::::::::::I IButtonI When the button is pressed i want the form table to change to Staff name Wage hours worked I:::::::I I:::::::::::::I I:::::::::::::::::I I:::::::I I:::::::::::::I I:::::::::::::::::I IButtonI and so on. I am storing staff name etc as an array so i can easily calculate totals. Is there a way to do this dynamically without having to show / hide or else using DOM? Any help appreciated! 0 Answers Posted ( Reply | Quote ) Unsubscribe I have a project written in ASP.NET under Visual Studio 2005 with C#. I am also using Infragistics objects for .NET Advantage 2007. In my page to attach resources to a record I have written a browser and am displaying previously chosen resources here. But when I click the upload button the page opens a new window (which is not a dialog window, but a normal one) which is exactly the same as my dialog window. How can this possibly happen? Can anyone help me? html is there.. calling cgi.. from cgi i'm printing values back in html.. i'm printing a table sort of ting i want it to appear that it is auto refreshing with every iteration in the loop how do i go about it ? assume text color =black, background=white one way i thought was to print the data ..change the text color to white, re print, .. data changes (iteration) then again change text color back to black, then again print.. and so on not able to implement this okay guys.. got a html page with forms and all.. sending all that data to a script using cgi.. in my cgi i call a python program that uses these variables and does some work. that program finally returns a variable back to the cgi script i'm trying to print that value back in the html page.. i just getting a blank page in my cgi before i call the python script i have some standard print commands .. that is also not getting printed.. i've given the print "content type" and all that before.. i was having problems calling th python script.. that time the printing from cgi was working. your help would be greatly appreciated guys thanks in advance I am programming cgi with python I need help, i am using windows, and whenever I save a script as somescript.cgi, It doesn't recognize the file and when I try to open it as a web page it just displays the text I am puting #!C:\Python25\python.exe before every script but it is not working, I need Help! Thank You -HTMLMW Ok, I'm in the process of creating a file explorer using 2 cgi scripts and one html file. The html file creates 2 frames, and calls 1 of the cgi scripts in each frame. The cgi scripts are written in python and html code. What I want I need to do is be able to click on a directory in the left frame and it opens it up in the right frame, while also opening the directory up in the left frame. Now link is dynamic seing as there are several directories. So I want to make it so that when I click on the directory link, it opens two links, modifying both frames. So I tried adding this underlined code in my code in the script that is called in the left frame: frame2 is the name of the second frame. #!/usr/bin/python print "Content-type: text/html\n\n" import re,os,sys def arbre(repertoire): liste=os.listdir(repertoire) print "<html>" +str(sys.argv[1])+ "<html>" for fichier in liste: if os.path.isdir(repertoire+"/"+fichier): print "<html>" "<div style='position:relative; top:15; width:500; height:20;'>" "<a href='http://localhost/cgi-bin/liste.cgi?"+str(sys.argv[1])+"/"+str(fichier)+"' onClick='parent.frame2.location.href='http://localhost/cgi-bin/contenu.cgi?"+str(sys.argv[1])+"/"+str(fichier)+"'>" "<img src='http://localhost/apache2-default/repertoire.gif' width='25' height='25' alt='blarr' align=left border=no>" "</img>" "</a>" "<h5>" ,fichier, "</h5>" "</div>" "</html>" arbre(sys.argv[1]) This does not work, the left frame(frame1) works the same, but the second frame is not modified, help please? This might you give you a better idea of what I'm talking about: Hello there, I have one question for you. How do you input data to file using plain html (or maybe java if necessary). I have a website in a free server, which won't let me use php and mysql (I wouldn't post here if it would ) I need to make a newsletter with a single option, just to input your email address, everything else will be handled manualy. I suppose it's either impossible or it's the most primitive script ever So, any help would be really appreciated. Thanks in advance. With the html tag <input type="file"/> is it possible to specify the folder which opens to select files from. I would like the pictures folder to open instead of the system root folder. I am a newbie and need your help creating a webpage displaying names with the address.the height and width of the table should be 120 pixels.The border thickness be 5 pixels,border color red and bkground grey. Pls Help Any idea why the "theuploadedfile" input is not displayed when the program comes in after the submit ? PHP Code: <?php print 'Post=<pre>'; print_r($_POST);print '</pre>'; // PROBLEM $_POST['theuploadedfile'] IS NOT DISPLAYED (the text one is) ?> <form enctype="multipart/form-data" action="<?php print $_SERVER['PHP_SELF']; ?>" method="post"> <br>File to upload <input name="status" type="hidden" value="submitted"> <br>A<input name="thetexttype" type="text" size="100"> <br>B<input name="theuploadedfile" type="file" size="100" > <br><input name="submit" type="submit"> </form> Hi guys, I'm trying to create a form which uploads an image from the user and saves it in the database. However with the code I have so far it seems the input isn't working. Any help would be appreciated. This is what I have: <html> <head><title>Store image into SQL Database</title></head> <body> PHP Code: <?php if ($_POST[submit]) { include("connect.php"); $data = addslashes(fread(fopen($_POST[form_data], "r"), filesize($_POST[form_data]))); $result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ". "VALUES ('$_POST[form_description]','$_POST[data]','$_POST[form_data_name]','$_POST[form_data_size]','$_POST[form_data_type]')"); $id= mysql_insert_id(); MYSQL_CLOSE(); } else { ?> HTML Code: <form method="post" action="imageupload.php" enctype="multipart/form-data"> File Description:<br> <input type="text" name="form_description" size="40"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <br>File to upload/store in database:<br> <input type="file" name="form_data" size="40"> <p><input type="submit" name="submit" value="submit"> </form> <?php } ?> </body> </html> Hi, i'm an expereinced PC user, and am just getting into web design, thought you could help. I've got the basics of a website developed, i just need to get the difficult bits done now...just! I've split it up into two points... a) Basically I want users to add a page that I haven't got on my site, (for example, if my website was about bands, one could fill in a form with the title of the band and a few pieces of info. and then that information is taken and a page is created (the page has standard information the same as the rest of the pages, but the details the user entered are on the page)). b) Secondly I want to add to a page a text box one can type into, click submit (basically a review) and that typing be added to that page. I'm assuming some sort of database would be required, but im really not sure how to go about it. Any help would be great Many thanks I am Class Vth Student and need your help in designing the html page .I need to create a webpage displaying different names with addresses.the height and width of table should be of 120 pixel.border thickness is 5 pixel.border shud be red in color and bkground shud be grey. I dont know where to post this and i searched and couldnt find it but can anyone help me.. im creating a webpage using dreamweaver cs3 and i need to password protect a page, using a username and password, can this be done any other way besides php? If so how can i do it? I am working on a site that will allow the user to print out a contract. However, the customer wants a way to scan the contract in and allow their OCR software to pick up the contract # and automatically store the image. I have the peice working where I have a web page display then a printable version. However, how can I ensure that the printable version always puts the data that will be OCR'd in the same spot? Is there some sort of absolute positioning that I can use? Also, I can foresee a potential problem with this with regards to different browsers and different printer settings. I just don't know what those problems might be. I'm fairly new to html, so if it's something obvious, give me a break. I have a background image with blank sections where I want to put stuff in to, and in one of the sections I want to put a frame or a table so I can have a list of links which you can scroll through, but I don't know how to put it anywhere I want on the page. Any help would be great, thanks. |