Jump to content

jokerbla

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jokerbla's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It's not really an option, but thanks. (allthough I wish I knew flash better) I came to the conclusion that I'll generate a code and send it through GET. Code will consist with imformation of the objects added on the "canvas" (which is another object - user selected background) and once saved, and reloaded, you can retrieve all the locations/coordinates. Still a picture would have been great. If anyone can still help, I'd appreciate it. edit: I must finish this assignment in 6 hours.
  2. I'm trying to do sort of like a web comics site where you make your own comic, add your own characters, text bubbles, backgrounds, etc. Problem is I have no idea how I could output that. Can I somehow make "a print screen out of whatever the browser returns" ?. Can anyone help?
  3. Sort of figured the above out. I have another question. How do I replace a character lets say " - " followed by a new line or a line break \n \t ? $file = preg_replace('/ [\'-\r\']|[\'-\n\'] /','',$file)); This doesn't seem to work.
  4. Hi, I'm doing a script that extracts words(only once, unique) from multiple text files (all in a folder). I've used regexp before, but I forgot the syntax for the patern. So far for extraction from one file I have: <?php $file = file_get_contents ('1.txt'); $patern= '???'; $sp = preg_split('/ /', preg_replace($patern,' ',$file)); $sp = array_unique($sp); What do I write at the patern? I need to replace all other characters(like :, "- ',' . )( "�' ) except letters, with spaces so I can later extract everything except space and write it down in another txt file.
  5. hi, I'm trying to install symphony framework and I need to run the php command. I have wamp installed and therefore the php command is not recognized. What changes do I have to make(and where) to run the php command from anywhere? Or where do I have to run it from? c:\> php lib\vendor\symfony\data\bin\symfony -V
  6. I seem to be having another problem with the UPDATE $sgvote = mysql_query("SELECT voted FROM vote") or die(mysql_error()); $row1 = mysql_fetch_array($sgvote); $voted = $row1['voted']; $sql="SELECT id FROM users"; $result=mysql_query($sql); $row = mysql_fetch_assoc($result); $newvoted = $row['id']; //echo $row['id']; $total = $voted." ".$newvoted; echo " voted: ".$voted; echo " newvoted: ".$newvoted; echo " total: ".$total; $update = mysql_query("UPDATE vote SET voted=$total"); I want to make a list with the ids (that have voted), each id separated by space $voted is 1, $newvoted is 1 $total is "1 1" cause the id that voted was 1 and initially the field was set by me to 1 So each time someone votes it's supposed to get it's id. Problem is it always stays at "1 1", when it's supposed to add " 1" each time someone votes. What am I doing wrong?
  7. I have a table with 3 fields, one of which is primary, auto-increment, like an id. How do I select the id? ... $sql="SELECT * FROM users WHERE username='$un' and password='$pw'"; $result=mysql_query($sql); $count=mysql_num_rows($result); $_SESSION["id"]=$id; ... that didn't work
  8. This doesn't work either. :-\ <script type="text/javascript"> var average=<?php echo($average) ?>; </script>
  9. <script type="text/javascript"> <-- <?php echo ("average = $average;"); ?> // --> document.write(average); document.write("average"); </script> I want to transfer the $average from PHP to average from javascript, but this isn't working. Neither the value of average, nor the string "average" shows up at the end. What am I doing wrong?
  10. lol I actually figured that out after some fresh air and when I saw your answer I was relieved, thanks!
  11. might it be something else I did wrong? $sgvote = mysql_query("SELECT * FROM vote") or die(mysql_error()); while($ratings = mysql_fetch_array( $sgvote )) { $voters = $ratings["voters"]; $average = $ratings["average"]; } $newaverage = ($average / $voters + $choice) / ($voters+1); $voters = $voters + 1; $update = mysql_query("UPDATE vote SET voters=$voters, average=$newaverage");
  12. Hi, this isn't really a mysql matter but it's the most appropriate section to post in. I'm trying to make a rate system script in php and I'm using a database to store the voters and the average so far. So each time someone makes a new vote, average must be recalculated and voters is increased by one. I'm having trouble with the maths, I've been over this for like 4 hours, and I'm not sure what the problem is. newaverage = (average / voters + newvote) / (voters + 1) .. and then I update the database and print the new average, but it doesn't work right. What's wrong with it?
  13. Jesus, I was 100% sure it was the correct one, I just checked and the real one was in the apache folder not in the php one. All is well now, thank you.
  14. when I check phpinfo() , this is what it says include_path .;C:\php5\pear
×
×
  • 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.