UnknownPlayer
Members-
Posts
269 -
Joined
-
Last visited
Never
Everything posted by UnknownPlayer
-
I have problem, there are users with "?" character in username, and their address to profile is /profile/username/. I have var: $username that is that username, now, how can i replace all that characters which cant open users profile.. I mean for "?" i need to put "%3F", how can i replace? I know with str_replace, but is there any other solution like htmlencode or something like that? :S
-
I just need to make something like this, i just need to make to have 2 rows like here, how to do that? I think it need to be done with div andsat 50% on each div and it will be 2 rows? Can someone give me example?
-
Anyone can help me with this?
-
How can i make like this: 2 rows and this boxes ?
-
javascript adding inputs blank all :S
UnknownPlayer replied to UnknownPlayer's topic in Javascript Help
Anyone ? :S -
javascript adding inputs blank all :S
UnknownPlayer replied to UnknownPlayer's topic in Javascript Help
Then, can you or someone else give me an example, how to do that? -
I have this javascript function: <script> fields = 5; function addInput() { if (fields <= 15) { document.getElementById('inputs').innerHTML += "<input type='text' value='' name='igraci[]' /><br />"; fields += 1; } else { document.getElementById('inputs').innerHTML += "<br />15 je dozvoljeno."; } } </script> And this PHP Code: <form action="klan.php?id='.$kid.'" method="post"> <p> <div id="inputs"> </div> <input class="button" type="button" onclick="addInput()" name="add" value="Dodaj jos igraca" /> <br /><br /> <input class="button" type="submit" name="sacuvaj" value="Posalji pozivnicu igracima" /> </p> </form>'; Now i have problem, when i click on button to add inputs, it add inputs, then i write in inputs some value, and when i wonna add more inputs, when click to add it remove all values on all inputs that was there :S How can i just add input, not to remove value on previous inputs ?
-
Yeah, you will have to read them with a foreach. It is not advisable to save them as a comma separated list in mysql. I didn't go into all of that, but just answered your question. I have no idea what 'igraci' means, but would think that you should use a separate table to hold those values. Using a primary key linking back to the 'klanovi' table's row that those values are tied to. This lets you pull a table join to group all of those values. This would. A. Make it easier to manipulate the data. B. Make it easier to delete only one of said values. C. Further your database design in the the Normal Form. I know, i go now in that way, thanks
-
How can i save array from inputs, witch is $igraci and it have 5 values, to mysql base, i tryed but in mysql it shows Array. This is form: <form action="dodaj_klan.php" method="post" > <p> <label>Naziv klana:</label> <input name="naziv" type="text" size="20%" /> <label>Web Sajt:</label> <input name="website" type="text" size="20%" /> <label>E-Mail:</label> <input name="email" type="text" size="20%" /> <br /><br /> <label>Igraci klana(5):</label> <input name="lider" type="radio" value="1" /> <input name="igraci[]" type="text" size="20%" /><br /> <input name="lider" type="radio" value="2" /> <input name="igraci[]" type="text" size="20%" /><br /> <input name="lider" type="radio" value="3" /> <input name="igraci[]" type="text" size="20%" /><br /> <input name="lider" type="radio" value="4" /> <input name="igraci[]" type="text" size="20%" /><br /> <input name="lider" type="radio" value="5" /> <input name="igraci[]" type="text" size="20%" /> <label><i>(obelezi lidera klana)</i></label> <br /><br /> <input class="button" type="submit" name="submit" value="Dodaj" /> </p> </form> Now i wonna save this igraci[] array in mysql, i tried like this but it doesn't work: $igraci = $_POST['igraci']; $query = "INSERT INTO klanovi (naziv, website, email, igraci) VALUES ('{$naziv}', '{$website}', '{$email}', '{$igraci}')"; $result = mysql_query($query, $connection); How can i do this? Thanks..
-
Any solution ? :S
-
There is my html code: <?php include("includes/meta.php"); ?> <body> <!-- wrap starts here --> <div id="wrap"> <!-- header --> <div id="header"> <span id="slogan">DotA Serbia Official Website</span> <!-- top menu --> <?php include("includes/top_menu.php"); ?> </div> <div id="header-logo"> <a href="http://dota.rs/"><div id="logo"></div></a> </div> <div id="sidebar-left" ></div> <div id="sidebar-right" ></div> <div id="main" ></div> </div> <?php include("includes/footer.php"); ?> And #wrap class is: #wrap { margin: 0 auto; width: 90%; }
-
No they are not separated, i use like this: <div id="sidebar-left">....</div> <div id="sidebar-right">....</div> <div id="main">....</div> What should i do?
-
#main { float: left; margin: 0; margin-left: 1%; width: 65%; padding: 0 2px 0px 2px; } #sidebar-left { float: left; width: 16%; margin: 0; padding: 0; background-color: #FFFFFF; } #sidebar-right { float: right; width: 16%; margin: 0; padding: 0; margin-left: 1%; background-color: #FFFFFF; } You see, problem is at #main, while is left side there webpage is good, but on bottom, when there is not left side, now main become left :S How can i fix that?
-
That works, but now i got another problem, see the pic:
-
Is there any example code for like, dislike button for my php code, to save likes and dislikes from members on mysql, but to dont refresh page when clicked on Like, i mean to use java ?
-
I have done that, but there is new problem, my webpage now dont have good look, its tight, i mean there is no space between left, main and right panel, i wonna to put left 16%, main 66%, right 16%, then 2% will be between. Can i make that ?
-
I tried that, but it does not work :S
-
I have webpage with sidebar(on left side) and main (where are news), now i wonna to make 1 more sidebar on right side. But i cant make that, can someone help me ? Here is style for sidebar left and main: #sidebar-left { float: left; width: 16%; margin: 0; padding: 0; background-color: #FFFFFF; } #main { float: right; margin: 0; padding: 0; width: 66%; } I tried to make #sidebar-right, and i put float: right; and width: 16%;, but i dont know what to to with #main, becouse there is float: right;, when i remove that fload from #main, than side gone crazy, i mean design of webpage. How can i make that work?
-
Ok, thanks
-
But when i use that function, it will echo me without <b> <u>.... and i wonna to echo that news as it is but just to show 100, hmm i dont know how to understand :S
-
I have front page and page for news, and i wonna to set, on front page to show news but only 100 characters, and on news page to be all text, i done that with substr($news, 0, 100); but i have proble, when i have in $news text like this: Hi everyone. <b>Bold</b> now, subsrt count <b> and </b> like characters, how can i escape that <b> </b>, <u> </u> and other?
-
I use function like this now: function bbcode($input){ $input = strip_tags($input); $search = array( '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[quote\](.*?)\[\/quote\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url=http://(.*?)\](.*?)\[\/url\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[yt\]http:\/\/(?:www\.)?youtube\.com\/watch\?v=(.*?)\[\/yt\]/is', ); $replace = array( '<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<code>$1</code>', '<blockquote>$1</blockquote>', '<img src="$1" style="border:0">', '<a href="$1">$2</a>', '<font style="color:$1">$2</font>', '<object width="580" height="360"> <param name="movie" value="http://www.youtube.com/v/$1?fs=1&hl=sr_RS&border=1" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="580" height="360" src="http://www.youtube.com/v/$1?fs=1&hl=sr_RS&border=1" allowscriptaccess="always" allowfullscreen="true"></embed> </object>', ); return nl2br(preg_replace($search,$replace,$input)); } That is wrong, or no ? How can i use this function on right way ? :/