Adobe Dreamweaver Forums



Last 10 THreads :         Unable to create SWC in Flash CS4 (Last Post : nrajbhan - Replies : 1 - Views : 2 )           »          Flash CS4 External Lirbrary (Last Post : nrajbhan - Replies : 1 - Views : 2 )           »          Opening different Flash Galleries with differentlinks... (Last Post : Nancy O - Replies : 8 - Views : 9 )           »          Favicon for context-sensitive Help (WebHelp) (Last Post : LuckyClover - Replies : 5 - Views : 6 )           »          Re: Help authenticating installer (Last Post : scarletnew - Replies : 2 - Views : 5 )           »          unlinking shared assets (Last Post : dmodie - Replies : 0 - Views : 1 )           »          Spry Accordion Panel Default State All Closed? (Last Post : Steven_K - Replies : 2 - Views : 3 )           »          Re: export image in D11 (Last Post : Applied CD - Replies : 0 - Views : 1 )           »          Re: Adobe Capture?? (Last Post : CatBandit - Replies : 0 - Views : 1 )           »          catching errors from remotely invoked processes (Last Post : Cr99 - Replies : 2 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags:



Reply
  #11 (permalink)  
Old 10-01-2008, 01:49 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

You have this in test.php -

$target_path = $_GET['uploadfile'];

That implies that the page calling test.php is passing 'uploadfile' as a URL
variable. But it isn't.

<form id="form1" name="form1" enctype="multipart/form-data" method="post"
action="test.php">

Why wouldn't $target_path be the same as $uploadfile?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"taywanqi" <webforumsuser@macromedia.com> wrote in message
news:gam4sp$scm$1@forums.macromedia.com...
> Attached below is the code i used for my application:
>
> form.php
>
>
>
>
>
>
>
> <?php
> session_start();
> ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Untitled Document</title>
> <style type="text/css">
> <!--
> .style13 { color: #FFFFFF;
> font-family: Georgia, "Times New Roman", Times, serif;
> font-size: 14px;
> }
> -->
> </style>
> </head>
>
> <body>
> <form id="form1" name="form1" enctype="multipart/form-data" method="post"
> action="test.php">
> <p align="center">
> <input type="file" name="fileupload" id="fileupload" />
> <input type="hidden" name="csvfile" id="csvfile"/>
>
> </p>
> <p align="center">
> <input type="submit" name="upload" id="upload" value="Submit" />
> </p>
> </form>
> </body>
> </html>
>
>
> Test.php
>
> <?php
> session_start();
> echo $name;
> ob_start();
> ?>
>
> <?php require_once('connection.php'); ?>
>
> <?php
>
> //UPLOADING FILE
> if(isset($_POST['upload']))
> {
>
> $uploaddir = 'uploads';
>
> $uploadfile = $uploaddir . basename($_FILES['fileupload']['name']);
>
> $target_path = $_GET['uploadfile'];
>
> echo $target_path;
>
> //$target_path = ini_get('$uploadfile');
>
> echo $file;
>
> echo '<pre>';
> if (move_uploaded_file($_FILES['fileupload']['tmp_name'], $uploadfile)) {
>
> echo "File is valid, and was successfully uploaded.\n";
>
> } else {
> echo "Possible file upload attack!\n";
> }
>
> echo 'Here is some more debugging info:';
> print_r($_FILES);
>
> print "</pre>";
> }
>
>
> $fcontents = $_SESSION[csvfile];
>
> for($i=0; $i<sizeof($fcontents); $i++) {
>
> $line = trim($fcontents[$i]);
> $arr = explode("\t", $line);
>
> echo $arr."<br>\n";
>
>
> }
>
> //ATTRIBUTES
> //$fieldseparator = ',';
> //$lineseparator = '\n';
>
> //READING OF FILE
> $csvfile = $uploaddir . basename($_FILES['fileupload']['name']);
>
> //TRUNCATE THE FILE BEFORE INSERTING IT INTO THE DATABASE
> mysql_select_db($database, $test);
> mysql_query("TRUNCATE TABLE timetable") or die("MySQL Error: " .
> mysql_error()); //Delete the existing rows
>
> //IMPORT CSV INTO DATABASE
> $lines = 0;
> $queries = "";
> $linearray = array();
> $fcontents = file($csvfile);
>
> for($i=0; $i<sizeof($fcontents); $i++) {
>
> $lines++;
>
> $line = trim($fcontents[$i]);
>
> $linearray = explode(',',$line);
>
> $linemysql = implode("','",$linearray); // convert the array to a string
>
> echo "$linemysql". "\n";
>
> //$query = "INSERT INTO timetable values('$linemysql')";//Insert query to
> insert values into the database
> $query = 'LOAD DATA INFILE "$target_path" REPLACE
> INTO TABLE timetable
> FIELDS TERMINATED BY ","
> OPTIONALLY ENCLOSED BY """"
> LINES TERMINATED BY "\r\n"';
>
> mysql_query($query, $test) or die('SQL ERROR:'.mysql_error()); //Insert
> in
> the new values into the database
>
> }
>
> ?>
>
> </head>
> <body>
> </body>
> </html>
> <?php ob_flush(); ?>
>


Reply With Quote
Sponsored Links
  #12 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

I already tried that, and i always have this error:

ERROR:File 'c:\wamp\bin\mysql\mysql5.0.45\data\$uploadfile' . Somehow they
cant detect the file path even though is specified in the top part of the code

Reply With Quote


  #13 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

I already tried that, and i always have this error:

ERROR:File 'c:\wamp\bin\mysql\mysql5.0.45\data\$uploadfile' . Somehow they
cant detect the file path even though is specified in the top part of the code

Reply With Quote
  #14 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

Hi, good news! I managed to solve the problem. Turns out that the bug was the connotation of the variable. Thanks a lot for your help!!
Reply With Quote
  #15 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

Hi, good news! I managed to solve the problem. Turns out that the bug was the connotation of the variable. Thanks a lot for your help!!
Reply With Quote


  #16 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

Hi, good news! I managed to solve the problem. Turns out that the bug was the connotation of the variable. Thanks a lot for your help!!
Reply With Quote
  #17 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

Hi, good news! I managed to solve the problem. Turns out that the bug was the connotation of the variable. Thanks a lot for your help!!
Reply With Quote
  #18 (permalink)  
Old 10-01-2008, 01:49 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

The connotation of the variable?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"taywanqi" <webforumsuser@macromedia.com> wrote in message
news:gan6qk$577$1@forums.macromedia.com...
> Hi, good news! I managed to solve the problem. Turns out that the bug was
> the connotation of the variable. Thanks a lot for your help!!


Reply With Quote


  #19 (permalink)  
Old 10-01-2008, 01:49 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

The connotation of the variable?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"taywanqi" <webforumsuser@macromedia.com> wrote in message
news:gan6qk$577$1@forums.macromedia.com...
> Hi, good news! I managed to solve the problem. Turns out that the bug was
> the connotation of the variable. Thanks a lot for your help!!


Reply With Quote
  #20 (permalink)  
Old 10-01-2008, 01:49 PM
taywanqi
 
Posts: n/a
Diggs:
Default Re: Passing from data from one page to another

Something like this"

"'.$uploadfile.'"
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:53 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk