Jump to content

mark s

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by mark s

  1. I Cant see the images not displayed. Link is also dead:(
  2. 1. Use the $_POST to send your variables to your next page. 2. Your next page would include the error checking. if no mistakes display what will be sent. 3. confirm it looks ok, 4. Info is send / added to your data base or e-mail. You will find that it can be time consuming getting it to work, but your actualy building your self a template. Have Fun (I did)
  3. I'm new to GD and ive been playing around to get a feel, Its not as easy as i may have thought. I have managed to shrink pictures, (Thumbnails), and add a water mark. But only 1 image per php page. I have had some problems getting my head around displaying any GD images with HTLM code, but im making small advances. Anyways after reading up about GD and getimagesize i came across this piece of code. Original [u]http://uk.php.net/manual/en/function.getimagesize.php#36452[/u] Author janoma_cl his comments are included. [code]Please use the link above? As i'm unable to include the code in this post. Error The resource cannot be displayed 406[/code] Ive been trying almost all day trying to make it work? Or make it useable. I would like to get it working so i can understand whats happeing, and learn more. I believe the code above to be working but its me that's making the mistakes? I have become confused, and lost. I have copied and pasted the code into a php file. ive also included before the thumbnail function $file = '/temp/car.jpg'; I have tried many diffrent variations, but i cant get the above to work. If some one could help it would be most appreciated. Do i have to have 2 files? one for the html and one for the function?? Thanks in advance for any help. Mark.
  4. I see what you mean, But i'm still curious? For example myphp admin for controling your databases. When working in php admin control panel, it works the way i would love to be able to reproduce. You can see the Actions / requests being done, but in the staus bar only. The top address bar remains static. You can sort the contents accending or disacending if you click on the colom name at the top of your table in browse mode. So its not a "Button" it is a link. I know it looks like a frame to the left listing your DB Tables. Does Php Admin use java script or do they just have it sussed? Can anyone enlighten me please, as i'm sure many could benifit from advice given. Thanks in advance mark.
  5. require("menu.php") looks like its missing a ; at the end too.
  6. I use this [code]echo "<TD WIDTH=\"60\" ALIGN=\"CENTER\">             <A HREF=\"$PHP_SELF?action=is_spam\"                onClick=\"return confirm('Will be Changed to SPAM');\">             Change</A>             </TD>\n";[/code] Hope that helps :)
  7. Hi i'm really struggeling to find a soloution to my problem. Ive search PHP FAQ and the headers post but the links are no longer active to the relevent posts for more info. What i need to be able to do is remove the last action that is sent to the address bar to prevent a user error? / Duplicate request if the end user uses the Refresh button in there browser. Or is it okay leaving it displayed? I created a refresh button on my page, but habbit makes users use there Browser Refresh button. Example index.php5?action=delete_record Delete record is part of a function which is actioned by clicking on a link "Delete Record" which access my database and then deletes the record. What i would like to achive if possible is to be able to return to the same page but only index.php5 in the address bar. As the delete record changes the results in my displayed table. I have been trying for a while to get this result with out any luck. Ive read that the Header() must be the first thing at the top of my page. And i tried placing the Header (http://www.***/index.php5) But it seemed to go into a loop and my page wouldnt update? Ive covered the "White spaces" as a possible issue. So i get the idea how important it is the have the Header() at the top of the page but i cant get it to work? ---- My page displays a database results with diffrent options attached to functions. Enter / Delete / My page code... [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>SPAM</title> <style type="text/css"> <!-- .style1 {color: #FFFFFF} --> </style> </head> <body> This area has the page layout (HTML) And the PHP code which uses SWITCH to retreieve the function $GET switch($_GET['action']) { </body> </html> [/code] --------------------------- Can anyone point me the right direction please.? How if possible could i include the Header() in each function, to prevent that last action being displayed? I looked up ob_start but got more lost. and decided to post for opinions and help. Do i have to wrong approach? What could / should i do ? index.php5?action=delete_record to this index.php5 Help
  8. Hi, I hope you can help. I have Refrence books etc but i cant find the refrence to $thisform = <<<MYFORM MYFORM; i'm trying to look it up but cant find anything in the index? Ive been through my books almost page by page. What is it called and how can i look it up in the online PHP Manual? I'm having a couple of issues which i need to read up on. issuses Its playing havoc with a Template and Editable Region in Dreamweaver. And not a big thing but a snip it of php to echo out an IP address. I have used the above in the past but cant find my refrences, i have a big postit ready to mark the pages.... Thanks in advance. Mark.
  9. Is RSS Auto Discovery possible with a php page? Please check this link.. [a href=\"http://keithdevens.com/weblog/archive/2002/Jun/03/RSSAuto-DiscoveryPHP\" target=\"_blank\"]Click me[/a] to view code. I'm not sure if my brain has given up today, after searching and searching... Does the code on the link provided, make a php Auto Discoverable with php? If so how do i call the functions? Does all the code fit in the <body> tags or <head> tags ?? Please help, ive been going around in circles... I have managed to get the normal Auto discovery to work with a .html page. But the same tagg wont work if my page is php. [code]<link rel="alternate" type="application/rss+xml" title="RSS Feed for ..............." href="rss10.xml"/> [/code] My brain has turned to jelly...... Any help, links, advice appreciated thanks..
  10. Any help would be appreciated, as i need to iron out this possible error before i make my page live. Links Tutorails Somthing that may hep... All appreciated.. Thanks for reading.
  11. Check my topic. 1. I also had a poblem with redeclare 2. Resolved the problem posting code [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=88217\" target=\"_blank\"]Click me[/a] Hope it helps :)
  12. A problem i didnt expect has cropped up? Ive continued to use the code in post 2 above, for formating purposed. And i have re-named the functions with 2, 3, 4, and so on in respective inc files. So i now have 4 RSS Feeds being displayed. But one of them failed (For an hour or so). But the knock on effect is that only half of my web page was displayed. And any inc files after that one failed to show at all. Like the code and all following code had been stopped. This is the function that calls the Feed. [code] function characterData2($parser, $data) {     global $rss_channel, $currently_writing, $main, $item_counter;     if ($currently_writing != "") {         switch($main) {             case "CHANNEL":                 if (isset($rss_channel[$currently_writing])) {                     $rss_channel[$currently_writing] .= $data;                 } else {                     $rss_channel[$currently_writing] = $data;                 }                 break;             case "IMAGE":                 if (isset($rss_channel[$main][$currently_writing])) {                     $rss_channel[$main][$currently_writing] .= $data;                 } else {                     $rss_channel[$main][$currently_writing] = $data;                 }                 break;             case "ITEMS":                 if (isset($rss_channel[$main][$item_counter][$currently_writing])) {                     $rss_channel[$main][$item_counter][$currently_writing] .= $data;                 } else {                     //print ("rss_channel[$main][$item_counter][$currently_writing] = $data<br>");                     $rss_channel[$main][$item_counter][$currently_writing] = $data;                 }                 break;         }     } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = f**open($file, "r"))) {     die("could not open XML input");     } while ($data = fread($fp, 4096)) {     if (!xml_parse($xml_parser, $data, feof($fp))) {         die(sprintf("XML error..: %s at line %d",                     xml_error_string(xml_get_error_code($xml_parser)),                     xml_get_current_line_number($xml_parser)));     } } [/code] And its this part i belive i need to modify.. To prevent the following error : could not open XML input [code] $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = f**open($file, "r"))) {     die("could not open XML input");      } while ($data = fread($fp, 4096)) {     if (!xml_parse($xml_parser, $data, feof($fp))) {         die(sprintf("XML error..: %s at line %d",                     xml_error_string(xml_get_error_code($xml_parser)),                     xml_get_current_line_number($xml_parser)));     } [/code] I read that replacing "Die" With "Return Would / could Help. [code] $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = f**open($file, "r"))) {     //die("could not open XML input");     echo "Feed Not Available";     return; } while ($data = fread($fp, 4096)) {     if (!xml_parse($xml_parser, $data, feof($fp))) {         die(sprintf("XML error..: %s at line %d",                     xml_error_string(xml_get_error_code($xml_parser)),                     xml_get_current_line_number($xml_parser)));     } [/code] But it then caused an error from this part. XML error..: s at line 1 [code] while ($data = fread($fp, 4096)) {     if (!xml_parse($xml_parser, $data, feof($fp))) {         die(sprintf("XML error..: %s at line %d",                     xml_error_string(xml_get_error_code($xml_parser)),                     xml_get_current_line_number($xml_parser)));     } [/code] I guess i looking for a way to prevent a failed Feed stopping the rest of my code running. Is it possible to make a timeout for recieving a Feed, as opening my page can on occasion take what seems for ever? (20 seconds). ----- Summary Feeds are called from my main page as inc files. There are 4 feeds 1,2,3,4 (inc files) If feed 1 fails then everything stops? Main page is only half loaded, and no other feeds are excecuted. How can i keep the main page and none failing feeds to be shown. I cant move my inc request on my main page due to formating. And finally is there any way to time out a feed, to speed up the displaying of my web page if a feed is not available. Any help will be appreciated thanks.
  13. That works great :) Thanks for that..... Its another diffrent way of showing RSS Feeds. I will have to tweak it a little to display it the way i want, but it does the job, looking at the feeds from one file, which is better than indivdual files all over the place... I also need to work out a way i can cap the max feed from any one feed. Say 15 so i can format my page so it looks neat.. ---------------------------------- So looking at the code it checks the length of the feed and creates an array to suit. How can i write an if statment to say dont show any more than 15 from a Rss feed? as i'm wondering if the Feed count is less than 15 say only 7 would an if statment then fail ?? Any help would be appreciated thanks... Mark... Thanks for the code above its really neat, i like it.
  14. I'm a 1 and 1 customer too. You need to down load a program from your control pannel called. (Ive forgot) But its what the recomemnd. Down load that. Run it from your desktop. The settings you require should be on 1&1 for the connection. Then you connect to your ssh and you can then work out the comands to to time your script. You make a script file which points to the file you want to do what ever. and that's it. I'm not at home now so i can send you settings etc or point you in the right direction. Message me your e-mail adress and i will get back to you later today. My script automates a back up of my forums. It did take me a while to get my head around cron jobs, but after a while of practice. I'm no expert but i should be able to help you get started with somthing simple. My scriot if i remember right is CGI / Perl as i wasnt sure if a Script file could be php or not. But someone may answer that below.
  15. You may be able to pick the bones out of this one? [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87519&hl=\" target=\"_blank\"]Click Me[/a] I had a simular issue with drop combo boxes. It will show you on a submit you can get a result to show pulled from the database. -------------- Its not perfect but it works.
  16. Thanks, will give that a go in the morning and report back. Ive only just got into these RSS Feeds and i love them, it think there great... Yep ive got my phpfreaks RSS :) --------------------------------------------- Thanks for the reply - will update with results :)
  17. Thanks i renamed the functions by simply adding a '2' and it works. Is it possible to do it in such away that the declared functions are reset / wiped and allowed to run again? or be renamed with a vaiable or somthing? I could not post the code due to this line, after line after line of trying. I've added - + - which should be removed for these forums to accept it. [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]if (!($fp = fo- + -pen($file, "r"))) {[!--colorc--][/span][!--/colorc--] So i can show the code now, any sugestions would be welcome, how i can prevent the functions clashing, with out manually renaming evey inc file. [code] The Code that works with 1 Feed. Its not pretty but works - will tidy when finished. ================================================================= [code] $color1 = "#252D8B"; $color2 = "#2B34A1"; $row_count = 0; /*  PHP RSS Reader v1.1     By Richard James Kendall     Bugs to richard@richardjameskendall.com     Free to use, please acknowledge me          Place the URL of an RSS feed in the $file variable.                The $rss_channel array will be filled with data from the feed,        every RSS feed is different by by and large it should contain:                Array {            [TITLE] = feed title            [DESCRIPTION] = feed description            [LINK] = link to their website                        [IMAGE] = Array {                        [URL] = url of image                        [DESCRIPTION] = alt text of image                    }                        [ITEMS] = Array {                        [0] = Array {                                [TITLE] = item title                                [DESCRIPTION] = item description                                [LINK = a link to the story                            }                        .                        .                        .                    }        }                By default it retrives the Reuters Oddly Enough RSS feed. The data is put into the array        structure so you can format the information as you see fit. */ set_time_limit(0); $file = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"; $rss_channel = array(); $currently_writing = ""; $main = ""; $item_counter = 0; function startElement($parser, $name, $attrs) {        global $rss_channel, $currently_writing, $main;        switch($name) {            case "RSS":            case "RDF:RDF":            case "ITEMS":                $currently_writing = "";                break;            case "CHANNEL":                $main = "CHANNEL";                break;            case "IMAGE":                $main = "IMAGE";                $rss_channel["IMAGE"] = array();                break;            case "ITEM":                $main = "ITEMS";                break;            default:                $currently_writing = $name;                break;        } } function endElement($parser, $name) {        global $rss_channel, $currently_writing, $item_counter;        $currently_writing = "";        if ($name == "ITEM") {            $item_counter++;        } } function characterData($parser, $data) {     global $rss_channel, $currently_writing, $main, $item_counter;     if ($currently_writing != "") {         switch($main) {             case "CHANNEL":                 if (isset($rss_channel[$currently_writing])) {                     $rss_channel[$currently_writing] .= $data;                 } else {                     $rss_channel[$currently_writing] = $data;                 }                 break;             case "IMAGE":                 if (isset($rss_channel[$main][$currently_writing])) {                     $rss_channel[$main][$currently_writing] .= $data;                 } else {                     $rss_channel[$main][$currently_writing] = $data;                 }                 break;             case "ITEMS":                 if (isset($rss_channel[$main][$item_counter][$currently_writing])) {                     $rss_channel[$main][$item_counter][$currently_writing] .= $data;                 } else {                     //print ("rss_channel[$main][$item_counter][$currently_writing] = $data<br>");                     $rss_channel[$main][$item_counter][$currently_writing] = $data;                 }                 break;         }     } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = fo- + -pen($file, "r"))) {     die("could not open XML input"); } while ($data = fread($fp, 4096)) {     if (!xml_parse($xml_parser, $data, feof($fp))) {         die(sprintf("XML error: %s at line %d",                     xml_error_string(xml_get_error_code($xml_parser)),                     xml_get_current_line_number($xml_parser)));     } } xml_parser_free($xml_parser); // output as HTML //print ("<html><head><title>PHP RSS Reader</title></head><body>"); //if (isset($rss_channel["IMAGE"])) { //    print ("<a href=\"" . $rss_channel["LINK"] . "\" target=\"_blank\"><img border=\"0\" src=\"" . $rss_channel["IMAGE"]["URL"] . "\" align=\"middle\" alt=\"" . $rss_channel["IMAGE"]["TITLE"] . "\"></a> <font size=\"5\">" . $rss_channel["TITLE"] . "</font><br><br>"); //} else { //    print ("<font size=\"5\">" . $rss_channel["TITLE"] . "</font><br><br>"); //} echo "<table align='left' width='150' border='1' cellpadding='0' cellspacing='0' bordercolor='#252D8B' bgcolor='#252D8B'>"; echo "<tr><td bgcolor='#252D8B'><i>$rss_channel[DESCRIPTION]</i></td></tr>"; if (isset($rss_channel["ITEMS"])) {     if (count($rss_channel["ITEMS"]) > 0) {         for($i = 0;$i < count($rss_channel["ITEMS"]);$i++) {         $row_color = ($row_count % 2) ? $color1 : $color2;         //echo "<tr><td bgcolor='$row_color' align = 'Right'>$row[2]</td></tr>";             //print ("\n<table width=\"100%\" border=\"1\"><tr><td width=\"100%\"><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\" target=\"_blank\"><h2>" . $rss_channel["ITEMS"][$i]["TITLE"] . "</h2></a></b>");             print ("<tr><td width=\"100%\" bgcolor='$row_color'><a href=\"" . $rss_channel["ITEMS"][$i]["LINK"] . "\" target=\"_blank\">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a>");                         print ("</td></tr>");             $row_count++;         }     } else {         print ("<b>There are no articles in this feed.</b>");     } } echo  "</table>"; [/code] The above is in a inc file and works fine. The result i'm after is to recreate many tables from diffrent RSS feeds, on one page. I would need to use the include file to enable me to position the output tables in there respective places. Can the function names that are causing the re declare error be changed on the fly so to speak. Where i dont have to rename every function manually in each file? But change there name by ++ count or somthing. I'm not being lazy, just curious if that method is at all possible, as it would be handy for future refrence. Thanks in advance mark. Any help would be appreciated Thanks.....
  18. Help with RSS output? Hi i have a script to take a RSS Feed and convert it to a HTML Table output. Ive modified the original code to output as a Table instead of a HTML Page. It works fine (Please ignore the poor code, as i havent tidyed it up yet echo & print). Now the problem comes about when i try to introduce a second feed into my page, showing x2 feeds. The first one will work but the second one produces the following error. [!--coloro:#000099--][span style=\"color:#000099\"][!--/coloro--]Fatal error: Cannot redeclare startelement() (previously declared [!--colorc--][/span][!--/colorc--] It there a way i can get the code to work with several feed. I call the Feeds via a include file. (inc) The Code that works with 1 Feed. [code] I cant post my code ? I get the following error when i try? ---You don't have permission to access /forums/index.php on this server. --Apache/1.3.33 Server at www.phpfreaks.com Port 80 It is wrapped in the code tags. It contains php, functions... If i can solve that i can post the code cheers. But i can post with out it.. Should i comment //out all the code? [/code] I have tried include once with out success. The result i'm after is to recreate many tables from diffrent RSS feeds, on one page. I would need to use the include file to enable me to position the output tables in there respective places. Any help would be appreciated Thanks.....
  19. Ive got it working :) I have had to use some Java Script, which i really didnt want to do, but it may be the only way to achive the results i need. So if you have a Sigle Drop Box. And you need the value to be used in the URL you can do this. ===================================================== <HTML> <body> [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<script language="JavaScript">[!--colorc--][/span][!--/colorc--]<!-- function goto_URL(object) { window.location.href = object.options[object.selectedIndex].value; return false; } //-->[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]</script>[!--colorc--][/span][!--/colorc--] <form name="formName6"> <select name="selectName6"> [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php[!--colorc--][/span][!--/colorc--] require('dbconnect.inc'); $mysql_link = mysql_connect( "$db_host", "$db_username", "$db_password") or die( "Unable to connect to database server"); @mysql_select_db( "$db_name") or die( "Unable to select database"); $sql = mysql_query("SELECT cw_02, cw_00 FROM `cw_newsletter` WHERE `cw_06` = '1' ORDER BY `cw_00` DESC "); while(list($category_name, $category_id)=mysql_fetch_array($sql)){ $category_name = stripslashes($category_name); $category_name = date("F Y", strtotime($category_name)); [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// re format the output.[!--colorc--][/span][!--/colorc--] [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// I need a line output as follow to invoke a second function to display current news letter.[!--colorc--][/span][!--/colorc--] echo "<option value='http://yourpageurl.com/index.phpaction=newsletter&id=$category_id'>$category_name</option>"; } echo "</select>"; mysql_free_result($sql); [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]?>[!--colorc--][/span][!--/colorc--] <input name="submitName6" type="submit" value="Go" onClick="return goto_URL(this.form.selectName6)"> </form> ============================================================== It still needs a tidy but its working :) If anyone knows how it can be done or if it can be done with just php ?
  20. Hopefully the answer will help others too. Function for the Dynamic Drop box taken from. [a href=\"http://www.phpfreaks.com/quickcode/Building-a-Dynamic-Form-Select-Menu/2.php?higlight=dynamic\" target=\"_blank\"]Click Me[/a] How can i pass the results? My Goal : I have a Newsletter page. Which shows the Dates from a database of past Newsletters. Along with the dates i have in the database the full HTML code (Newsletter) for viewing. I want to be able to... Select a Date hit a button (Submit). And the value be used to show the News letter Requested. (Same URL Just diffrent output). Drop Box shows April 2004 with a value of 1 as its index. So if i select April 2004 a value of 1 can be passed back for my function to show that Newsletter. At the moment i would just be happy to see in my URL the address + the Vaue. (1) or what ever value is against the date selected. And from there hopefully i can work out the rest. [!--coloro:#3333FF--][span style=\"color:#3333FF\"][!--/coloro--][i]Mod Note : I did start another topic but its just too messy please close. [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87467\" target=\"_blank\"]Click Me[/a][/i][!--colorc--][/span][!--/colorc--] My Working Code so Far :This is only the Dynamic Drop Box Non of my Newsletter functions have been included. One step at a time. =============================================== [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?[!--colorc--][/span][!--/colorc--] function catlist(){ require('connect.inc'); [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// Make Connection.[!--colorc--][/span][!--/colorc--] $mysql_link = mysql_connect( "$db_host", "$db_username", "$db_password") or die( "Unable to connect to database server"); @mysql_select_db( "$db_name") or die( "Unable to select database"); [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// pull the info from cw_00 = Auto inc (1 to 25)[!--colorc--][/span][!--/colorc--] [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// Pull the info from cw_02 = Newsletter in Html[!--colorc--][/span][!--/colorc--] $sql = mysql_query("SELECT cw_02, cw_00 FROM `cw_newsletter` WHERE `cw_06` = '1' ORDER BY `cw_00` DESC "); echo "<select name='category_name'>"; while(list($category_name, $category_id)=mysql_fetch_array($sql)){ $category_name = stripslashes($category_name); [!--coloro:#FF6600--][span style=\"color:#FF6600\"][!--/coloro--]// I have added $category_id to show with $category_name to show that the correct value its picked up.[!--colorc--][/span][!--/colorc--] echo "<option value='$category_id'>$category_id $category_name</option>"; } echo "</select>"; [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// not sure what this does?[!--colorc--][/span][!--/colorc--] mysql_free_result($sql); } [!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]// The Form:[!--colorc--][/span][!--/colorc--] echo "<form method='post' action''> Select:"; catlist(); echo "<input type='Submit' Value='Submit'> </form>"; [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]?>[!--colorc--][/span][!--/colorc--] ======================================= Any help on this would be appreciated, I have spent day's going in circles and becoming more confused. How do i pass a vaule from the drop list to be used? I need it to show a ?value=1 after my URL so my function can use it to show that Newsletter. [!--coloro:#3333FF--][span style=\"color:#3333FF\"][!--/coloro--]Thank You :)[!--colorc--][/span][!--/colorc--]
  21. My problem at the mo is, that i dont fully understand how to use the drop list value and use it? What i can do :- Make a Dynamic Drop Box that reads from the database. Show the relevent months and also read a value ( 1 to 25). So my drop box is looking correct. ============================================ HELP WITH PLEASE So then using the info.. I create a submit button. And it does nothing :( So i change the form action to = the page url and it now does somthing. What i need it to do on submit is to take the value from the drop list. And use it. This is why i cant belive the head ache its giving me, it doesnt seem that difficult on paper so to speak... I think i will have to build it up from fresh again. And look for more examples... to work from. I know this may seem like a small task but i'm hoping to use what i learn about this process on much larger dropboxes in the future. Hence why i dont just list everything manually in the drop box. Any help or examples i can work from would be appreciated, as you can tell i'm going Nuuuuuuuuuuuuuuuuts.....
  22. The url i used was just that an example. It does visit the correct page (Same page) its just the $ID does not drop in. So my Newsletter function can not look up the db to display the correct record. Ive been playing around and have got it a little closer? Whats happening now, And it is, that now when i hit the submit button, it shows the record that was previously selected?? Example. Jan =1 "Click the Submit" = Shows Newest record (25) Aug = 7 "Click the Submit" = Shows Record 1 as above. Dec = 12 "Click the Submit" = Shows Record 7 as above. or If i select the same record twice it drops in the second time?? It may be easier to read if i dont use the code button. ------------------------------------------- function catlist(){ $sql = mysql_query("SELECT cw_02, cw_00 FROM `cw_newsletter` WHERE `cw_06` = '1' ORDER BY `cw_00` DESC "); echo "<select name=\"cw_00\">"; while(list($cw_02, $cw_00)=mysql_fetch_array($sql)){ $view = date("M Y", strtotime($cw_02)); echo "<option value=\"$cw_00\">$cw_00 $view</option>"; } echo "</select>"; } echo"<form action=\"?action=newsletter&id=$cw_00\" method=\"post\" name=\"form\" id=\"form\">"; // The Form: catlist(); echo "<input type=\"Submit\" Value=\"Submit\"> </form>"; ?> --------------------------------------------------- Im thinking now my problem may be with the $GET "action"...... Shall plod on... Thanks for any help offered :) I read also, today and im going off what i read, is that Netscape N understands the changing of the Action function to mailto.... But IE does not? Dont quote me on it as ive just read so much.
  23. I'm not that new to forms but this one is driving me mad. I have previously used a confirm page to pass the varibles i need. I should have asked / posted earlier but i really didnt think it would cause me such a headache. The more i read up on it the more confused and re-directed i become. If anyone can help it would be appreciated very much. [b][i]How do i get the value from the drop box to hook up on my function?[/i][/b] I have a Drop Box which lists the dates of Newsletters. These are called Dynamically from my Database. 1st Jan 1st Feb 1st March .....ect.... That works fine :) (After fun and games). ------------------------------- I have 2 Functions running with in the script. If no action keyword is present, just list the last entry. If action keyword "newsletter" go to the [b]$theId[/b] of Date Selected. Which would then show the relevent Newsletter. Which is pulled and displayed from my database against the date. Best way i could explane it to be honnest. But its not working. I cant get the value from the drop box to carry over so to speak. -------------------------------- The Following code checks when the page is loaded / refreshed. I have all my database querys runing fine. So if i visit this page the first time "default" is invoked. And if my url includes "http://www.blarblar/index2.php?action=newsletter&id=4" Then the news letter with the ID of 4 would be displayed. Functions are actioned as follows. [code] <?php if (empty($_GET['action'])) $_GET['action'] = ""; switch($_GET['action']) { case "newsletter": requested_newsletter();   break;   default:   list_records();   break; } [/code] The following code is my form / dropbox. [code] <?php $results= mysql_query("SELECT cw_02, cw_00  FROM `newsletter` WHERE `cw_06` = '1' ORDER BY `cw_00` DESC "); $id = "cw_00"; $idname = "cw_02"; echo mysql_error(); // following line may be wrong, as its been changed 100 times. echo "<form action=\"?action=newsletter&id=$theId\" method=\"post\" name=\"form1\" target=\"_self\" id=\"form1\">       <select name=\"select\">";        if (mysql_Numrows($results)>0)                            //if there are records in the fields {   $numrows=mysql_NumRows($results);                       //count them   $x=0;   while ($x<$numrows){   //loop through the records     $theId=mysql_result($results,$x,$id);                 //place each record in the variable everytime we loop     $theName=mysql_result($results,$x,$idname);     echo "<option value=\"$theId\">$theName</option>\n";  //and place it in the select     $x++;   } }        echo       "</select>"; echo      "<input type=\"submit\" name=\"Submit\" value=\"Submit\" />"; echo    "</form>" ?> [/code] But when i use the submit button, i only get what ever is in the [b]Action=[/b] without the value of the drop box ?? [a href=\"http://www.blarblar/index2.php?action=newsletter&id=\" target=\"_blank\"]http://www.blarblar/index2.php?action=newsletter&id=[/a] Which works with the "Newsletter Function" as there are no results. As the [b]$theId[/b] has failed to be carried over. Ive read so much about the dynamic listboxes the creation, but using the vaules, isnt covered in enough detail for me to understand where i'm going wrong? i have become totaly lost and confused now. Any guidence woud be appreciated. [b][i]How do i get the value from the drop box to hook up on my function?[/i][/b]
  24. More info can be found here, Click Me Still tring to resolve the problem. humm.... Moderators feel free to close this topic.
  25. Now i realise that my 14 days isnt doing as I expected? Yes its listing all the cal_stamp dates and beond todays date I dont want it listing when today passes. I need to hook up on some kind of a date range ? Is there a sql way to do this? I havent had any luck with Date_sub any help?
×
×
  • 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.