Jump to content

cabbie

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by cabbie

  1. THis is the correct jsfiddle correct jsfiddle
  2. You are a genius!!! Try it now..
  3. OK Thanks for the response kicken . jsfiddle is a screwedup mess I was changing things trying to get something to work and totally destroyed it due to mass confusion I'll clean it up and try your suggestion. . Your mouseOver function is using your element variable, which is your id="butts" div. That div does not have a com attribute. I will windup with 8 buttons and need to get the com attribute out of the buttons. I put the the buttons in the butts div That was the only wayI could get hover to work on the buttons.
  4. I have the event lisener working and go to mouseover function. but get attribute i need id. (Cant get with TagName) jsfiddle
  5. OK Got it Attribute Thanks requinix One little hint can lead down the right path..
  6. Still havnt figured out how to retrieve value.
  7. OK I,m getting ideas now using the id w3
  8. I,M trying to things that havnt been done before and it would be a lot easier for me to make a video to explain what I am trying to do and I hate to throw code out without a decent explanation of what does what. I,ll just say the main purpose of the buttons is provide entry points in videos. the onclick goes to a desired point in the video. That part is fairly easy when a button is added it is stacked in localStorage and the row of buttons are all innerHTML in a dive The entry point time is stored in each button. The buttons are transferred to another site &butts=sl my question would be with the new class of hover-comment i need a basic run-down on how to make it fly Thanks..The site For those that want to see the operation, ill provide a link. Click on the first image of the gal to go to that video. m not even sure if it is working now ie making new entry points. Site
  9. I an transferring buttons a another page (localStorage) and each have a comment when hovered. It would save a lot of fuss to be able to store the comments in the buttons. Is there a way to retrieve the value out of such as this button? Also trying to pass the id to a show function to display the comment for that button. The tagg but1 is from trying with getElementByTagName. <html> <but1 type='button' id='1' class='btn btn-warning' value='Savin' onmouseover='showFunction(1)' onmouseout='clrdes()' onclick='goTo(500)'>1</button> </html>
  10. It's a long story but if you go to this site in development, you will get a better idea what I am trying to do. It is a system to build like a 'TOC' or entry ponits on the video . The buttons when clicked goto whatever cuttennt-vid-time you have set. It is for video presentations and other things. Go into the video and click the new ep button, You will get a popup explaining the operation, When done I want to savethe src of the video, comments for the entry points and the buttons added in cookies Use the red EP button as return after playing the video a few seconds and adj to desired EP Video site The actual php (reached by ajax) to set cookies <code> <?php session_start(); if(isset($_POST["mp"])){ // echo "set"; $mp = $_POST["mp"]; $dall = $_POST["dall"];// echo "dall=".$dall; $uep = $_POST["uep"]; //echo "uep=".$uep; $_SESSION["mp"] = $mp; $_SESSION["dall"] = $dall; echo "sesdall".$_SESSION["dall"]; $_SESSION["uep"] = $uep; echo "sesuep".$_SESSION["uep"]; setcookie('mpCookie'.'$mp'.time()+30*24*60*60.); setcookie('dallCookie'.'$dall'.time()+30*24*60*60.); setcookie('uepCookie'.'$uep'.time()+30*24*60*60.); </code> } ?>
  11. This is a site I am working on After setting a EP I want to save the src for video the comments and buttons added I am beginning to think it is impossible web site
  12. How do I save or what is the syntax to save a button in a cookie? test site test I did try a header like <h3>Hello</h3> but get error with a boot5 button. <code> <?php $mp = "vids/coli.mp4"; $dall ="aaa";// echo "dall=".$dall; $uep = `<button type="button" class="btn btn-warning" onmouseover="show(0)" onmouseout="hide(0)" onclick="skip(-5000) ">0:0:0</button>`; //echo "uep=".$uep; setcookie('mp'.'$mp'.time()+30*24*60*60.); setcookie('dall'.'$dall'.time()+30*24*60*60.); setcookie('uep'.'$uep'.time()+30*24*60*60.); ?> </code> ?
  13. Everything works but the SELECT COUNT $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = 3"); $q->execute(); $records = (int) $q->fetch(PDO::FETCH_OBJ)->records; echo '$records =', $records;
  14. This is close.... http://pastebin.com/rqSVNBFV
  15. Originally que_id was the increment variable and i was passing between pages. the table tracker has 2 columns id (not auto incremented) and que_id. each operator after login will start at the current que_id or id.. Yes I had where Que_id= que_id but changed it As you can see I have put a lot of time in this project and way over my head trying to develop this code and pulling my hair. Syntax in this particular operation is the problem..
  16. This is a phone survey script... survey php prints the current reg voters data on the survey page. The surveyor attempts a call and gets a no answer or contact and Selects this result from a dropdown which calls operation.php. Operation.php increments the row id and stores it into table tracker. survey.php then prints the new data for the next call .. this code is almost working.. this is a link to the survey page. and link to the code below that. survey page http://libertarianpartylc.org/survey.php code http://pastebin.com/9dx04UDP
  17. I need que to be an integer value.. A number I can use math on. Ill provide a link to survey page Whatever the que is a query SELECTS the data in that row. What I want to do is on the next operation got to the next ID.. http://libertarianpartylc.org/survey.php
  18. I want to get a number from a data base use it in another script increment by 1 and insert back into that column. In this script how can I get the numeric value of que? $query = $db->query("SELECT `que` FROM `tracker` "); while($rows = $query->fetch(PDO::FETCH_ASSOC)){ echo $rows['que']; (prints que) echo que; (does not work)
  19. cabbie

    print_r

    Thanks.. I had to SELECT each one but that works..
  20. cabbie

    print_r

    Im doing a PDO query and need help with the while loop and printout. Without showing the whole script here is the code,, Need a printout similar to this.. I can do the html etc. A format easy to read for surveyor. Voter ID 9003256 Name John Doe Address 123 Main St Phone 5553123698 http://libertarian-forum.com/larimerlp/survey.php $query = $db->query("SELECT * FROM `members` WHERE `members` . `index` = $que"); $rows = $query->fretchAll(PDO::FETCH_ASSOC);
  21. What is the proper syntax or method in the prepare update sequence? <?php session_start(); $log_user_id = preg_replace('#[^0-9]#', '', $_SESSION['uid']); $username = $_SESSION['owner']; $fileName = $_FILES["uploaded_file"]["name"]; // The file name $fileTmpLoc = $_FILES["uploaded_file"]["tmp_name"]; // File in the PHP tmp folder $fileType = $_FILES["uploaded_file"]["type"]; // The type of file it is $fileSize = $_FILES["uploaded_file"]["size"]; // File size in bytes $fileErrorMsg = $_FILES["uploaded_file"]["error"]; // 0 for false... and 1 for true $kaboom = explode(".", $fileName); // Split file name into an array using the dot $fileExt = end($kaboom); // Now target the last array element to get the file extension // START PHP Image Upload Error Handling -------------------------------------------------- echo $username, $fileName; if (!$fileTmpLoc) { // if file not chosen echo "ERROR: Please browse for a file before clicking the upload button."; exit(); } else if($fileSize > 5242880) { // if file size is larger than 5 Megabytes echo "ERROR: Your file was larger than 5 Megabytes in size."; unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder exit(); } else if (!preg_match("/.(gif|jpg|png)$/i", $fileName) ) { // This condition is only if you wish to allow uploading of specific file types echo "ERROR: Your image was not .gif, .jpg, or .png."; unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder exit(); } else if ($fileErrorMsg == 1) { // if file upload error key is equal to 1 echo "ERROR: An error occured while processing the file. Try again."; exit(); } // END PHP Image Upload Error Handling --------------------------------- // Place it into your "uploads" folder mow using the move_uploaded_file() function $moveResult = move_uploaded_file($fileTmpLoc, "members/$username/$fileName"); // Check to make sure the move result is true before continuing if ($moveResult != true) { echo "ERROR: File not uploaded. Try again.", $fileName; unlink($fileTmpLoc); // Remove the uploaded file from the PHP temp folder exit(); } // ---------- Include Adams Universal Image Resizing Function -------- include_once("scripts/avatar_sizecrop.php"); $target_file = "members/$username/$fileName"; $resized_file = "members/$username/$fileName"; $wmax = 310; $hmax = 300; ak_img_resize($target_file, $resized_file, $wmax, $hmax, $fileExt); //$query = $db->query("UPDATE members SET avatar='$avatar' WHERE username='$username' AND id='$log_user_id' LIMIT 1"); // ----------- End Adams Universal Image Resizing Function ---------- // ------ Start Adams Universal Image Thumbnail(Crop) Function ------ /*$target_file = "members/$username/resized_$fileName"; $thumbnail = "members/$username/thumb_$fileName"; $wthumb = 150; $hthumb = 150; ak_img_thumb($target_file, $thumbnail, $wthumb, $hthumb, $fileExt); // ------- End Adams Universal Image Thumbnail(Crop) Function -------*/ // Display things to the page so you can see what is happening for testing purposes //header("Location: index.php?$username"); $updateSQL = $db->prepare("UPDATE members SET avatar=? WHERE username=? LIMIT 1"); $updateSQL->bindValue(1,$fileName,PDO::PARAM_INT); $updateSQL->bindValue(2,$username,PDO::PARAM_INT); $updateSQL->execute(); exit(); ?>
  22. cabbie

    php move

    This is what I needed .. $dstfile="members/{$user}/we.png";
  23. cabbie

    php move

    I am trying to copy a default avatar pic to a users folder which is generated during activation The above code generates the folder I want to copy the default avatar to that folder in the users profile This is the activation code I just need the copy syntax.. <?php if(isset($_GET['user']) && $_GET['user'] != "" && isset($_GET['token']) && $_GET['token'] != ""){ include_once("scripts/connect.php"); $user = preg_replace('#[^0-9]#', '', $_GET['user']); $token = preg_replace('#[^a-z0-9]#i', '', $_GET['token']); $stmt = $db->prepare("SELECT user, token FROM activate WHERE user=:user AND token=:token LIMIT 1"); $stmt->bindValue(':user',$user,PDO::PARAM_INT); $stmt->bindValue(':token',$token,PDO::PARAM_STR); try{ $stmt->execute(); $count = $stmt->rowCount(); if($count > 0){ try{ $db->beginTransaction(); $updateSQL = $db->prepare("UPDATE members SET activated='1' WHERE id=:user LIMIT 1"); $updateSQL->bindValue(':user',$user,PDO::PARAM_INT); $updateSQL->execute(); $deleteSQL = $db->prepare("DELETE FROM activate WHERE user=:user AND token=:token LIMIT 1"); $deleteSQL->bindValue(':user',$user,PDO::PARAM_INT); $deleteSQL->bindValue(':token',$token,PDO::PARAM_STR); $deleteSQL->execute(); if(!file_exists("members/$user")){ mkdir("members/$user", 0755); } $db->commit(); echo 'Your account has been activated! Click the link to log in: <a href="login.php">Log In</a>'; $db = null; exit(); } catch(PDOException $e){ $db->rollBack(); echo $e->getMessage(); } }else{ echo "Sorry, There has been an error. Maybe try registering again derp."; $db = null; exit(); } } catch(PDOException $e){ echo $e->getMessage(); $db = null; exit(); } } ?>
  24. Why do I get error on move or copy? <?php $user = "joe";mkdir("members/$user", 0777);$srcfile='images/we.png'; $dstfile='members/$user/we.png'; $moveResult = move_uploaded_file($srcfile, $dstfile); if ($moveResult != true) {echo 'failed';exit();}//copy($srcfile, $dstfile) or die("Unable to copy $srcfile to $dstfile."); echo $srcfile, $dstfile, '?/'; ?>
  25. cabbie

    ajax

    Ok I found out I didnt even have the right dir path to connect.php I have this code working..Last half is commented out .. echo 'fired', $row['username']; is printing username.. <?php include_once('connect.php'); echo '<pre>'.print_r($_POST, true).'</pre>'; if(isset($_POST["usernamecheck"])){ $username = preg_replace('#[^a-z0-9]#i', '', $_POST['usernamecheck']); echo $username; //// query to check if the username is in the db already //// $unameSQL = $db->prepare("SELECT username FROM members WHERE username=:usernamecheck LIMIT 1"); $unameSQL->bindValue(':usernamecheck',$username,PDO::PARAM_STR); $unameSQL->execute(); // execute the sql $row = $unameSQL->fetch(PDO::FETCH_ASSOC); // fetch the result $count = $unameSQL->rowCount(); // count rows try{ echo 'fired', $row['username']; } catch(PDOException $e){ echo $e->getMessage(); $db = null; exit(); } } //// Check if username is in the db already //// /*if($unCount > 0){ echo "Sorry, that username is already in use in the system"; $db = null; exit(); } else{ echo $uncount; if (strlen($username) < 3 || strlen($username) > 16) { echo '<strong style="color:#F00;">3 - 16 characters please</strong>'; exit(); } if (is_numeric($username[0])) { echo '<strong style="color:#F00;">Usernames must begin with a letter</strong>'; exit(); } if ($unCount < 1) { echo '<strong style="color:#009900;">' . $username . ' is OK</strong>'; exit(); } } }*/ ?>
×
×
  • 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.