I have a variable called score that holds a number from 1 to 10.
I want to pass this vaiable to a PHP script so that I can add it to a database.
How would I go about this.
I would like to avoid using XML as it is only one number I am sending.
Thanks :)
User Profile
Collapse
-
Pass avariable to PHP from flash
-
I think all my paths are correct. I have double shecked them.
I added a vector image to the layer that the images are on and it showed up.
I think now it is just taking forever to load the images.
My images sizes are 3kb to 34kb. I did not think that these would be too large?
I am testing locally with Apache2 PHP and MySQL. When I do the flash download simulation it downloads at a good speed.... -
I am loading the "swf" file to dreamweaver. When I press play it just shows the background. It wont load the images from the xml.
I checked the path to the swf and it seems to be correct.....
It runs fine when I test movie from within flash itself....Leave a comment:
-
Adding Flash gallery to dreamweaver
I have created a flash gallery that loads pics from a XML file. This is working perfectly when I test it in flash but when I add it to my dreamweaver page all that loads is the background????
Flash and XML are in the correct directory and getting no errors...just nothing but the background showing up....
Does anyone have any suggestions? -
Flash XML gallery
I have created a flash gallery that loads pics from a XML file. This is working perfectly when I test it in flash but when I add it to my dreamweaver page all that loads is the background????
Flash and XML are in the correct directory and getting no errors...just nothing but the background showing up....
Does anyone have any suggestions? -
I have this working now.
Here is the code I used:
[PHP]
$filenamepath .= "images.xml ";
$fp = fopen($filename path,'w');
$write = fwrite($fp,$xml _output);
echo $xml_output; [/PHP]
Thanks for your helpLeave a comment:
-
Thanks
I will have a look at doing it that way...
I have tried it using "file_put_conte nts"
But get this error:
Warning: file_put_conten ts(C://htdocs//PhotoABC//upload_test//Jordan) [function.file-put-contents]: failed to open stream: Permission denied in C:\htdocs\Photo ABC\xml.php on line 43
Could this have to do with permissions?
I have uploaded images and created folders...Leave a comment:
-
XML PHP MYSQL- Writing to a xml file
I have code written to generate xml data in PHP from my MySQL database. I can display this in my browser using "echo" but wbat I really want is to write this xml data to a seperate xml file so that I can have flash use it.
Here is my code:
[PHP]<?php require_once('C onnections/PhotoABC.php'); ?>
<?php
if (!isset($_SESSI ON)) {
session_start() ;
}
$sqluserid... -
This is fixed and working now
Thanks for all your help
Here is the working code
[PHP]$sql = "SELECT `user_id` FROM `user` WHERE `username` = '".$_SESSION['MM_Username']."'";
$queryresult = mysql_query($sq l)
or die (mysql_error()) ;
if (mysql_num_rows ($queryresult) > 0) {
$row=mysql_fetc h_assoc($queryr esult);
$userid=$row['user_id'];...Leave a comment:
-
I have been working on my code.
New Code
[PHP]$v=UPLOAD_DIR.$ _SESSION['MM_Username'].'/'.$now.$_SESSIO N['MM_Username'].'-'.$file;
//copy image to database
$sql = "SELECT `user_id` FROM `user` WHERE `username` = '".$_SESSION['MM_Username']."'";
$queryresult = mysql_query($sq l)
or die (mysql_error()) ;
if (mysql_num_rows ($queryresult) >...Leave a comment:
-
Sorry.
I have been using this line:
[PHP]$sql ="SELECT user_id FROM user WHERE username = '".$_SESSION['MM_Username']."'";[/PHP]
where I get user_id from the user DB WHERE username is equal to the the session username.
I understood that I was using this query to return user_id for the username logged in?
Sorry if I picked u up wrong.
That is why I didnt put the quotes...Leave a comment:
-
Yeah that was it.
[PHP]$v=UPLOAD_DIR.$ _SESSION['MM_Username'].'/'.$now.$_SESSIO N['MM_Username'].'-'.$file;
//copy image to database
$sql ="SELECT user_id FROM user WHERE username = '".$_SESSION['MM_Username']."'";
$queryresult = mysql_query($sq l)
or die (mysql_error()) ;
if (mysql_num_rows ($queryresult) > 0) {
$row=mysql_fetc h_assoc($queryr esult);...Leave a comment:
-
[PHP]$v=UPLOAD_DIR.$ _SESSION['MM_Username'].'/'.$now.$_SESSIO N['MM_Username'].'-'.$file;
//copy image to database
$sql = "SELECT user_id FROM user WHERE username = $_SESSION['MM_username']";
$queryresult = mysql_query($sq l)
or die (mysql_error()) ;
if (mysql_num_rows ($queryresult) > 0) {
$row=mysql_fetc h_assoc($queryr esult);
$userid=$row['user_id'];...Leave a comment:
-
Thank u again for your help....
This is my code now.
[PHP]$v=UPLOAD_DIR.$ _SESSION['MM_Username'].'/'.$now.$_SESSIO N['MM_Username'].'-'.$file;
//copy image to database
$resins=mysql_q uery("INSERT INTO gallery (user_id, image_name) VALUES ($Recordset1,'$ v'")
or die("Error in INSERT: ".mysql_error() );[/PHP]
What i have done is created a recordset...Leave a comment:
-
yeah I am getting myself confused.
How then do I get the name of the file that was just uploaded and renamed. I am at a loss really......Leave a comment:
-
Code as it is now
[PHP]<?php
//define constant for the maximum upload
define ('MAX_FILE_SIZE ', 100000);
if (array_key_exis ts('upload', $_POST)) {
//define constant for upload folder
define('UPLOAD_ DIR', 'C:\htdocs\Phot oABC\upload_tes t\\');
//replace any spaces with underscore
//also assign to simple variable
$file = str_replace(' ', '_', $_FILES['image']['name']);...Leave a comment:
-
[php]$sql = "SELECT 'user_id' FROM 'user' ";
$result = mysql_query($sq l) or die (mysql_error()) ;
$result=mysql_q uery("INSERT INTO gallery (user_id, image_name) VALUES ($result,$succe ss)"
or die("Error in INSERT: ".mysql_error() );[/php]
If u look at my code I am trying to create a recordset so that I can add the user_id to the database as well...and the name of my file is...Leave a comment:
-
Thanks for your reply.
I have tried this and still not having any luck.
I am just trying to save the name of the uploaded image into a database.
Any suggestions on how I might go about this?...Leave a comment:
-
This is my whole code:
[PHP]<?php require_once('C onnections/PhotoABC.php'); ?>
<?php
if (!function_exis ts("GetSQLValue String")) {
function GetSQLValueStri ng($theValue, $theType, $theDefinedValu e = "", $theNotDefinedV alue = "")
{
$theValue = get_magic_quote s_gpc() ? stripslashes($t heValue) : $theValue;
$theValue = function_exists ("mysql_real_es cape_string")...Leave a comment:
-
syntax error, unexpected T_STRING on INSERT command
I have uploaded a file and am now trying to store it in a DB. I am getting a "Parse error: syntax error, unexpected T_STRING" error on this line below:
[code=mysql]INSERT INTO gallery (user_id, image_name)
VALUES ($RecordsetUser ID, UPLOAD_DIR.$_SE SSION['MM_Username'].'/'.$now.$_SESSIO N['MM_Username'].'-'.$file);[/code]
Can anyone help?
No activity results to display
Show More
Leave a comment: