Jump to content

wizzkid

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wizzkid's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, can you help me on my news article? I would like to be able to add photo on the article. Below is my codes Hope you guys can help me. Thanks!
  2. Also, if you guys could help me on how to add a photo on article, it will be a great help! much better if the photo will be save on the servers folder instead on database. hope you can give me an insight. Thanks!
  3. So far this is the only code I have for now. I still dont have the code for comments. ======= html ======= <?php include_once ('post_news.php'); ?> <form Action="add_news.php" Method="post"> <input name="postdate" type="text" id="postdate"> <input name="title" type="text" id="title"> <textarea name="newstext" cols="60" rows="15" id="newstext"></textarea> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </form> ============== php - post_news.php ============== <?php ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); if (isset ($_POST['submit'])) { require_once ('inc/dbConfig.php'); // Define the query. $query = "INSERT INTO news (id, postdate, title, newstext) VALUES (0,'{$_POST['postdate']}', '{$_POST['title']}','{$_POST['newstext']}')"; // Execute the query. if (@mysql_query ($query)) { print "<p>Data has been added.</p>"; } else { print "<p>Could add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>"; } mysql_close(); } ?> ===== db structure ====== id int(10) unsigned NOT NULL auto_increment, postdate timestamp(14), title varchar(50) NOT NULL, newstext text NOT NULL, PRIMARY KEY (id), KEY postdate (postdate) Thanks a lot for your help guys!
  4. Hello, I am trying create a news article, but I have few category in it. Can you help me to create an "add article form" which has dropdown list of category that I can choose, so when I select "Announcement" it will save the data on my mysql database under announcement table. sample html form below. <form id="form1" name="form1" method="post" action=""> <label> Category : <select name="category" id="category"> <option>--- choose category ---</option> <option>News</option> <option>Announcement</option> <option>Sports</option> </select> </label> <br /> Date: <br /> Title: <label> <input type="text" name="title" id="title" /> </label> <br /> Body: <label> <textarea name="body" id="body" cols="45" rows="5"></textarea> </label> <br /> <label> <input type="submit" name="Submit" id="Submit" value="Submit" /> </label> <br /> <br /> </form> Can you tell me how to create the php code which support the above html. Also, I would like to have a date and time on my article, but I want it automatically get the time and date from the computer of the client, so the user will not put it manually. can you point me to the correct code? Thanks and hope you can help me!
  5. I have manage to create my own script that add news article, however, I would like to add a comment form below the news article. How can I relate the news and the comments? also, when I delete the articles, it should also delete the comments in mysql. Your help is highly appreciated!
  6. Hi! I am wondering if a font type can be uploaded and used on html. Upon designing a webpages, we/I used a specific font/s let say "arial".  and when serve to the inetrnet and somebody tried to access the site, but that user doesnt have the font use, it will automatically use its defualt text right? Is there a way to upload the specific font and put a script on the page to use the uploaded font? Please let me know how to do it Thanks a lot.
  7. Yeah! sorry it was bad.. :) I failed to put the ' ' its working now, Thanks.
  8. Hi I create this script to edit an article on my news section.. But I encounter this error Could update the entry because: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. The query was UPDATE news SET date='2006-06-27', title='', article='' WHERE int_id=. This is my edit_news.php code [code] <?php ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); require_once ('../include/LeePH/mysql_connect.php'); if (isset ($_POST['submit'])) { // Define the query. $query = "UPDATE news SET date='{$_POST['date']}', title='{$_POST['vc_title']}', article='{$_POST['vc_article']}' WHERE int_id={$_POST['id']}"; $r = mysql_query ($query); // Report on the result. if (mysql_affected_rows() == 1) { print '<p>The blog entry has been updated.</p>'; } else { print "<p>Could update the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>"; } } else { // Display the entry in a form. // Check for a valid entry ID in the URL. if (is_numeric ($_GET['id']) ) { // Define the query. $query = "SELECT * FROM news WHERE int_id={$_GET['id']}"; if ($r = mysql_query ($query)) { // Run the query. $row = mysql_fetch_array ($r); // Retrieve the information. // Make the form. print '<form action="edit_news.php" method="post"> <p>Entry Date: <input type="text" name="date" size="40" maxsize="100" value="' . $row['date'] . '" /></p> <p>Entry Title: <input type="text" name="title" size="40" maxsize="100" value="' . $row['vc_title'] . '" /></p> <p>Entry Text: <textarea name="article" columns="40" rows="5">' . $row['vc_article'] . '</textarea></p> <input type="hidden" name="int_id" value="' . $_GET['id'] . '" /> <input type="submit" name="submit" value="Update this Entry!" /> </form>'; } else { // Couldn't get the information. print "<p>Could retrieve the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>"; } } else { // No ID set. print '<p><b>You must have made a mistake in using this page.</b></p>'; } } // End of main IF. mysql_close(); // Close the database connection. ?> [/code] I am using these version of software: OS: Kubuntu 6.06 Dapper mySQL: MySQL 5.0.22-Debian_0ubuntu6.06-log PHP: PHP 5.1.2 Apache:Apache/2.0.55 My Database Structure int_id  - int date - date vc_title - string vc_article - string Thanks hope you can help!
  9. Hey guys, thank you so much for the help! really appreciate it a lot :)
  10. how can i declare session? can you point me where to get docs and how to do it? sorry im newbie :)
  11. Hi Guys, I made a contact form that actually the value to the specified email address. What it does is let the user verify the detail entered and send to the email and have a reciept. My problem lies on the reciept. Here's my pages http://www.leeph.net/pastebin/test/ Everything is working. contacts.php verify.php mailman.php reciept.php note: on verify.php action=mailman.php and redirect = reciept.php What I want to do is display: Thank you NAME, we will respond you at EMAIL. What I did is on reciept.php, i put: [code]<? print "Thank you".$_POST['fname']."<br>;" ?>[/code] I am not sure if its the correct syntax. I used the $_POST['fname'] on verify.php and it worked. Should you need some clarification about this setup. let me know. hoping a response to this matter. Thanks.
  12. Hi Guys, I am currently learning how to use css, on index.hml I add <LINK href="<style.css" type=text/css rel=stylesheet>  the content of my style.css is [code]A:link { FONT-SIZE: 9px; COLOR: #303030; FONT-FAMILY: Arial; TEXT-DECORATION: none } A:visited { FONT-SIZE: 9px; COLOR: #303030; FONT-FAMILY: Arial; TEXT-DECORATION: none } A:hover { FONT-SIZE: 9px; COLOR: #303030; FONT-FAMILY: Arial; TEXT-DECORATION: underline }[/code] It worked well. however, I want to have a multiple link style and color, in index.html i want to create 1. news box, 2. announcement box 3. my menu. on 1.news box, i wanted to make it blue when I hovered the link, 2. announcement, i would like to make it red when hovered.  etc. I believe it can be done using <div> but I dont know how. Can somebody tell me how to do it? :) Also, how to use <fieldset></fieldset>? :) Thanks a lot :)
  13. [!--quoteo(post=387962:date=Jun 26 2006, 03:16 AM:name=hackerkts)--][div class=\'quotetop\']QUOTE(hackerkts @ Jun 26 2006, 03:16 AM) [snapback]387962[/snapback][/div][div class=\'quotemain\'][!--quotec--] Already, hmm sorry I don't think I could help out on time. School open, and my stupid teacher giving me tons of homework. >.< I don't think I really have the time to play lolz. :s If you had any problem feel free to ask others. :D [/quote] Hi Hackerkts, Thank you so much for your help! I was able to secure my pages :) it work using session :) Thanks again!
  14. Hi Hackerkts, Thanks a lot for the help! :) you should not worry about add edit delete, I was able to do so, I am looking right now is how to protect my add edit delete page using authentication. My add edit delete page was working, i just need to have an authentication methid to protect them. As far as live demo site, I still havent upload the files to my server, its still in my local computer. :) once again thanks you :)
  15. [!--quoteo(post=387731:date=Jun 25 2006, 06:49 AM:name=hackerkts)--][div class=\'quotetop\']QUOTE(hackerkts @ Jun 25 2006, 06:49 AM) [snapback]387731[/snapback][/div][div class=\'quotemain\'][!--quotec--] >.<! It couldn't be totally empty, is that the full script in your news.php ? [/quote] which one? which >.<? no its not the full script. what I did was to use include_once($path."mysql_connect.php"); include_once($path."getNews.php"); // <-- content of this is the script, where known as news.php. Now I am looking a way to echo "sorry database empty" if the database is totally empty. otherwise, the script was working :) Also I am looking for script to protect my add_news.php and delete_news.php and edit_news.php, you might have a suggestion for this? I am looking the one with user database so the user could add account to other users which is authorized to add news to the site, however, the simply authenticaion method will do as of yet. Thanks again in advance. :)
×
×
  • 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.