Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[PHP-JAVASCRIPT] LI into UL

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Wed Mar 30, 2011 9:47 am    Post subject: [PHP-JAVASCRIPT] LI into UL Reply with quote

Ahey guys, I've a problem with adding LI to UL.

Code:
<div class="hir">
<ul>
    <li>
           
                     
           <div id="hirek_fel"><a class="WARNING">Hírek</a> </div>
        <div id="hirek_koz"><!-- jobb kezdete-->
            <div class="tartalom">
<!--                          TARTALMA                           -->

<!--                          TARTALMA                           -->
            </div>
        </div><!-- jobb vege-->
            <div id="hirek_lent"></div>
           
    </li>
</ul>
</div>
<a href="#" onclick="AddNews()"> Add News </a>

<script type="text/javascript">


function AddNews()
{
   var newLI = document.createElement("li");
   newLI.innerText = "New News";


   var gl = document.getElementById("hir");
   gl.appendChild(newLI)
}


</script>


Here's what I've done so far, whats wrong with it? It does nothing, no effect. Any suggestion?
Back to top
View user's profile Send private message
AhMunRa
Grandmaster Cheater Supreme
Reputation: 27

Joined: 06 Aug 2010
Posts: 1117

PostPosted: Wed Mar 30, 2011 10:41 am    Post subject: Reply with quote

Looks like your function AddNews() isn't really doing anything. You aren't creating any textboxes to add more content.

I wouldn't use a java function to manage content like this, you could just as easily do it in php.

_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.>
Back to top
View user's profile Send private message
scearezt
Cheater
Reputation: 0

Joined: 12 Feb 2011
Posts: 46

PostPosted: Wed Mar 30, 2011 10:46 am    Post subject: Reply with quote

Then can you tell me how? I dont find anything about it in PhP...
Back to top
View user's profile Send private message
AhMunRa
Grandmaster Cheater Supreme
Reputation: 27

Joined: 06 Aug 2010
Posts: 1117

PostPosted: Wed Mar 30, 2011 12:23 pm    Post subject: Reply with quote

You function would be similar to
Code:

<?php

// includes go here

if(isset($POST['Add News']))
{
// Write out your data to the page, or upload to database
}


On page itself call that function via
index.htm
Code:

<form action="addnews.php" method="post">
Story Name: <input type="text" name="name" />
<input type="textbox" name="story" />
<input type="submit" />
</form>


This will get you started.

Info on posting data from PHP http://www.php.net/manual/en/reserved.variables.post.php

If you are absolutely new to PHP, or even if you aren't this may help you even further.

http://css-tricks.com/php-for-beginners-building-your-first-simple-cms/

_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites