Jump to content

Search the Community

Showing results for tags 'pass'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 5 results

  1. Hi guys, I am trying to delete DB row without page refresh. I am aware of how to delete by passing URL values and I am trying to do the same thing, but with AJAX. $data = mysql_query("SELECT * FROM playlistsongs WHERE PlayList = '$playlistsongid'") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { ?> <?php <table border="1px"> <tr> <td style="width: 100px;"><?php echo "<b>PlaylistSongID:</b> ".$info['PlaylistSongID'];?></td> <td style="width: 100px;"><?php echo "<b>PlayList:</b> ".$info['PlayList'];?></td> <td style="width: 100px;"><?php echo "<b>UserID:</b> ".$info['UserID'];?></td> <td style="width: 100px;"><?php echo "<b>SongUrl:</b> ".$info['SongUrl'];?></td> <td style="width: 100px;"><?php echo "<b>Status:</b> ".$info['Status'];?></td> <td style="width: 100px;"><?php echo "<b>DateCreated:</b> ".$info['DateCreated'];?></td> <td style="width: 100px;"><?php echo "<b>DateModified:</b> ".$info['DateModified'];?></td> <td style="width: 100px;"><?php echo "<b>Artist:</b> ".$info['Artist'];?></td> <td style="width: 100px;"><?php echo "<b>Title:</b> ".$info['Title'];?></td> <td style="width: 100px;"><a data-customer-id="345" class="button remove">Remove</a></td> </td> </tr> </table> And this is my AJAX request: function DeletePlayListItem(){ $.ajax({ 'url': 'processing/delete-playlist-items.php', 'async': false, data: "PlaylistSongID=" + PlaylistSongVarID + "&UserID=" + UserVarID + "&Status=", success: function (response) { var posturl='http://localhost/xampp/websites/Djapp/processing/delete-playlist-items.php' $.getJSON(posturl,function(data){ $.each(data.members, function(i,userdetails){ takeuserid = (userdetails.UserID); title = (userdetails.Title); vote1 = (userdetails.Vote1); }); }); } }); } So my question is, how do I pass the values to the AJAX on click/select? Thank you for your time!
  2. Hi, I'm trying to pass a variable from my php script on the page into the og;metadata, but on the timeline all that is shown is the standard html metadata, am I using the correct php code to call the variable so that it shows up on the timeline? <meta property="og:title" content="<?php $_GET['$title']; ?>"/> the title variable comes from here; $title = urlencode("Take The Test!"); Any help on this is much appreciated, Gareth
  3. Hello..this is my first attempt to ask a question on this forum..I am trying to be as descriptive as possible what I have is select option in 'chart.php' page and once I select the value,it's passed to another 'getvalue.php' page using get. this 'getvalue.php' page will connect and run sql query with the value I sent and make table from the result and send it back using AJAX callback..it works fine for this concept so far. Now, I am trying something else. I am using google charts to visualize the data. So the thing is I run php code from 'chart.php' page where I manually enter the value for the query to take in and create a result for associative array. This array is linked to a variable myurl[]. Afterwards, in this same page 'chart.php'..I am in my Javascript calling this will variable because there is an option for arraytoDatatable in google charts. once all of this is done, the chart is displayed and everything is fine and happy. Now, what I want to do is select a value from the options and send that value in the same 'chart.php' page and run the query and update the google charts...so far I haven't been able to figure out why can't it send the value to the same page. I am not even sure if php can refer to its own self and call the value. Here's the code: <html> <form id="myform" method="GET" action="<?php echo $_SERVER['$PHP_SELF'];?>"> Select a orbital period (in days) <select id="sf" name="star"> <option value="0">0</option> <option value="0.5">0.5</option> <option value="10">10</option> <option value="100">100</option> <option value="365">365</option> </select> </form> <?php $o = intval($_GET['star']); /*$o = '10';*/ echo "$o<br>"; $con = mysqli_connect('localhost','username','password'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,'mydatabase'); $sql="SELECT * FROM exoplanetdb WHERE pl_orbper >= '".$o."' "; $result = mysqli_query($con,$sql); $myurl[] = "['Mass','Mass,Radius(J)']"; while($row = mysqli_fetch_assoc($result)) { $mass=$row['pl_masse']; $radj=$row['pl_radj']; $myurl[] = "[".$mass.",".$radj."]"; } mysqli_close($con); ?> <!--make the chart--> <script src="https://www.google.com/jsapi"></script> <script> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ <?php echo(implode(",",$myurl));?> ]); var options = { selectionMode: 'multiple', title: 'Mass vs Size(times Jupiter radius)', hAxis: {title:'Mass(times Earths)'}, vAxis: {title:'Radius(times Jupiter)'} }; var chart = new google.visualization.ScatterChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> </html> if something is unclear..plz ask me..I will try to explain..Thank you for your time
  4. the first chunk of code is in my index.php file. I am trying to pass the $_SESSION['mes_id1'] variable into another php file called up.php and it will not get passed. the second chunk of code is the up.php file and the third chunk of code is my config.php file. any help is very much appreciated!!!!! thank you in advance!!!! index.php <?php session_id(); session_start(); mysql_connect("localhost", "FoleyHurley", "*******"); mysql_select_db("voting2"); ?> <div id="mipods" class="section2" style="display: none;"> <!-- assign mysql data rows to corresponding php variables --> <?php $sql = mysql_query("SELECT * FROM blogData ORDER BY id DESC"); $sql2=mysql_query("SELECT * FROM messages WHERE mod(mes_id,2) = 0 ORDER BY mes_id DESC"); $sql3=mysql_query("SELECT * FROM messages WHERE mod(mes_id,2) = 1 ORDER BY mes_id DESC"); while(($row = mysql_fetch_array($sql))&&($row2 = mysql_fetch_array($sql2))&&($row3 = mysql_fetch_array($sql3)) ){ $id = $row['id']; $title = $row['title']; $content = $row['content']; $category = $row['category']; $podcast = $row['podcast']; $datetime = $row['datetime']; $message1=$row2['msg']; $mes_id1=$row2['mes_id']; $totalvotes1=$row2['totalvotes']; $message2=$row3['msg']; $mes_id2=$row3['mes_id']; $totalvotes2=$row3['totalvotes']; $_SESSION['message1'] = $message1; $_SESSION['message2'] = $message2; $_SESSION['mes_id1'] = $mes_id1; $_SESSION['mes_id2'] = $mes_id2; $_SESSION['totalvotes1'] = $totalvotes1; $_SESSION['totalvotes2'] = $totalvotes2; ?> <?php // variable used to display file name of $podcast without the extension $noext = $podcast; $echodub = rawurlencode($podcast); // code to display $noext without the file extension $info = pathinfo($noext); $noext_name = basename($noext,'.'.$info['extension']); ?> <!-- echo php variables in html format, in a table with the class of "podcast" --> <table class="podcast" border="1"> <tr> <td class="title"> <?php echo $title; ?> </td> <td class="timeandcategory"> <?php echo $datetime; ?> <br> <?php echo $category; ?> <?php echo $_SESSION['mes_id1']; ?> <?php echo $_SESSION['mes_id2']; ?> <?php echo session_id(); ?> </td> </tr> <tr> <td class="content"> <?php echo $content; ?> </td> <td class="myfblike"> <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://localhost:8888/blog1/index.php#<?php echo $noext; ?>" data-counturl="http://localhost:8888/blog1/index.php#<?php echo $noext; ?>" data-text="listen to SD's new podcast! www.sportdebaters.com#<?php echo $noext; ?> @SDebaters " data-related="SDebaters" data-hashtags="SDebaters">Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> <span class='st_fblike_large' displayText='Facebook Like'></span><br> <span class='st_facebook_large' displayText='Facebook'></span><br> <span class='st_twitterfollow_large' displayText='Twitter Follow'></span><br> <span class='st_pinterest_large' displayText='Pinterest'></span><br> <span class='st_email_large' displayText='Email'></span><br> <span class='st_sharethis_large' displayText='ShareThis'></span><br> </td> </tr> <tr> <td class="audio"> <!--echo the audio file --> <ul class="playlist"> <li><a href="<?php echo"uploads/$podcast"; ?>"><?php echo"$noext_name"; ?></a></li> </ul> <!--<div id="sm2-container"> (I don't have an SM2 flash movie... but lets save this for later but for now I will comment out the div this is contained in also....) SM2 flash movie goes here </div> --> </td> <td> <div id="main"> <div id="left"> <span class='up'><a href="" class="vote" id="<?php echo $_SESSION['mes_id1']; ?>" name="up"><img src="up.png" alt="Down" /></a></span><br /> <?php echo $_SESSION['totalvotes1'] ?><br /> <!--<span class='down'><a href="" class="vote" id="<?php echo $mes_id1; ?>" name="down"><img src="down.png" alt="Down" /></a></span>--> </div> <div id="message"> <?php echo $_SESSION['message1'] ?> </div> <div class="clearfix"></div> </div> <div id="main"> <div id="left"> <!--<span class='up'><a href="" class="vote" id="<?php echo $mes_id2; ?>" name="up"><img src="up.png" alt="Down" /></a></span>--><br /> <?php echo $_SESSION['totalvotes2'] ?><br /> <span class='down'><a href="" class="vote" id="<?php echo $_SESSION['mes_id2']; ?>" name="down"><img src="down.png" alt="Down" /></a></span> </div> <div id="message"> <?php echo $_SESSION['message2'] ?> </div> <div class="clearfix"></div> </div> </td> </tr> </table> <br> <?php } ?> </div> up.php <?php session_start(); include("config.php"); $ip=$_SERVER['REMOTE_ADDR']; $ip_sql=mysql_query("select ip_add from Voting_IP where mes_id_fk='".$_SESSION['mes_id1']."' and ip_add='$ip'"); $count=mysql_num_rows($ip_sql); $ip_sql2=mysql_query("select ip_add from Voting_IP where mes_id_fk='".$_SESSION['mes_id2']."' and ip_add='$ip'"); $count2=mysql_num_rows($ip_sql2); if($count==0 && $count2!=0) { $sql = "update Messages set totalvotes=totalvotes+1 where mes_id='".$_SESSION['mes_id1']."'"; mysql_query( $sql); $sql_in = "insert into Voting_IP (mes_id_fk,ip_add) values ('".$_SESSION['mes_id1']."','$ip')"; mysql_query( $sql_in); $sql = "update Messages set totalvotes=totalvotes-1 where mes_id='".$_SESSION['mes_id2']."'"; mysql_query( $sql); $sql_in = "DELETE FROM Voting_IP WHERE mes_id_fk='".$_SESSION['mes_id2']."'"; mysql_query( $sql_in); } else if($count==0 && count2==0) { $sql = "update Messages set totalvotes=totalvotes+1 where mes_id='".$_SESSION['mes_id1']."'"; mysql_query( $sql); $sql_in = "insert into Voting_IP (mes_id_fk,ip_add) values ('".$_SESSION['mes_id1']."','$ip')"; mysql_query( $sql_in); } ?> config.php <?php $mysql_hostname = "localhost"; $mysql_user = "FoleyHurley"; $mysql_password = "******"; $mysql_database = "voting2"; $prefix = ""; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select database"); ?>
  5. So, basically, I have it set up so that banned users are in a table in the database called "bans". The lift date is formatted like such.. "02/14/2013 14:06AM" How can I make it so that if the date is passed, it removes the row from the table? Like how do I set up if($lift_date >= $c_date){ //remove } when using the time of day too?
×
×
  • 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.