Jump to content

artist19

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

artist19's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've received help from another community/forum where I usually get help. Thanks anyway.
  2. Of course not. I was merely writing a concept and somebody can help rewrite or modify it. As I said, I'm not a programmer. If nobody wants to help, fine. I'm looking somewhere else.
  3. Correct anything? There are questions in the code after // ... and how to code $id...
  4. Here is a rough php code I wrote (I'm not a programmer but guess the way). I'm not sure about the rest of it -- <?php // correct anything? $content = array( 1 => array( $page_file => '/dir/welcome.php', $page_title => 'title page', $page_sidebar => '/dir/path/sidebar.php' ), 2 => array( $page_file => '/otherdir/otherpage.php', $page_title => 'title page', $page_sidebar => '/dir/about/sidebar.php' // and so on. ) ); $id = (how to refer to numbers above in array? e.g. 1 or 2); // modify or correct this one or... $file = isset($content[$id]) ? $content[$id] : '/dir/undercontruct.php'; // or this another way? how to correct this below or above? if((!isset($_GET["id"])) || (isset($_GET["id"]) && $_GET["id"] == "")) { $file = isset($content[$id]) } elseif(isset($_GET["id"]) && $_GET["id"] == $id;) { $content[$id] : '/dir/to/otherpage.php';} ?> ---------------------------------- not modify code below. i want these the way they are. ------- In template page: [..] <head> <title><?PHP echo $page_title; ?></title> [..] <div> <?php include $_SERVER['DOCUMENT_ROOT'] . $page_file; ?> </div> Thanks much!
  5. I'm having a trouble with the code only with one letter "W" in the script far below. The line $day = date('W'); does not work at all but all other lines work. E.g. $day = date('j'); $day = date('w'); etc They work. But 'W' does not work. Why? I tried the array to add: 0 => "anydir/apage.php", Not working. 01 => "anydir/apage.php", Also not working. What is wrong? Thanks much in advance. <?php $content = array( 1 => "dir1/page1.php", 2 => "dir2/page2.php", 3 => "dir3/page3.php", [..... ] 365 => "dir/page365.php" ); $day = date('W'); $file = isset($content[$day]) ? $content[$day] : 'dir/fail.php'; include $file; ?>
  6. I have these scripts for various purposes from "--" of the Day, "--" of the Week, etc. All of them have been working fine for the past months. Then after the new year, now all of these scripts on all pages don't work at all. It's like Y2K. Why, none of them work? What went wrong? They all worked fine until after the new year now. Please help, thanks. <?php $content = array( 1 => "dir/page1.php", 2 => "dir/page2.php", 3 => "dir/page3.php", [..... ] 365 => "dir/page365.php" ); $day = date('z'); $file = isset($content[$day]) ? $content[$day] : 'dir/fail.php'; include $file; ?>
  7. The part 'Define' variable does not show up. It shows blank. I tried different ways (by blind guesses) but no luck. Like these: <?php echo $rr->showStars($row_Signs['Define']); ?> or <?php $Rating -> echo $row_Signs['Define']; $rr->showStars("$Rating"); } ?> No luck but the only thing that works is to put any word in it (static) like: <?php echo $rr->showStars("any-word-you-place-here"); ?> It works but, not working with $variable in it. The code I use <?php echo $row_Signs['Define']; ?> in the other parts do work. I can't figure out these hints. Any ideas with possible codes? Your help would be greatly appreciated. Thanks.
  8. <?php echo $row_Signs['Define']; ?> Based on the name (Define) of the table (mySQL) above, how do I modify this rating line below? <?php $rr->showStars("sudoku"); ?> For example: <?php $rr->showStars($row_Signs['Define']); ?> but I'm not sure how to code this correctly. Yes, I am a php newbie. Thanks much in advance.
  9. I have had no luck with finding a email form all over the Internet for various reasons. Some insecure, some simple, some lack of attachment capability, some use redirect, etc. How does one find the right secure one? It's hard to believe that email form is one of the most basic needs yet there is barely any to find. The ideal email form would contain as follows: - php include. include email form into any php page - field error (or required field) displayed next to the field(s) rather than pop-up javascript error window - addable fields - thank-you message displayed below/above email form after submitting rather than redirecting to another page or ?extenstion (use same URL address) - secure, anti-spamming. Need CAPTCHA or is there secure enough without captcha? - attachment capability (not necessarily uploaded to a directory folder) - attachment files types accepted only (e.g. .mov, .wmv, and .flv only) - choice of size maximum Anyone who is experienced knows a code? Thanks in advance.
  10. How do you write a code that merges these similar multiple codes into one? E.g. <?php $content = array( 1 => "dir/filename.php", 2 => "other.php", 3 => "andso/on.php", ); $day = date('W'); $file = isset($content[$day]) ? $content[$day] : 'notes.php'; include $file; ?> The main page uses an include (the code above) for the content part. <?php $sidebar = array( 1 => "dir/filename/sidebar.php", 2 => "other-sidebar.php", 3 => "andson/sidebar.php", ); $day = date('W'); $file = isset($sidebar[$day]) ? $sidebar[$day] : 'notes.php'; include $file; ?> The main page uses an include for the sidebar part. <?php $title = array( 1 => "title of filename", 2 => "other title", 3 => "and so on", ); $day = date('W'); [not sure how to code this line] echo $title; ?> Rather than repeating the same, how do you code three together in an array? For example, CONCEPT below: <?php // code above header $rotate = array( 1 => "dir/filename.php", "sidebar/file.php", "title here" 2 => "other.php", "sidebar/anotherfile.php", "title here" 3 => "andso/on.php", "sidebar/antoher.php, "title here" $day = date('W'); $file = isset($content[$day]) ? $content[$day] : 'ls.php'; $sidebar = isset($content[$day]) ? $content[$day] : 'j.php'; $title = isset($title[$day]) ? $title[$day] : 'Title'; ?> <? // place an include in the main page include $file; ?> <? // place an include in the sidebar of the main page include $sidebar; ?> <? // place a title in the main page echo $title; ?> Thank you and greatly appreciated in advance.
  11. I use the code below to insert a partial content block on the web page (index.php). It is random but I would like to add a code to make it a content of the day for 365 days or 31 days. How can I add the code (date) to this below? Thanks much. <?php $content = array("s/skill.php","h/help.php","h/hello.php"); shuffle($content); echo file_get_contents($content[0]); ?>
×
×
  • 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.