Ok quick question.....
right trying to create a datebase collection thingy in flash - all its gotta do is people enter their names, mobile & email and it writes it to a txt file - now have gotten the coding done for the flash part - i think!? basically on the submit button actions i have :
ok as you can prolly see the code just checks that they have filled all fields then takes them to next frame - now writing to the php file i aint to sure about as have never tried using php before what i have come up with is.....Code:on (release) { if (Name eq "") { _root.Status = "Please enter your name"; } else if (Mobile eq "") { _root.Status = "Please enter your Mobile Number"; } else if (Length(Mobile) < 11) { _root.Status = "Please enter a valid Mobile number"; } else if (Email eq "") { _root.Status = "Please enter you Email Address"; } else { Submit = "Yes"; NumHigh = 10; NumLow = 0; loadVariablesNum ("database.php", 0, "POST"); _root.Status = ""; gotoAndStop (2); } }
Code:<?php $Submit = $_POST["Submit"]; $Name = $_POST["Name"]; $Email = $_POST["Email"]; $Mobile = $_POST["Mobile"]; $NumLow = $_REQUEST["NumLow"]; $NumHigh = $_REQUEST["NumHigh"]; $Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name); $Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email); $Mobile = ereg_replace("[^0-9 ]", "", $Mobile); $Name = stripslashes($Name); $Email = stripslashes($Email); $Email = stripslashes($Mobile); // ################################################################################### // ########## Reading and Writing the new data to the GuestBook Database ############# if ($Submit == "Yes") { $filename = "database.txt"; $fp = fopen( $filename,"r"); $OldData = fread($fp, 80000); fclose( $fp ); $New = "$Input$OldData"; $fp = fopen( $filename,"w"); if(!$fp) die("&database=cannot write $filename ......&"); fwrite($fp, $New, 800000); fclose( $fp ); } ?>
right hopefully you get what i mean??? i have the permissions set to 777 on the guestbook.txt so it should be ok to write to!?
well any help you guys can provide will be much appriciated
v_Ln




Reply With Quote