Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Wont insert correctly..
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Markshall" data-source="post: 32649" data-attributes="member: 1872"><p>Quite possibly the most horrible coding I've ever seen.</p><p></p><p>You have semi-colons and single-quotes in random places for no reason.</p><p></p><p>This should work, I've tidied it up for you:</p><p></p><p>[php]<?php </p><p>if($assoc['rank'] <5) </p><p>{ </p><p> exit; </p><p>}</p><p>else</p><p>{</p><p> $title = $_POST['title']; </p><p> $shortstory = $_POST['shortstory']; </p><p> $banner = $_POST['banner']; </p><p> $content = $_POST['content']; </p><p> $sent = $_POST['sent']; </p><p> if($sent != 'yes')</p><p> { </p><p> echo '<form name=\'postnews\' action=\'?page=news\' method=\'post\'> </p><p></p><p> <alert> </p><p> <develop>Creating news is currently broken!</develop> </p><p> </p><p> <br> </p><p> </p><p> Like some other features in this development build of Cores new housekeeping, Creating news is currently broken. If you would like an article </p><p> posted, then please contant an Administrator with Database access. </p><p> </p><p> <br><br> </p><p> </p><p> Sorry for any inconvenience. </p><p> </alert> </p><p> </p><p> <br> </p><p> </p><p> <center> </p><p> </p><p> <b>Title:</b><br> </p><p> <input type=\'text\' name=\'title\' maxlength=\'20\'> </p><p> <br> </p><p> <b>Short Story:</b><br> </p><p> <input type=\'text\' name=\'shortstory\' maxlength=\'50\'> </p><p> <br> </p><p> <b>Banner URL (click <a href="../Public/Images/news/" target="_BLANK">here</a>):</b><br> </p><p> <input type=\'text\' name=\'banner\' maxlength=\'500\'> </p><p> <br> </p><p> <b>Full Story:</b><br> </p><p> <textarea class="ckeditor" cols=30 rows=7 name=\'content\'></textarea> </p><p> <br> </p><p> <input type=\'submit\' value=\'Post\'> </p><p></p><p> <input type=\'hidden\' name=\'sent\' value=\'yes\'> </p><p> </form></p>'; </p><p> }</p><p> else </p><p> {</p><p> $time = time();</p><p> $query = mysql_query("INSERT INTO cms_news (`title`, `shortstory`, `longstory`, `author`, `published`, `image`, `campaign`, `campaignimg`) VALUES ('".$title ."', '".$shortstory ."', '".$content ."', '1', '".$time."', '".$banner ."', '0', '');"); </p><p> echo "<center><h1>Article posted!</h1></center>"; </p><p> }</p><p>}</p><p>?>[/php]</p></blockquote><p></p>
[QUOTE="Markshall, post: 32649, member: 1872"] Quite possibly the most horrible coding I've ever seen. You have semi-colons and single-quotes in random places for no reason. This should work, I've tidied it up for you: [php]<?php if($assoc['rank'] <5) { exit; } else { $title = $_POST['title']; $shortstory = $_POST['shortstory']; $banner = $_POST['banner']; $content = $_POST['content']; $sent = $_POST['sent']; if($sent != 'yes') { echo '<form name=\'postnews\' action=\'?page=news\' method=\'post\'> <alert> <develop>Creating news is currently broken!</develop> <br> Like some other features in this development build of Cores new housekeeping, Creating news is currently broken. If you would like an article posted, then please contant an Administrator with Database access. <br><br> Sorry for any inconvenience. </alert> <br> <center> <b>Title:</b><br> <input type=\'text\' name=\'title\' maxlength=\'20\'> <br> <b>Short Story:</b><br> <input type=\'text\' name=\'shortstory\' maxlength=\'50\'> <br> <b>Banner URL (click <a href="../Public/Images/news/" target="_BLANK">here</a>):</b><br> <input type=\'text\' name=\'banner\' maxlength=\'500\'> <br> <b>Full Story:</b><br> <textarea class="ckeditor" cols=30 rows=7 name=\'content\'></textarea> <br> <input type=\'submit\' value=\'Post\'> <input type=\'hidden\' name=\'sent\' value=\'yes\'> </form></p>'; } else { $time = time(); $query = mysql_query("INSERT INTO cms_news (`title`, `shortstory`, `longstory`, `author`, `published`, `image`, `campaign`, `campaignimg`) VALUES ('".$title ."', '".$shortstory ."', '".$content ."', '1', '".$time."', '".$banner ."', '0', '');"); echo "<center><h1>Article posted!</h1></center>"; } } ?>[/php] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Wont insert correctly..
Top