Jump to content

iwato

Members
  • Posts

    1,506
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by iwato

  1. Understood. But, pages with .php extensions can display HTML. One of my pages displays no HTML, the other does. This is what I meant. Thank you. Roddy
  2. It will be my first time to use a session, but I could see the time coming long before I started the current task. So, now is just as good as time as any, and it looks like using a session will provide me with all of the communication that I need between the PHP and HTML pages. Once again, Dsonesuk, you have struck home. Many thanks! Roddy
  3. I have just discovered that I can use the PHP header( ) function with an URL as the value of the function's location parameter to open the HTML page from the PHP age. header("Location: $url"); Ostensibly, i could append a query string to the end of the URL and then process this string on the HTML when the page opens. Would this not require, however, that I change the extension of the HTML page from .html to .php? Likely not a big deal as the HTML page is still in a stage of development. Roddy
  4. The user will click on the third-party website only if he wants. That is his choice. i only care about what happens after he clicks. Yes and no. Yes, when the user clicks on the third party website, he is taken to my website, but his action does not open an HTML page, rather an invisible PHP page. What I need to know is how get this latter page with the .php extention to open an .html page in the user's browser after it has processed the information sent to it from the third-party website. In addition, I would like that the information processed on the PHP page be transferred to the newly opened HTML page. Is it clear now? Roddy
  5. OK. We appear to have touched base here: If you're saying the page isn't loaded by the browser yet, then nothing can happen until the browser sends a request for the page and gets a response from the server. So, I have to 1) Get the PHP page to send a request to the user's browser to open the host HTML page. 2) Force a request from the newly opened HTML page to the PHP page. 3) Receive the response and display it in the HTML page. This looks like AJAX. Something that I have never used before, but appears entirely within my reach as I have some knowledge of both Javascript and JSON. This appears to be something that I can do except for the fact that I do not know who the user is. Once again, The TASK The user clicks on a link on a third party website. An HTTP request is sent from the third party website to a PHP document hosted on my own webpage that uses the requested information to query a database and make a determination. But, how does the PHP document know where to send the HTTP request necessary to open the host HTML page in the user's browser? Roddy
  6. Let me try one more time. Usually, information from an external source is loaded into an HTML page that is already opened. In my case, the HTML page in which the information is to appear is not yet opened. What is more, the unopened page in which the processed information is to appear is used for several other purposes and cannot be easily produced from the processing PHP page that produces the information that is to appear in the HTML page. Roddy
  7. So as to be simpler. QUESTION ONE: Is it possible to call a page into which the calling page is itself loaded? QUESTION TWO: If this is possible, there is likely more than one technique available to achieve the task. What are they?
  8. JSG: I have created a form page (sender.php) with a single input field. The value of this input field is sent via a $_GET superglobal to another page (receiver.php) that: one, retrieves all of the records from a data base; two, compares the value received from the form page (sender.php) with the values of a field of all of the retrieved records, and three, displays the receiver.php page with the value of another field of the same matched record. Everything up to this point has now been accomplished. JSG: Indeed, this is the part that I have yet to overcome. The displayed result (see above) is the information that should serve as a filler for another page that hosts all such form queries. QUESTION: How do I get the information from this filler (receiver.php) to appear in the host page with the host page when the result of the form query is sent to the filler template? Roddy
  9. Thank you for responding. I have decided to play with my idea a little before coming back. For, in this way, I will be able to ask a better question dealing specifically with code. In so doing, I may even be able to answer my own question.
  10. THE TASK: Receive an HTTP query from an external source. Use the information from the query to obtain information from a data base Insert the information from the database into a filler page. Load the filler into the host page in such away that both appear simultaneously. DILEMMA: I can perform all of these tasks individually, but I am at a loss as to how to move from Step 3 to Step 4. DISCUSSION: I am accustomed to loading a filler into a page that is already opened. And, I am accustomed to loading a page with information queried from a database. Although I am pretty sure that I can call a page and load it with a filler whose content is determined by the HTTP query (Steps 1 and 4). What I have not done and feel awkward about is filling the filler page with information from the database query before displaying both the page and the filler together. QUESTION: Any suggestions? Roddy
  11. OK. As always -- well, almost always -- you make good sense, and I like it. Is the $_GET variable not automatically created when a query string is sent, though? PHP is simply used to process the data that the variable contains. Or, have I misunderstood. Now, to the further strategy. The model that I want to use is the one that you taught me when I wanted to view the PHP source code of one page by clicking on a link contained in another page. In other words, click on a link on one page, send a query to another page, receive the query, make a choice with a SWITCH statement and display the desired page of code in the same window that was once filled with PHP code containing the SWITCH page . This time, however, rather than displaying PHP code I want to display the contents of an HTML page. Where I am unclear is how best to display the contents of the HTML document as content in another HTML page. The destination for the content is the main section of the following page http://www.grammarcaptive.com/podcast_dev_copy.html. Now, I have filled such space in the past by a variety of means including: 1) Hiding content already on the page and then making it appear. 2) Replacing it with a portion of another page that I have fetched with the Javascript .load( ) method. 3) Replacing swapping the content of an iframe. Of these three approaches I prefer number two, because I fill the section with whatever I want. The problem, as I imagine it, occurs, when I try to automate the process. Using an iframe would be easy, because the iframe would simply fill with the content generated from HTTP query. But, the procedure would only work so long as the page that receives the query and the iframe itself were present when the query were made. What would happen, if the page were filled with something else when the query is made. Also clicking on a link hosted on someone else's page would automatically force a new page to open. I would not want my user to be opened to the same page twice. Can you help me think this through. Have a provided enough information? Roddy
  12. OJBECTIVE: My goal is to send a $_GET or $_POST variable from an RSS feed when the user clicks on a link housed within the <description> subelement of an <item> tag. The data from the superglobal will be used to display content on a host webpage designed as an index for all <item>s hosted within the same and ultimately other channels. CODE SAMPLE: <item> . . <description>Grammar Captive Free Weekly Podcasts: <![CDATA[<a href='http://www.grammarcaptive.com/podcasting/podcasts.php?episode_no=003' title='Episode Title' target='_self'>Episode No. 003</a>]]></description> . . </item> QUESTION: Will by placing the link with the intended address and appended http request code into a CDATA tag allow users to send the desire episode number to the designated PHP page for processing. ADVANCED STRATEGY: If the above is possible, do you have any suggestions in regard to the best way for the receiving PHP page to call up the material relevant to the designated episode? For example, I am contemplating the use of a SWITCH statement that would route the incoming episode number to a block of PHP or Javascript code that would insert the contents of another webpage, whose URL is the episode number of the incoming HTTP_REQUEST, and whose content is dedicated to the episode corresponding to the incoming episode number, into another webpage (likely the same page that contains the SWITCH statement) that serves as an index for all completed and upcoming episodes. Roddy
  13. Got it. Dsonesuk, you are one very knowledgeable individual. It turns out that the 2nd and 3rd media rules were absolutely useless with regard to the desired flex box effect, and as you wisely suggested the column direction setting is completely unnecessary. For others, however, you might wish to direct them toward Firefox's Responsive Design Mode. For in this mode the screen width is counted for you, and you can watch the behavior of the window's contents as the width is being counted. What is more you can set the width in the same window mode to the precise location that the change needs to be made. It is a super tool; for it taught not only where the changes were taking place, but also where I needed to place the flex box display property to attain the desired affect. (Firefox / Tools / Web Developer / Responsive Design Mode) Have a great day! Roddy
  14. Yes, but what could be preventing the column of images from becoming a row, when the right column no longer fits in the viewport and is compelled to align underneath the left an middle panels? What is more, why would the column switch to a row only when the header, left panel, main content panel, and right panel are aligned vertically, and not before? After all, the row setting is occurs with the second media rule. The combined width of the left navigation panel (200 px), main panel (504 px), and horizontal margins (10 px) is 714 px. The second media rule should kick into effect as soon as the viewport reaches a width of 700 px. Notwithstanding, no matter the size of the max-width, be it above, below, or exactly 714px, the result is the same. What is more, there is no CSS below the rule that obviously affects the size of the viewport or the panels in question. I simply do not get it. Roddy
  15. The direction is set as column only for the first media rule. For the second, and therefore the third as well, the direction is set to row. Take a closer look at podcast_template.css. Roddy
  16. Thank you for responding. I was beginning to think that no one cared. The result of the second media rule should be the same as the third. As the viewport contracts the column simply shifts from the right of the main content to below it. When it moves below it should turn into a row that wraps, as it finally does well all parts of the document are stacked on top of each other.
  17. If it would encourage a response, I have since cleaned the file of potential noise that could have been getting in the way.
  18. Please delete this entry so that it is not confused with the entry correctly listed in the CSS forum. Thank you!
  19. Yes a function was being called for which there was no longer a reference. I was not terribly thorough in the deconstruction of the page before I began rebuilding it. I usually catch this sort of things at the end, unless, of course they cause trouble along the way. In this case i removed the function call, but the problem with the media rule persists. In any case, thank you.
  20. JSG: Thank you for the heads up. I did not realize that I had posted this query to the XML forum and have moved it to the CSS forum where it belongs. I do not understand why one of the pages did not open, though. I just tried both of the links, and they were working fine. Please delete this entry. I apologize for the misplacement. Roddy
  21. BACKGROUND: I have recently created a new page based on code used on another page that appears to be functioning well. As the content is different, however, it was necessary that I make several important modifications. Still, the basic format is the same, and I do not understand why the new content is not responding as it should. As always, I have tried a variety of experiments before coming to you including resetting the values of the width property of both the media rule and the media rule's content, reordering the script order of both the imported CSS files and their content, as well as the placement of the CSS rules that command the flex-box. My CSS selectors appear to be appropriate as I am able to generate change. Unfortunately, the desired change is not the change that I am generating. QUESTION: What is the most likely cause of the dysfunction? ORIGINAL PAGE: Observe the behavior of the pages navigation bar, main section, right sidebar, and footer as the size of your viewport expands and contracts. On my devices (iMac, MacBook, and iPhone) the behavior is the desired behavior. The various section appear to function well no matter the selected browser. http://www.grammarcaptive.com/overview.html NEW PAGE: Although the main content section is empty, the right sidebar does not function as intended under the second media rule -- this, despite its proper functioning under the first and third rules. http://www.grammarcaptive.com/podcast_dev_copy.html NOTE: I'll not place any code as everything is easily viewed online.
  22. BACKGROUND: I have recently created a new page based on code used on another page that appears to be functioning well. As the content is different, however, it was necessary that I make several important modifications. Still, the basic format is the same, and I do not understand why the new content is not responding as it should. As always, I have tried a variety of experiments before coming to you including resetting the values of the width property of both the media rule and the media rule's content, reordering the script order of both the imported CSS files and their content, as well as the placement of the CSS rules that command the flex-box. My CSS selectors appear to be appropriate as I am able to generate change. Unfortunately, the desired change is not the change that I am generating. QUESTION: What is the most likely cause of the dysfunction? ORIGINAL PAGE: Observe the behavior of the pages navigation bar, main section, right sidebar, and footer as the size of your viewport expands and contracts. On my devices (iMac, MacBook, and iPhone) the behavior is the desired behavior. The various section appear to function well no matter the selected browser. http://www.grammarcaptive.com/overview.html NEW PAGE: Although the main content section is empty, the right sidebar does not function as intended under the second media rule -- this, despite its proper functioning under the first and third rules. http://www.grammarcaptive.com/podcast_dev_copy.html NOTE: I'll not place any code as everything is easily viewed online.
  23. iwato

    Missing XML Formatting

    Thanks, Ingolme!
  24. iwato

    Missing XML Formatting

    If I have understood correctly. The PHP show_source( ) method only works because the method is called within the same domain name as the file that it calls. Am I correct?
  25. iwato

    Missing XML Formatting

    <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $host = "..."; $user = "..."; $pwd = "..."; $mysqli_obj = new mysqli($host, $user, $pwd); if (!$mysqli_obj->set_charset("utf8")) { printf("Error loading character set utf8: %s\n", $mysqli_obj->error); exit(); } else { $mysqli_obj->character_set_name(); } $db = "..."; $mysqli_obj->select_db($db); $tbl_name = '...'; $sql_1 = "SELECT * FROM ". $tbl_name . " ORDER BY channel_pubdate DESC LIMIT 1"; $chan_arr = array(); $result_obj = $mysqli_obj->query($sql_1); while($row = $result_obj->fetch_assoc()) { foreach($row as $key => $value) { $chan_arr[$key] = $value; } } $chan_image = array( "title" => $chan_arr['channel_img_title'], "url" => $chan_arr['channel_img_url'], "link" => $chan_arr['channel_img_link'], "width" => $chan_arr['channel_img_width'], "height" => $chan_arr['channel_img_height'], "description" => $chan_arr['channel_img_description'] ); foreach ($chan_arr as $key => $value) { if ($key == 'channel_category1') { $chancat_name[] = $value; $chancat_domain[] = ''; } if ($key == 'channel_category2') { $chancat_name[] = $value; $chancat_domain[] = ''; } if ($key == 'channel_category3') { $chancat_name[] = $value; $chancat_domain[] = ''; } } $tbl_name = '...'; $sql_1 = "SELECT * FROM ". $tbl_name . " ORDER BY item_pubdate DESC LIMIT 5"; $item_arr = array(); $result_obj = $mysqli_obj->query($sql_1); while($row = $result_obj->fetch_assoc()) { foreach($row as $key => $value) { $item_arr[$key] = $value; } $items[] = $item_arr; } $tbl_name = 'rss2_podcast_itunes'; $sql_1 = "SELECT * FROM ". $tbl_name . " ORDER BY publish_date_itunes DESC LIMIT 5"; $itunes_arr = array(); $result_obj = $mysqli_obj->query($sql_1); while($row = $result_obj->fetch_assoc()) { foreach($row as $key => $value) { $itunes_arr[$key] = $value; } $itunes[] = $itunes_arr; } use FeedWriter\RSS2; require_once("/Users/.../vendor/autoload.php"); $rss2 = new RSS2(); $prefix = 'itunes'; $uri = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; $rss2->addNamespace($prefix,$uri); $href_atom = 'http://www.grammarcaptive.com/filepath.xml'; $rel_atom = 'feed'; $type_atom = 'application/x.atom+xml'; $hreflang_atom = 'en'; $title_atom = 'Grammar Captive Weekly Podcast'; $length_atom = NULL; $rss2->setATOMLink($href_atom,$rel_atom,$type_atom,$hreflang_atom,$title_atom,NULL); $rss2->setTitle($chan_arr['channel_title']); $rss2->setLink($chan_arr['channel_link']); $rss2->setDescription($chan_arr['channel_description']); $rss2->setChannelElement('image',$chan_image,NULL,true); $i=0; $domain = ['domain'=>'']; $length = count($chancat_name); while ($i < $length) { $rss2->setChannelElement('category',$chancat_name[$i],$domain, true); $i++; } $tags = ['copyright']; $rss2->addCDATAEncoding($tags); $rss2->setChannelElement('copyright',$chan_arr['channel_copyright'],NULL,false); $rss2->setChannelElement('language',$chan_arr['channel_language'],NULL,false); $rss2->setChannelElement('webMaster',$chan_arr['channel_webmaster'],NULL,false); $rss2->setDate($chan_arr['channel_lastbuilddate']); $rss2->addGenerator(); $i = 0; $length = count($items); while ($i < $length) { foreach ($items as $key => $value) { $item = $rss2->createNewItem(); $item->setTitle($items[$i]['item_title']); $item->setLink($items[$i]['item_link']); $item->setDate($items[$i]['item_pubdate']); $item->setDescription($items[$i]['item_description']); $item->setId($items[$i]['item_guid'],false); $item->addEnclosure($items[$i]['item_enclurl'],$items[$i]['item_encllength'],$items[$i]['item_encltype'],false); $item->setAuthor($items[$i]['item_author'],$itunes[$i]['itunes_email'],NULL); $source_url = ['url' => $items[$i]['item_source']]; $item->addElement('source',$chan_arr['channel_title'],$source_url,false,false); $item->addElement('comments',$items[$i]['item_comments'],NULL,false,false); } $newItems[] = $item; $i++; } foreach ($newItems as $item) { $rss2->addItem($item); } $rss2->printFeed(true); On the one hand, it appears that security is not an issue because I merely read and execute based upon what I have read. At no time do I write except to publish the final result. On the other hand, PHP files can easily be read using PHP functions such as the show_source( ) method. As Ingolme pointed out already many days ago. If I can see the file on the internet, then others are likely able to see it to.
×
×
  • Create New...