Jump to content

Ajax.InPlaceEditor php code need help


acctman

Recommended Posts

everytime i try to upload it fails, i've been trying to find an example of how to update but all the example either don't use PHP or just show a generic text changing without really saving anything.

 

webpage:

<?
$mp3user = mysql_query("SELECT `mp3_id`,`mp3_userid`,`mp3_title` FROM `rate_mp3s` WHERE `mp3_userid` = '".$en['m_id']."'");

echo "<ul style=\"margin-left: 210px;\">\n";
$counter = 1;
while($en = mysql_fetch_array($mp3user)) {
echo "<li>MP3 " .$counter. " : <span id=\"mp3title-".$counter."\">".$en['mp3_title']. "</span> | <a href=\"/modules/rating/process_mp3.php?user=" .$en['mp3_userid']. "&mp3=" .$en['mp3_id']. "\">Delete</a></li>\n";
$counter++;
}
echo "</ul>\n";
?>

<script type="text/javascript">
new Ajax.InPlaceEditor('mp3title-1', '/modules/rating/process_mp3.php');
new Ajax.InPlaceEditor('mp3title-2', '/modules/rating/process_mp3.php?user=<%m_id%>&id=<%mp3_id%>');
new Ajax.InPlaceEditor('mp3title-3', '/modules/rating/process_mp3.php?user=<%m_id%>&id=<%mp3_id%>');
</script>

 

process_mp3.php

 

<?php
session_start();

$value = $_POST['value'];
//$id = (int)$_GET['mp3'];

$mp3_update = mysql_query("UPDATE `rate_mp3s` SET mp3_title='$value' WHERE mp3_id='".$_GET['mp3']."'");
echo $value;
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.