Jump to content

TGWSE_GY

Members
  • Posts

    255
  • Joined

  • Last visited

    Never

Everything posted by TGWSE_GY

  1. Okay after pouring over this code, I don't see where the issue is. Is there any reason why an update query would fail to update the record that it is suppose to. Thanks
  2. I have echoed the '$id' and it is returning the appropriate value.
  3. We are a willingly helpful community of coders, and to offer to pay is almost an insult to what we do here at PHPPhreaks, not to mention to offer to pay and then not, how unrespectable! I agree with onedumbcoder.
  4. Ok guys, I will attach the code below. When this scripts run I have echoed all variables and they return the correct values, however it executes the mysql update query in CASE 0 and returns no errors however it does NOT update the corresponding record in the database. I have ran the query in terminal mode and it works just fine. The mysql database connection info held in config.php is correct and I have no idea why this query is not working. <?php //This script will process the updates to the article that is designated by the sectionid passed from the previouse php page in the form. //Then we will take this and store it into the correct table of the database. Remember we always call our database configuration at the start. //Get database connectiong config include('phpcontent/config.php'); $id = $_POST['id']; $date = date(mdo); $tblnews = "sndsurf_news"; $tblreviews = "sndsurf_reviews"; $tblradio = "sndsurf_radio"; //Get the entries from the form. $section = $_POST['section']; $title = addslashes($_POST['title']); $new_article = $_POST['article']; $summary = addslashes($_POST['summary']); $search = "src=\"http://www.hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/images"; $replace = "src=\"images"; $article = str_replace($search, $replace, $new_article); $article = addslashes($article); switch ($section) { case 0: //News mysql_query("UPDATE sndsurf_news SET title='$title', article='$article', summary='$summary', date='$date' WHERE id='$id'") or die(mysql_error()); $sectionid = "edit_news"; break; case 1: //Radio $tbl = $tblradio; mysql_query("INSERT INTO `$tblradio` ( article , date) VALUES ('$article', '$date')") or die(mysql_error()); $sectionid = "edit_radio"; break; case 2: //Reviews $tbl = $tblreviews; mysql_query("INSERT INTO `$tblreviews` ( article , date) VALUES ('$article', '$date')") or die(mysql_error()); $sectionid = "edit_reviews"; break; } header("Location: http://www.hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/admin/classes/forms/maineditor.php?section=edit_news"); ?> Thanks Guys :facewall: :facewall:
  5. Ok I fixed it, the issue was I was creating a form within a form and it was somehow messing with the propagation of the first button in the form for selecting the first article. Thanks
  6. OK I fixed those problems and the first button is still not working.
  7. Hey guys, once again have 2 pages here, the first one news.php displays the articles that the user may edit and by clicking that button the article should be displayed in the following page, get_news.php. However for some reason the first button on news.php does not work but the other 3 buttons do. When the first button is clicked the news.php is reloaded rather then being forwarded to the get_news.php. news.php: <?php //Get database connectiong config include('config.php'); $tbl = "jamsmag_news"; //Get title from db $query = "SELECT * FROM $tbl"; $result = mysql_query($query) or (mysql_error()); while ($row = mysql_fetch_assoc($result)){ $id = $row['id']; $title = $row['title']; echo $title; echo "<form method=\"post\" action=\"maineditor.php?section=edit_get_news\"><input type=\"hidden\" value=\"$id\" name=\"id\" id=\"id\"><input type=\"submit\" value=\"EDIT ARTICLE\"></form>"; } ?> get_news.php: <?php //Get database connectiong config include('config.php'); $id = $_POST['id']; $tbl = "jamsmag_news"; //Get title from db $query = "SELECT * FROM $tbl WHERE id='$id'"; $results = mysql_query($query) or (mysql_error()); $resultsarray = mysql_fetch_assoc($results) or die(mysql_error()); $title = $resultsarray['title']; $article = $resultsarray['article']; $summary = $resultsarray['summary']; $search = "src=\"images"; $replace = "src=\"http://hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/images"; $article_edited = str_replace($search, $replace, $article); $article = $article_edited; //Title echo "<center><h2>TITLE</h2></center>"; $oFCKeditor = new FCKeditor('title') ; $oFCKeditor->ToolbarSet = 'title'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '20%' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $title ; $oFCKeditor->Create() ; //Article echo "<center><h2>ARTICLE</h2></center>"; $oFCKeditor = new FCKeditor('article') ; $oFCKeditor->ToolbarSet = 'article'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '512' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $article ; $oFCKeditor->Create() ; //Summary echo "<center><h2>SUMMARY</h2></center>"; $oFCKeditor = new FCKeditor('summary') ; $oFCKeditor->ToolbarSet = 'summary'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '50%' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $summary ; $oFCKeditor->Create() ; ?> http://www.hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/admin/classes/forms/maineditor.php?section=edit_news Thanks Guys
  8. Sorry for the caps, figured it out it was my browser cache sorry for the confusion guys. Thanks
  9. Okay, everything is duplicating multiple times when this script runs, I have checked and checked and trippled checked. It should not be happening, there are two files here maineditor.php <?php //Get database connectiong config include('config.php'); $tbl = "jamsmag_reviews"; //Get title from db $query = "SELECT * FROM $tbl ORDER BY id DESC LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); $resultarray = mysql_fetch_assoc($result) or die(mysql_error()); $title = $resultarray['title']; $article = $resultarray['article']; $summary = $resultarray['summary']; $search = "src=\"images"; $replace = "src=\"http://hmtotc.com/dev/projects/VRassoc/soundsurfer.biz/images"; $article_edited = str_replace($search, $replace, $article); $article = $article_edited; //Title $oFCKeditor = new FCKeditor('title') ; $oFCKeditor->ToolbarSet = 'title'; $oFCKeditor->Width = '75%' ; $oFCKeditor->Height = '20' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $title ; $oFCKeditor->Create() ; //Article $oFCKeditor = new FCKeditor('article') ; $oFCKeditor->ToolbarSet = 'article'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '512' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $article ; $oFCKeditor->Create() ; //Summary $oFCKeditor = new FCKeditor('summary') ; $oFCKeditor->ToolbarSet = 'summary'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '100' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $summary ; $oFCKeditor->Create() ;U ?> and news.php <?php //Get database connectiong config include('config.php'); $tbl = "jamsmag_news"; //Get title from db $query = "SELECT * FROM $tbl ORDER BY id DESC LIMIT 1"; $result = mysql_query($query) or (mysql_error()); $resultarray = mysql_fetch_assoc($result) or (mysql_error()); $title = $resultarray['title']; $article = $resultarray['article']; $summary = $resultarray['summary']; $search = "src=\"images"; $replace = "src=\"http://hmtotc.com/dev/projects/VRassoc/soundsurfer.biz/images"; $article_edited = str_replace($search, $replace, $article); $article = $article_edited; //Title echo "<center><h2>TITLE</h2></center>"; $oFCKeditor = new FCKeditor('title') ; $oFCKeditor->ToolbarSet = 'title'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '20%' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $title ; $oFCKeditor->Create() ; //Article echo "<center><h2>ARTICLE</h2></center>"; $oFCKeditor = new FCKeditor('article') ; $oFCKeditor->ToolbarSet = 'article'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '512' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $article ; $oFCKeditor->Create() ; //Summary echo "<center><h2>SUMMARY</h2></center>"; $oFCKeditor = new FCKeditor('summary') ; $oFCKeditor->ToolbarSet = 'summary'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '50%' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $summary ; $oFCKeditor->Create() ; ?> Also here is a link so you can see what is going on http://www.hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/admin/classes/forms/maineditor.php?section=edit_news For the world of me I cannot seem to see where the problem is. As this works on another domain with no issues whatsoever. Thanks Guys! :facewall: :facewall:
  10. Thanks neil worked like a charm!!!!!!! Appzmaster thanks but neils solution is what I needed, and the if statement structure is fine. Especially now that Im using preg match all. Thanks Guys!
  11. :facewall: :facewall: :facewall: :facewall: Hi Guys, First I want to say yes the language is part of the script to ignore comments with these 7 cuss words in them. However it is still going to my else and adding it to the table and I just want it to stop and go the the defined header location if any of the 7 words are found. Can anyone tell me why its adding to the database? Here is the code: <?php include('db_con.php'); $filename = $_POST['filename']; $comment = $_POST['comment']; $currentpage = $_POST['currentpage']; $adminaddress = "http://www.hmtotc.com/private/george/projects/dandj/admin/admin.panel.php"; $shit =substr_count($comment, "shit"); $piss =substr_count($comment, "piss"); $fuck =substr_count($comment, "fuck"); $cunt =substr_count($comment, "cunt"); $cocksucker =substr_count($comment, "cocksucker"); $motherfucker =substr_count($comment, "motherfucker"); $tits =substr_count($comment, "tits"); if ($shit || $piss || $fuck || $cunt || $cocksucker || $motherfucker || $tits){ header('Location: http://www.hmtotc.com/private/george/projects/dandj/index.php?currentpage=' . $currentpage); } elseif ($comment === "comment"){ header('Location: http://www.hmtotc.com/private/george/projects/dandj/index.php?currentpage=' . $currentpage); } else { $imgcommentquery = "INSERT INTO `comments` ( imgname , comments ) VALUES ('$filename', '$comment')"; mysql_query($imgcommentquery); $to = "george@visualrealityink.com"; $subject = "New Comments"; $body = "<p>New Comments have been made please click the link below to allow or delete comments</p><p>$adminaddress</p>"; mail($to, $subject, $body); header('Location: http://www.hmtotc.com/private/george/projects/dandj/index.php?currentpage=' . $currentpage); } /*$to = "photographer@dnjphotography.net"; $subject = "New Comments"; $body = "<p>New Comments have been made please click the link below to allow or delete comments</p><p>$adminaddress</p>"; mail($to, $subject, $body); */ ?> Thanks
  12. its stored in a database, also the HTML is stored in the db too. As there is a back end for editing it is not static. Thanks
  13. starting at <p><strong> and ending at </p>
  14. I am wanting to start at <p><strong> and end at </p> then shorten the string which I already know how to do. Thanks
  15. :facewall: :facewall: :facewall: Here is the code for the news section on a website I am working, http://hmtotc.com/dev/projects/VRassoc/jamsmagazine.com/index.php. <html> <body> <p><img src="images/jams-magazine-news.gif" width="150" height="20"></p> <p><strong>Beyonce and Des'ree in legal battle</strong><br> <em>Rob Barnett</em> </p> <p>Beyonce is set to be sued by English 1990’s pop soul singer, Des’ree, for not seeking permission to use her song 'I’m Kissing You’. The American superstar did not complete the deal to secure the right to record the track, yet went ahead with its production and a subsequent promo video.</p> <p>Des’ree shot to UK fame for her catchy 1994 smash 'You Gotta Be’, is trying to block the distribution of the song, titled 'Still in Love (Kissing You) on video and Beyonce’s solo album, Bday, Deluxe Edition.</p> <p>But who is better? Beyonce or Des’ree? There’s only one way to find out. FIGHT!!!!!<br> </p> <p><strong>No more Gorillaz studio albums</strong><br> <em>Rob Barnett</em></p> <p>Gorillaz have decided not to record anymore studio albums. 2005’s Demon Days, the follow up to the self titled debut of 2001, is the second and final one, although there is one final project in the pipeline. Damon Albarn confirmed that the cartoon musicians will feature in a film, possibly involving Monty Python legend, Terry Gilliam.</p> <p>Albarn recently told BBC Radio 2 'We're trying to make a film next, starting in September hopefully. It will be a film score. There won't be another pop record."</p> <p>Noodle, Murdoc, 2D and Russel are likely to take starring roles in the film.<br> </p> <p><strong>Madonna Takes Adopted Son From Malawi</strong><br> <em>The Associated Press</em></p> <p>Madonna jetted out of the Malawi on Sunday after a six-day visit to the impoverished homeland of the toddler she wants to adopt, carrying the boy in her arms as she boarded her plane.</p> <p>Madonna and her husband, the film producer Guy Ritchie, took custody of David Banda last October after finding him in an orphanage. Critics said the 48-year-old star used her celebrity status to circumvent Malawian adoption laws — allegations she denies.</p> <p>The 20-month-old toddler waved to the bodyguards and driver who had escorted him during the visit. Madonna, wearing her now familiar straw hat, did not look back as she disappeared into the silver jet, with her daughter Lourdes following.<br> The star and her entourage spent their time visiting orphanages, projects for street children and agricultural development programs as well as opening a new day care center funded by her charity, Raising Malawi.</p> <p>Madonna, who lives in London, made one visit to the Home of Hope orphanage, where David lived after his death of his mother in childbirth. There was no sign that Madonna had met with Yohane Banda, the peasant farmer who placed his son in the orphanage saying he was too poor to care for him.</p> <p>It was also unclear whether Yohane Banda met alone with his son, as he had hoped.</p> <p>David's mother died of complications in childbirth and his two siblings died of malaria in infancy.</p> <p>Although a coalition of human rights groups challenged Madonna's adoption plans in the courts, many locals says they are happy that the celebrity has drawn attention to Malawi, which usually makes news because of drought, hunger and the occasional political scandal.</p> <p>Madonna's childcare center aims to provide education, food and health care for up to 4,000 children. It is based on Kabbalah, Judaism's mystical sect, which counts the singer among its devotees.</p> <p>Malawian child welfare officials are expected to file a report on the suitability of Madonna and Ritchie, as adoptive parents after two trips to their London residence in May and December. The singer has two other children, Lourdes, 9, and Rocco, 6.<br> </p> <p><strong>Brown's Trust Owes $70,000 for Funeral</strong><br> <br> The trust handling James Brown's estate owes more than $70,000 for his elaborate funeral and care of his body for nearly three months before it was laid to rest in March, according to the funeral director who handled the soul singer's arrangements.</p> <p>"I'm just waiting on them to get some of this mess straightened out," said Charles Reid, manager of the C.A. Reid Funeral Home in Augusta, Ga., which handled Brown's funeral. "I really haven't pushed the issue, even though I'd like to have my money."</p> <p>Some of the funeral costs have already been paid and trustees have mailed a check to Reid this week covering the outstanding balance, Brown's longtime adviser and trustee Buddy Dallas said Wednesday.</p> <p>"It was the children that ran up a funeral bill of over $150,000, not the trustees," Dallas said. "We've done our very best to do what we could to accommodate the creditors. There's no great big pile of money or surplus of money just lying around."</p> <p>Louis Levenson, an attorney for Brown's six adult children, said Wednesday it is the trust's responsibility to pay for the funeral costs, which he considers a "reasonable" amount.</p> <p>Brown's children filed a motion this week asking a judge to provide accounting records of Brown's trust and estate before and after the singer's death, Levenson said.</p> <p>Brown's children also filed two other motions Tuesday. One claims Brown's trustees have been trying to sell off some of their father's assets against court orders and the second motion asks a judge to modify his previous order that appointed two special administrators to help Brown's trustees settle his estate, giving them more control.</p> <p>Dallas called the allegations in the motion "bogus and baseless."</p> <p>"The trustees and the personal representatives are certainly not going to do anything — as much scrutiny as this has been given — improper, inappropriate and certainly not illegal," Dallas said.</p> <p>A hearing is scheduled for later this month on the motions filed by Brown's children and a motion filed on behalf of the singer's partner, Tomi Rae Hynie.</p> <p>She is asking a judge to appoint a special guardian for her son, the first step toward determining the child's paternity.</p> <p>An e-mail and a message left for Robert Rosen, Hynie's attorney, was not immediately returned Wednesday.</p> <p>Brown died Dec. 25 in an Atlanta hospital and his body was placed in a crypt at the Beech Island home of one of his daughters March 10.</p> <p>The crypt might not be Brown's final resting place. Brown's family has said a public mausoleum will be built and its location will be announced once it is completed.</p> </body> </html> What I am wanting to do is store the entire thing in one variable and split it into 4 strings based off of the html tags and reduce each returned string down to 200 characters. I am wanting each string to start at <p><strong> thanks Any Ideas. Thanks
  16. Bricktop: that didn't change anything it still reloads the page in the same window and opens a new window with the same page displayed. Thanks
  17. yes process changes opens processes and then is suppose to return to the page with the form on it.
  18. :facewall:I don't understand, when the submit button is clicked not only is the page reloaded but it is also opened in a new tab/window...... any ideas? Here is my code: <?php <form action="process_changes.php" method="post"> <?php //Grab the section id string from the url. $section = $_GET['section']; //this sets up an assoc array that allows us to track what page we are editing for making sure that the current edits are being uploaded to the //appropriate table in the db. $sectionid = array( "edit_news" => 0, "edit_radio" => 1, "edit_reviews" => 2); foreach ($sectionid as $key => $value) { //echo "key: " . $key . "value: " . $value . "<br />"; if ($section == $key) { echo "<input type=\"hidden\" value=\"$value\" name=\"section\" id=\"section\" />"; } } ?> <?php //Reformat image tags so that the images will display in the editor include('phpcontent/contcond.php'); $search = "src=\"images"; $replace = "src=\"http://hmtotc.com/dev/projects/VRassoc/soundsurfer.biz/images"; $article_edited = str_replace($search, $replace, $article); $article = $article_edited; $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->ToolbarSet = 'Custom'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '512' ; $oFCKeditor->BasePath = '' ; $oFCKeditor->Value = $article ; $oFCKeditor->Create() ; ?> <input type="submit" value="Make Changes" /> </form>?> Thanks
  19. I got it to work with the following code <?php //Get article from db $query = "SELECT article FROM sndsurf_news ORDER BY date DESC LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); $resultarray = mysql_fetch_assoc($result) or die(mysql_error()); $article = $resultarray['article']; //these are tags that are ALLOWED. $stripedarticle = strip_tags($article, '<a><b><i><u><center><p><s><strike><strong><em><h1><h2><h3><h4><h5><h6><font><table><span>'); $summary = substr($stripedarticle, 0, 480); $readmore = "<a href=\"index2.php?section=news\"><b>....Read More</b></a>"; echo $summary . $readmore; ?>
  20. Its still displaying the images?????? its like it is skipping over the img tags all together. lol Thanks
  21. Hey guys, I am wondering if I have a string that has html in it and I only want to strip out the IMG TAGS and cut the string down to the first 570positions. how I would do this I thought that I had it with this //Get article from db $query = "SELECT article FROM sndsurf_news ORDER BY date DESC LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); $resultarray = mysql_fetch_assoc($result) or die(mysql_error()); $article = $resultarray['article']; //Initialize $replace variable set to NULL $replace = " "; //Remove all instances of the html img tag substr_replace("/<img[^>]+\>/i", $replace, $article); $summary = substr($article, 0, 570); echo $summary; But the images still display. Any thoughts? Thanks George!
  22. ok checking it out now, let me ask this then. Would preg_match also allow me to skip an image reference in a string and pull from the following text to generate a preview of the text. Thanks
  23. Okay guys I may be thinking about this the wrong way but here go's. This is the page http://hmtotc.com/dev/projects/VRassoc/soundsurfer.biz/index2.php?section=reviews that has the 2 images I want to pull out and display on the home page http://hmtotc.com/dev/projects/VRassoc/soundsurfer.biz/index.php in the reviews section. However i will need to skip the first image on the first link which is the reviews heading image. Any thoughts guys? Thanks again!
  24. thanx worked like a charm!!!!! so simple I missed it sorry for the dumb question guys.
×
×
  • 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.