Jump to content

vonKristoff

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vonKristoff's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. cool thanks. Also I just worked out like this.. flashvars.myvar = "<?= $src ?>"; &by declaring the function up top which creates the variable instance.
  2. Hiya .. I just want to feed in a variable to my javascript on my HTML page, via PHP because it is grabbing data from the server ... I have a php function that gets called in my header that does something like this: echo 'flashvars.myvar = "'.$src.'";'; basically I am passing a var to swfObject like so: (see the php call) <script type="text/javascript"> var params = {}; params.menu = "false"; params.scale = "noscale" params.wmode = "transparent"; params.allowfullscreen = "true"; var flashvars = {}; <?php getHTMLVar(); ?> swfobject.embedSWF("flash/video.swf", "index", "100%", "100%", "9.0.0","expressInstall.swf",flashvars,params); </script> to all u freaks - u already know that this doesnt work, and the page breaks - why is this - and is there another solution? Thanks!
  3. My code is as follows - and throws no errors - but neither any javascript console messages - and does nada in general... So Im really stuck - is there no end!? /* modified */ OK - reset servers / cache / filled mug It now takes action...> with the following :::::: <?php require_once "database.php"; if(!mysqli_connect_errno()) { error_log("Connected"); $id=$_POST['id']; $mysqli->query("INSERT INTO videos(src) VALUES('".mysql_real_escape_string($id)."')"); } else{ error_log("not connected"); } ?> Great! However - still dont get why I had to "mysql_real_escape_string" because I havent seen that in ANY tutorials - or from advice given by other helpful people ... guess u gotta be a freak to get it..
  4. ok thanks - could you enlighten me? I've started looking into mysql_real_escape_string as a way to interpret the variable ..
  5. ok, just for you fenway <?php include 'database.php'; if(!mysqli_connect_errno()) { error_log("Connected"); $id=$_POST['id']; $q="INSERT INTO videos(src) VALUE('$id')"; $result=$mysqli->query($q) or die($mysqli_error($mysqli)); } else{ error_log("not connected"); } ?>
  6. Thanks..! $id=$_POST['id']; $q = "INSERT INTO videos(src) VALUES ('$id')"; was what I was after - I thought that was right - Alas with my final push with $result=$mysqli->query($q) or die($mysqli_error($mysqli)); It doesnt work and throws up an error "undefined variable" & Function must not be a string. - That I dont understand and have a feeling my server is playing up ... ? any hints to why this isnt going through. As said if I error log my $id - I get the correct var coming through in the log.
  7. Even if I push a non var through ie: $q = "INSERT INTO videos(src) VALUE("text")"; it still wont work and says unexpected T_STRING .. For the record - if i push the $var into my error_log it reads correct.
  8. Hi .. thanks .. yes corrected - but that was my TYPO! I have it correct in in my code im using. I get a error 500 in my java console in firefox. In my error log - it says PHP Fatal error: Function name must be a string I cant see where its wrong. ..> anything else sticking out? - Otherwise it could be something to do with mySQL on my server?
  9. hiya im new to all this.. I am trying to INSERT into my Database. $id = $_POST['id']; $q = "INSERT INTO videos(src) VALUES ($id); $result = $mysqli->query($q) or die($mysqli_error($mysqli)); It just throws an error each time .. Any ideas ..?
  10. Hi there, Im new here .. I have been trying for hours to just pass a variable from my HTML to a JQuery post which connects to my PHP file, reading the variable sent in the POST, and updating my database. Basically - my PHP is not getting the variable im sending to it - though it is definitely going as my HTML says so. my HTML click function says: $.post("setDB.php",{id:$('#myTxt').val()}); my PHP - connects to its DB with its new MySQLi set to $mysqli - says: $id = $_POST['id']; $query = "INSERT videos SET src = $id"; $result = $mysqli->query($query) or die($mysqli_error($mysqli)); ok - but no way is anything working ...... I have no hair left - if anyone else has some spare - please be my guest
×
×
  • 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.