Jump to content

DenverR

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by DenverR

  1. thanks for the reply! i got this though Parse error: syntax error, unexpected T_IF in /home/***/public_html/***/index.php on line 132
  2. my current code for getting a page is <?php $page = $_GET['page']; //Gets the (page=) from the URL if($page){ $site = file_exists($page.'.html') ? $page.'.html' : 'home.html';} else{ $site = 'home.html'; // Else include the default home.php file. } include($site); ?> the problem with it is it only checks for html pages. I would like to have it check for html then php pages and it pull up whichever is valid. i tried to do it myself but im a php n00b. pls help <?php $page = $_GET['page']; //Gets the (page=) from the URL if($page){ $site = file_exists($page.'.html') ? $page.'.html' : 'home.html';} elseif $site = file_exists($page.'.php') ? $page.'.php' : 'home.html'; else{$site = 'home.html'; // Else include the default home.php file. } include($site); ?> ^^ is what i did. any help will be appreciated. Thanks
  3. nope just emails on elist.php the only thing it says is query failed
  4. I'm using 3 files to try and mass mail my members, massmail.php massmail-exe.php and elist.php massmail.php <form name="massmail" method="post" action="./massmail-exe.php"> <table width="450px"> <tr> <td valign="top"> <label for="subject">Subject</label> </td> <td valign="top"> <input type="text" name="subject" maxlength="50" size="30" id="subject"> </td> </tr> <tr> <td valign="top"> <label for="message">Email Content</label> </td> <td valign="top"> <textarea name="message" maxlength="9001" cols="100" rows="18" id="message"></textarea> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> </td> </tr> </table> </form> massmail-exe.php <?php // read the list of emails from the file. $email_list = file("./elist.php"); // count how many emails there are. $total_emails = count($email_list); // go through the list and trim off the newline character. for ($counter=0; $counter<$total_emails; $counter++) { $email_list[$counter] = trim($email_list[$counter]); } // implode the list into a single variable, put commas in, apply as $to value. $to = implode(",",$email_list); if ( mail($to,$_POST["subject"],$_POST["message"]) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?> and elist.php which has the email addresses. What is wrong because every time i try and send it it say query failed. Thanks so much.
  5. yep i just figured that out thanks
  6. hey, im working with a php nav system where all pages are index.php?page=home or index.php?page=aboutus and i wanted to change the Title for each so i quickly wrote $p=$_GET["page"]; if ($p=="home.php") echo "Welcome to the Home Page"; elseif ($p=="aboutus.php") echo "Staff Page"; else echo "Welcome to our website."; why doesnt that work?
×
×
  • 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.