Jump to content

Ender22

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Ender22's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the advice guys... It is only 3 xml files total for each user... but yes it still doesn't scale very well. All of my software is already set up to be used with XML so I think I'll take Thorpe's first suggest and just dynamically generate the xml with php then read it into as3 directly. As far as saving information after the swf is finished... (if i was lazy and didnt want to rewrite everything yet) is it possible to store the entire xml code into a database variable before using php to generate the xml? like the entire <thingGroup> <thing> <value1> </value1> <value2> </value2> </thing> </thingGroup> into mysql? Or will I run into problems?
  2. Hey thanks for the help, Just to make sure I understand. Usually the variables are stored in the database, then the xml is generated on the fly once the page loads for each user? So if I use php to create an xml file like suggested, where is a good place to store it on the server before passing it into the swf? And what's a good way to make sure it is accessible by that user and just that user? I actually have my flash generating the xml data already because things are saved from within the swf files... I guess I would rather just use the xml that is already being generated either by storing it all into a mysql variable (if that's possible) or just saving and accessing a physical xml file. I really think the easiest thing would be just to have a couple xml files created for each user stored on the server and then just access them by their filename with mysql when they load the swf files... is that a bad idea for any reason? Or is this okay to try?
  3. Hello everyone. I'm about to code my new website, but I would love to get an opinion from the more experienced out there on how to go about it first. My website will be PHP MySQL based and have multiple users. The users can play different flash files on the site and the flash content will be different depending on different values that are passed into the flash files. As of now I am passing in xml files to the Flash swf's, and I would love to keep it this way as it works great for what I am doing. My question is... what is the best way to give each one of my users their own xml files. (I need 3-5 xml's for each). Should I try to store the xml inside the mysql database then extract it? Should I create an xml file for each user on my server then just put filename variables into the mysql database? Do I need a content managment system (haven't used one of these before). How would you more experienced coders go about this setup? Any advice is much appreciated.
  4. Yep I checked the values in PHP my admin and it shows that the output is correct. This might help: I tried updating it like this by dividing the amount of points given once: UPDATE epiclink SET EpicPoints = EpicPoints + ($votes/2) WHERE ID=$whatever When I did this and I inputted a vote of 3 it gave me 2 points. So it took 3/2=1 + 3/2=1. Therefore it appears the update is being done twice, however that shouldnt be possible as I said above, I outputted an Alert, and the alert only gets called once.
  5. Thanks for that method, however the same issue still occurs. Its still working fine locally but double the votes are being counted when the site is running on the net. any other ideas?
  6. ??? I have one of those problems where my code works perfectly on my localhost, however when I upload it to my webhoster something very strange and unexplainable happens. Its quite the mystery that has been racking my brain all day. Heres whats going on. My Code: if($canvote) { $rating = $row_Recordset1['EpicPoints']; $rating+=$vote; $t = "UPDATE epiclink SET EpicPoints = $rating WHERE ID=$colname_Recordset1"; mysql_query($t, $EpicDatabase) or die('Error, query failed'); } Now on my localhost this code grabs the entry's current Epic Points in $rating, ads in the value for $vote and updates properly. On my webhost it does the same except it adds double the points Now obviously my first guess was that this code is getting executed twice. This doesnt seem to be the case as I added an alert("going here") and tested it out. The alert was only ever called once. Another possibility is that $rating is getting calculated improperly before the update is being called. But I did an alert($rating) and verified that the value is correct. Some additional info. To vote, users click an image on the page, which refreshes the page and passes in ?Vote=5 to the url. My php grabs this variable checks if the user can vote, and if they can the above is executed. One I click the link once I dont do anything! (to make sure im not causing something else to happen) and I check my database, and indeed double the points are added instantly. Now normally this would probably be a stupid logic mistake somewhere on my part, but I want to repeat that this works perfectly on localhost, only when uploaded to the webhost it messes up. As far as I know the only difference should be various PHP settings and stuff like that which my webhost uses. Any ideas on what could be causing this? If you can figure it out in my mind you will be an official PHP genius.
  7. Thanks for the post. Yep that makes the submit buttons link to the correct page, however it doesnt solve the problem of my hidden form variables not being sent to the new pages. Back when I only linked to a single page, I had my form action=AddLink.php which linked me to the correct page, and passed the form variables. But now when I navigate to the new pages using the headers command (because I cant use the form action thing to link to different pages) the hidden form variables are no longer sent. any ideas?
  8. Hey guys, Ive been trying to figure something out for a bit and im a little stuck on it. I have a page with a form that on-submission passes the values of 2 hidden fields to the next page. Now however, I want to give the user a choice between 2 pages to go to, but im having trouble finding a way to pass the hidden fields to either of the 2 pages. Right now im trying to use 2 submit buttons to do this, each one linkining to one of the 2 possible pages. Then I use the code: if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "insertGuide")) { if (isset($_POST['Link'])) { $insertGoTo = "AddLink.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } else if (isset($_POST['Upload'])) { $insertGoTo = "AddUpload.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } } to check which submit button the user has pressed. This works fine for allowing the user to choose which page to go to, however the hidden field data that used to get passed no longer gets sent. I think because my form is not directly linking to the new pages, when the form is submitted it simply comes back to the current page, and the hidden field data does not get sent after the header command is called. There must be a better way to do this, because it seems like a fairly common thing that may need to be done. Can anyone help me out with this?
  9. Hey... This seems to be something incredibly easy, but I have tried the sample scripts from many sites and I cant get any of them to send an email from my php page. Heres the code im using. <?php $to = 'oneOfMyEmails@gmail.com'; $subject = 'the subject'; $from = 'anotherOneOfMyEmails@hotmail.com'; $message = 'hello'; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent"; // this never gets called else echo "Mail send failure - message not sent"; // this error always happens ?> Is there some setting in php.ini file or something I need to change? Also im sure the emails are not being sent to my junk folder or anything else, I have checked... but the else (Mail send failure) statement is always executed so the emails are not sending at all. :-\ this should be easy... right??? any help is greatly appreciated!
  10. Hey, I need a little help here. I'll try to explain what im trying to do as best as I can. I have a repeated region with a 'Name' a 'ID' and a 'Submit' button Repeated Region ------------------------------------------------ {Recordset1.Name}, {Recordset1.ID} | SUBMIT | ------------------------------------------------ so on my page I see every name next to every ID in my database and each one has their own submit button. Now what I need to do is on Submit pass the specific ID of the row in the table for which the submit button was pressed. For example if they scroll down to the 5 element in the repeated region (with ID 5) and they hit Submit I need to pass the number 5 to a function. I understand that you cant call a php function from a button press so I have been trying to do this with the if(isset($_POST['submit'])) { // do whatever with the variable. } statement. Does anyone know how I can do this properly? THANKS!
  11. Hello! Thanks for taking the time to read my post. Im working on a project with PHP that allows users to upload pictures to my server and then reference them. After going through some uploading tutorials I have the uploading part working Except! I cant upload folders to my remote root folder. I need to allow the users to upload somewhere inside the root folder so they can reference the pictures in code after. Just to clarify the uploading works perfectly if I put the uploads folder anywhere on my computer except the sites remote root folder (or anywhere inside the root folder) I also beleive I am giving the folder all of the proper permissions because I am giving the uploads folder in my root directory (the one that doesnt work) the same permissions as the one outside the root (the one that works) Here is a specific example with my code of the problem. My html file containing the form: <form enctype="multipart/form-data" action="uploader.php" method="POST"> <div align="center"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Please choose a file to upload: <input name="uploadedfile" type="file" /> <input name="submit" type="submit" value="Upload File" /> <br /> </div> </form> which is directory to uploader.php page with code: <?php // $target_path = "/uploads/"; // this path doesnt work // $target_path = "C:/Inetpub/wwwroot/GetPHPToWork/uploads/" // this path also doesnt work $target_path = "C:/Inetpub/uploads/"; // this path or any other path with permissions on my computer works! $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo " The file has been uploaded "; } else { echo "There was an error uploading the file, please try again!"; } ?> by the way my remote directory folder is: "C:\Inetpub\wwwroot\GetPHPToWork\" when my target path is: $target_path = "/uploads/"; $target_path = "C:/Inetpub/wwwroot/GetPHPToWork/uploads/" ] I get my php echo "There was an error uploading the file, please try again!"; but if the path is $target_path = "C:/Inetpub/uploads/" it works perfectly. here is my upload settings in php.ini incase you want to see them: ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = C:/PHP/uploadtemp/ ; Maximum allowed size for uploaded files. upload_max_filesize = 20M Im not sure why I cant upload to the folder I want... ??? any help is greatly appreciated! Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.