masterjiraya -3

okay lets test this.
does the submit button working to you processor.php?

if it is then on the beggining of you processor.php's php code, initialize this variable and print the array using print_r function it

print_r($_POST['selected_answers']);

by using this function we have to verify that there are values inserted to selected_answers array name.
kindly tell me if an error ascends to this code.

masterjiraya -3

in difference with $_SERVER['PHP_SELF'] with a predefined file. $_SERVER['PHP_SELF'] is used only for self page call refresh which is working only one form per html. unlike your predefined file, you can cast multiple forms in one HTML.

Please remove your "<" in your action attribute. what was inside the action attribute will be considered a character part of the filename if and only if it is not $_SERVER['PHP_SELF']

masterjiraya -3

FYI in using form action which $_SERVER['PHP_SELF'], you dont need to create a new page file unless this web page has multiple forms on one page.

masterjiraya -3

every on call of select tag's selected_answers[] it will have a value in an array.

masterjiraya -3

since you have processor.php, kindly replace the form tag into
<form action="processor.php" method="POST">

masterjiraya -3

before your closing form place this
<input type="submit" value="Submit Answers">&nbsp <input type="reset" value ="Clear Answers">

masterjiraya -3

this part on was based on displaying your text file to HTML

modifying your HTML by inserting
after opening body tag place this:
<form action="<?php htmlspecialchars($_SERVER['PHP_SELF']);?>" method="POST">

look for your code block which has foreach($qas as $k=>$v)
block and edit it into this:

foreach($qas as $k=>$v){
echo "<label>".$v['question']."</label><br/>";
echo "<select name='selected_answers'>";
foreach($v['answers'] as $answer){
echo "<option value='".$answer."'>".$answer."</option>";
}
echo "</select>";
echo "<br/><br/>";
}

before your body closes, place this:
</form>

masterjiraya -3

<?php 
// Default movie 
$movie = 'myip/movie/movie1.mov'; 
// pretend movie is the param passed to the php script 
if(isset($_GET['movie'])) 
{ 
    // do your query to get the proper movie 
    // for $_GET['movie'] from your database 
    $movie = result_from_my_database_for($_GET['movie']); 
} 

header('Content-type: application/x-rtsp-tunnelled'); 
readfile('rtsp://'.$movie); 
?>

that is my sample but can you explain to me where the file is stored?

masterjiraya -3

no you cannot do it that way
you need to perform ajax at the same time

masterjiraya -3

you can also look for jQuery Chatbox in google this is similar to the chatbox of facebook. you can maniulate it's design as well.

masterjiraya -3

Can I give you some additional advice? You said you are trying to save table to table as foreign key right?

So why don't you try to normalize the database since the connector is staffId why dont you use left join functions? It will make it short and faster in computation of the database.

masterjiraya -3

pixelsoul and pritaeas comments are both true. well there's one trick, PHP's exec() can execute exe files, lebian files, Jar files, and Mac OS' executubale file. those that are made of program. Not Media type files.

one trick here is to download the executable file then run the PHP script, if and only if it is a server based application. if want to make the application wider which is world wide web, then install the executable file in the web server or just save it then put all the scripts on the server. make sure that the scripts and the executable files are on the same root folder, otherwise it will fail.

masterjiraya -3

oh my oh my, your code 6.$sql = "INSERT INTO order SET username='$username', warranty='$warranty', delivery='$delivery', price='$price'";
echo that line so you can see why.
at a first glance you mistaken or should I say forgot to initialize the values of the variables $username, $warranty, $delivery and $price.

since you did not initialize the value of the variable then it is set to default as null or whitespace or ''(empty string)

masterjiraya -3

there are pros and cons in php and ASP.NET

For PHP-(Pros)
1.)opensource-not necessarily saying that it's free no matter what website are you planning. Just a matter of paying expenses for the server.
2.)accurate report of error-very readable and easy to understand.
3.)easy to manipulate functions-you can undertand fast on why is the structure of the function is in that way.
For PHP-(Cons)
1.)text based(non-compiled)-easy to get a copy and hack it (having SSL will get some more money out of your pocket)
2.)Security- though it is a server based issue, the hacker might use the script alone
3.)NO Faq's- help for you will be from other people or other website souces.

For ASP.NET-Pros
1.)Compiled program- like VB.NET, C#.NET and other.NET programming softwares, they have compiled executable file. so you dont need to give to the server the text file program... But, it will give you more pain your head for losing alot of money in your bank.
2.)Security- since it is paid mandatory, you can have higher security.
3.)FAQ's-online/offline FAQ's come in very handy.
For ASP.NET-(Cons)
1.)Licensed- Withdraw more of your money out of the bank.
2.)inaccurate report of error- very delicious spaghetti, you cannot detect the error very easy.
3.)very hard to apply functions structures-case sensitive, mostlikely based on the behavioral programming structure of Java. Needs to call libraries before doing the function's actions.

masterjiraya -3

now I would like to tell you how was octet-stream programming in php level do for you.

"Content-type: application/octet-stream" is the one you called for root.htacces to access all octet-streams for streaming and download media files.
"Content-disposition:attachment; filename=\"$path\"\n" is the one used for calling octet-stream files to assign it only as attachment type by the syntax of Content-disposition:attachment;

if you want only for streaming, then it will be Content-disposition:stream; otherwise do not type the 3rd line I gave you.

fopen() is needed as always if you have Content-disposition:attachement; it will be default as zip file or compressed file.
fpassthru() is needed once you have fopen() and Content-disposition:attachement;

masterjiraya -3

if it doesn't have try to force it on php level to undertstand these code snippet I gave you. read for the topic in PHP website called header("Content-type: application/octet-stream"); <-- this is the key you need to force download any files just like the code below:

<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$path\"\n");
$fp=fopen("$path", "r");
fpassthru($fp);
?>

your foundation of octet streaminmg has now triggered in $_FILES

masterjiraya -3

I'm sorry for the late reply because of our different time zone.
Ok that's great. the problem right now is the server configuration. if it is localhost, try this

find the root.htaccess on your localhost folder add this

`<Files *.mp3>
ForceType application/octet-stream
Header set Content-Disposition attachment

<Files *.ogg>
ForceType application/octet-stream
Header set Content-Disposition attachment

<Files *.avi>
ForceType application/octet-stream
Header set Content-Disposition attachment
`

AddType application/octet-stream mp3
AddType application/octet-stream ogg
AddType application/octet-stream avi

masterjiraya -3

greetings mr. Sandeepek,

I would like to answer your question in a weel step by step manner.

things you need to consider:

Do not store files directly to the database because it will be heavy for the database. store the files to a folder where the file path along with the file name is stored in the database and not the file itself.

$_FILES is an array function that's why there is square brackets.

enumerating the commonly used $_Files array indexes.
1.) File name
2.) File type
3.) File weight
4.) File protection <--chmod

Now for your question of storing the file in the database is getting the file name. the file path is set by default to your deserved location in this manner it will be something like

$path="myLocation\".$FILES['name'];

in the output it will be myLocation\file.mp3

this will be the one to be used in anchor tag. so you can able to download it with out time trafficking

masterjiraya -3

this is your code

$user=$_POST['uname'];
    $pwd=$_POST['password'];
    session_start();
    session_register("user");
    if(!isset($_POST['user']))
    {
    $_SESSION['user'] = $user;
    $_SESSION['pwd'] = $pwd;
    }

this is the shorter one

    session_start();
    $user=$_SESSION['uname'];
    $pwd=$_SESSION['password'];
    // you don't need this anymore "session_register("user");"
    if(empty($_SESSION['uname']))
    {
    echo $uname = $_POST['uname']; //i echo it for checking
    echo $pwd = $_POST['password']; //i echo it for checking
    }

in your code there an obstacle in my mind. where does $_SESSION['pwd'] = $pwd; came from? your $_SESSION['pwd'] does came out of nowhere. inside the If block I echoed the $uname which equivalent to $_SESSION['uname'] and $pwd which is equivalent to $_SESSION['password'] just for checking.

SESSION variables can either handle $_POST, $_GET, $_FILES. That's the fact. so in quivalent, session could be any one of the three.

as the next one which is below....

<?php
    session_start();
    session_unset();
    session_destroy();
    header('Location: index.html');
    exit();
    ?>

try this one

<?php
session_start();
//remove session_unset(), session_destroy is higher than session_unset();
session_destroy();
header('Location: index.html');
//there's no such function as this "exit();"
?>

it does not matter if index file name is of file type html or php.

masterjiraya -3

things to consider for doing that project IPv4 and IPv6 should be dynamic and not static. Scripting the microphone port to IPv4 and then scripting the speakers for IPv6. then PING them both dynamically at the same time. The Jitter should be set by the server's ISP to nearly exact the same as PING. Other wise it will be having a poor sound and the voice will be sound like shattering.

masterjiraya -3

no.. it seems to be when the page loads through a submitted form before this action does it makes sense that an HTTP request is on process while it is having an action when a user submitted a form page. best example for this was Daniweb's registration or login page... after that it will do this script on the server similar to the one you posted above.

masterjiraya -3

since you just want to out put the image on screen try to add like this
[CODE=php]$pd_thumbnail = WEB_ROOT . '/images/product/' . $pd_thumbnail;[/CODE]

I wonder if it is something in the if($pd_thumbnail) itself has a valid value the way you want it

masterjiraya -3

hey may I know what's your purpose of including WEB_ROOT ?

because by default WEB_ROOT should be the web link and if you want to save it on a folder... you don't need already to include WEB_ROOT in your data path destination according to the regulations of IIS (Internet Information Services)

by the default demand as of PHP 3 or 4 it could be now saved this way

[CODE]$pd_thumbnail = 'images/product/' . $pd_thumbnail; // <---default file destination handler[/CODE]

or if you want to include WEB_ROOT... it should be this way
[CODE]
$pd_thumbnail = WEB_ROOT. '/images/product/' . $pd_thumbnail;[/CODE]

you may try either on of these code :)

masterjiraya -3 Junior Poster

when I try to access my phpMyAdmin. It occurs this error message.

[QUOTE]MySQL said:

1045 - Access denied for user 'root'@'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server[/QUOTE]
What should I do. I'm afraid I did something wrong here. I have wamp server as my serve and MySQL 5.1 as the database application program. please tell me what to do. My wamp server is 2.0