Jump to content

CyberGuru

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CyberGuru's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. on the embedded page I am using the following javascript to change the contents of a text field on the parent page when a link is clicked. However when I click the link the error I receive is the function change_text is not defined. function change_text() { message.value = "text to be changed to"; }
  2. not sure if this is the right place for this.... I have a php page that contains a div with a php page inside the div. On the page inside the div, when I click on a link I need it to change the value of a text box on the parent page. All my attempts at this so far have been unsuccessful. Can anyone point me in the right direction of how to accomplish this? Thanks for any input and help.
  3. I got it sorted it, changed my SQL to the following did the trick. SELECT * FROM (SELECT * FROM tablename ORDER BY tablecolumn DESC LIMIT 5) AS RequiredLimit ORDER BY tablecolumn ASC
  4. I am using the following query to retrieve the last 20 results of my database, but I need them not to be in descending order. Is there anyway I can accomplish this with the query or do I need to handle it in php? Thanks for your help. SELECT * FROM messages ORDER BY id DESC LIMIT 0,20
  5. $_SESSION['Username'] is being set on the login page and has session_start(). The part of the code using the session is working correctly as its value is being successfully assigned to the variable $poster. The only thing thats not working is the echo'd javascript. No alert box pops up. If I knew what was wrong with it, I could better determine if it was a php or javascript issue.
  6. I am trying to set it up so that when someone who is not logged in tries to post in my shoutbox they get a javascript alert saying that they must be logged in to post. The session is passing and is allowing logged in users to post, and unlogged in users cannot post, but the javascript alert is not triggering. Any help would be greatly appreciated. here is the code: <?php session_start(); if(isset($_SESSION['Username'])) $poster = $_SESSION['Username']; else $poster = ""; if ($poster == "") { echo "<script>alert('You must be logged in to post')</script>"; //this is not working } else { //everything after this point seems to be working flawlessly $query = "INSERT INTO shoutbox (poster,message,time) VALUES ('".$poster."','".$message."','".$msg_time."')"; mysql_query($query); } KP: Added code tags.
×
×
  • 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.