-
Posts
1,200 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by divinedesigns1
-
now im having problems with the edit page 0.o i selected a news to be edited but it doesnt display it and the same method i use for the news.php page isnt working either blah <?php$dbhost = ''; // These have a value i just remove it so i can display it on the forum$dbuser = '';$dbpass = '';$dbname = '';$con = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);if((isset($_GET['id'])) && (is_numeric($_POST['id']))){$id = $_GET['id'];}elseif ((isset($_POST['id'])) && (is_numeric($_POST['id']))){$id = $_POST['id'];}else{echo 'Please choose a news post to edit';exit();}if(isset($_POST['submitted'])){$error = array();if(empty($_POST['title'])){ $error[] = 'You forgot to enter a title. ';}else{ $title = $_POST['title'];}if(empty($_POST['name'])){ $error[] = 'You forgot to enter an author.';}else{ $name = $_POST['name'];}if(empty($_POST['message'])){ $error[] = 'You forgot to enter a message';}else{ $message = $_POST['message'];}if(empty($errors)){ $query = "UPDATE news SET title='$title', author='$name', post='$message' WHERE id=$id"; $result = mysqli_query($con, $query); if($result){ echo "News post has been updated!"; }else{ echo 'News post could not be updated.'; }}else{ echo 'news post could not be updated for the following resions -<br />'; foreach($errors as $msg){ echo "- $msg<br />\n"; }}}else{$query = "SELECT title, author, post, id FROM news WHERE id=$id";$result = mysqli_query($con, $query);$num = mysqli_num_rows($result);$row = mysqli_fetch_array($result, MYSQLI_NUM);$title = $row['0'];$name = $row['1'];$message = $row['2'];if($num == 1){ echo '<h3>Edit news post</h3> <form action"?id=edit_news$num='.$id.'" method="post"> <p>News Title: <input type="text" name="title" size="25" maxlength="255" value="'.$title.'" /></p> <p>Name: <input type="text" name="name" size="15" maxlength="255" value="'.$name.'" /></p> <p>Message:<br /><textarea row="5" cols="40" name="message">'.$message.'</textarea></p> <p><input type="submit" name="submit" vaule="submit" /></p> <input type="hidden" name="id" value="'.$id.'" />';}else{ echo 'news post could not be edited, please try again.';}}?>
-
correction dsone, that worked, what i did was, remove the MyConnect.php and placed it into the news.php script itself then i remove the if statement for the connection to the database, which enable me to displayed whatever is in the database
-
that didnt work either dsone
-
hello, how can i make my php form delivery the mail faster from a html form? like if i want the mail to be in my inbox in lets say 5mins top how can i do this
-
yeah, i did that but for some reason it still isnt showingthis is what i didinclude('MyConnect.php');$query = "SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news";$result = mysqli_query($con, $query); im thinking about doing this $dbhost = "";$dbuser = "";$dbpass = "";$dbname = "";$con = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die('can not connect to database');$query = "SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news";$result = mysqli_query($con, $query); i think this would work better
-
greetings creative, and yea i notice that because some of the websites that uses.gif loads a lot faster than some of my websites that uses .jpeg, then again i like to have my images quality to the best, bad habit, but i think that shouldnt be the problem with the loading, so imma be testing it, to see how its possible i got a question for you creative, how you do the animation with gif? i tried it but lol yea i tried it
-
the error is removed but there's no news displaying still sigh
-
doesnt jpeg load faster than a gif image on a website ? or does it depend on how you use it?
-
thank foxy, ill try that now, and sorry for the late reply was sleeping
-
hey sup, me again kill me tmr lol jk jk anyway im trying to make a new system, "got a complain, after the person saw something pssssh" so now im working to make a news system and i was wondering how i can make mines look like this one http://www.talismanonline.com/ where it says "news" i dont want the styple but the part where there's a link, i know i need php and i need to make the id into a link with a <br /> tag after each link. but i dont know how to if i have to do it something like echo '<a href"'.$row['id'].'">$title</a>' . $row[date]; so it could automatically place the news in place whenever someone create a new news. also how can i make the admin side of the news html writeable? or do i have to use an editor like tinyeditor, etc
-
oh ok
-
so i went and mess up with the codes for a little, and i did the following with the code, remove the "i" from MYSQLI_ASSOCchange $result = mysql_query($query) and i got this error Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/14/8709614/html/news/news.php on line 18Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/14/8709614/html/news/news.php on line 18There are no news posts to displaynotice the "there are no news posts to display" still tormenting me ill get to the bottom of this...........stupid echo lol
-
does it matter if i use mysqli when im support to be mysql?
-
I redid the mysqli_error() function and i got this error now but i think im doing this all wrongfunction openComments(url){comments = window.open(url, "Comment", "menubar=0, resizable=0, width=380, height=480");comments.focus();}</script></head><body><?phpinclude('MyConnect.php');if(!$con -> query("SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news")){printf("Errormessage: %s\n", $mysqli->error);}$result = mysqli_query($con, $query);if($result){while($row = mysql_fetch_array($result, MYSQLI_ASSOC)){ $url = 'comments.php?id=' . $row['id']; echo '<p><br>' . $row['title'] . '</b></br>' . $row['sd'] . '<br /> Posted by: <br>' . $row['author'] . '</b><br />' . $row['post'] . '<br /> <a href="javascript:openComments(\''.$url.'\')">Add New Comment or View posted comments</a></p>';}}else{echo 'There are no news posts to display';}?>
-
ok i did the mysqli_error() and got no error pssssh
-
ok thanks birbal
-
heya, me again, im having a problem with displaying my news after i post it, <?phpinclude('MyConnect.php');$query = "SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y) as sd FROM news";$result = mysqli_query($con, $query);if($result){while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){ $url = 'comments.php?id=' . $row['id']; echo '<p><br>' . $row['title'] . '</b></br>' . $row['sd'] . '<br /> Posted by: <br>' . $row['author'] . '</b><br />' . $row['post'] . '<br /> <a href="javascript:openComments(\''.$url.'\')">Add New Comment or View posted comments</a></p>';}}else{echo 'There are no news posts to display';}?> i kept looking over it but i dont see anything wrong with iti been studying this code and reviewing it for a few mins well, i notice i had spelled mysqli_fetch_array() wrong, so i corrected that but that wasnt it, then i notice i had $row['$post'] but so i corrected that also but that wasnt it either. am i missing something? i had also change the fetch function from mysqli_fetch_array() to mysql_fetch_array() but that still wasnt it, now im thinking its the $query that is giving the problem but how is it giving a problem im not too sure, but on the other hand, it's displaying the echo 'There are no news posts to display'; so something is working but something isnt working, ahhhh ill go take a walk
-
yeah thats what i been doing, no wonder i aint fine anything lol, thanks man, now ill go look for that instead ill prolly like js more than php and flash lol
-
ok got it now, thanks Err, and why you named yourself Err? ok kool thanks so called sorry for the late reply guys, was sleeping
-
yea, but since i only did the archor css it displayed on all the other links, but it was awwsome whiles it lated lol gotta use that for a menu someday
-
ok got it now, so it only goes in a 90degree, with a blue and spread, color, etc
-
hey sup, im trying to figure out which is the top left bottom right for the box-shadow operation because i acidentally created a menu by mistake and i want the bottom shadow to be remove lol so i have box-shadow: 5px 5px 5px #000;
-
question, wouldnt i have to place the $firstname = $_POST['firstname'];[...] for each? or do i just have to place $firstname = (isset($_POST['firstname'])) ? preg_replace("/[^A-Za-z0-9]/","",$_POST['firstname']) : "";$lastname = (isset($_POST['firstname'])) ? preg_replace("/[^A-Za-z0-9]/","",$_POST['firstname']) : "";$company = (isset($_POST['firstname'])) ? preg_replace("/[^A-Za-z0-9]/","",$_POST['firstname']) : "";etc
-
yea, apple devices are the annoying ones who doesnt support flash and yeah i have been trying to fine a good toturial on how to use it to make a website but blah all crap
-
ok ill switch it around, in the morning, time to go play a little game, upgrade this site template then fight with the Z's. thanks again