Jump to content

webguy262

Members
  • Posts

    95
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

webguy262's Achievements

Member

Member (2/5)

0

Reputation

  1. also on the wish list, after the redirect, the browser should display the original requested url
  2. I've got this in the htaccess... redirect 301 /newsite/oldfile.html http://newwebdesign.com/newsite/new.php ... and it is working. The new.php file will dynamically create the content I want IF i can access the URL of the file requested BEFORE the redirect. That is, I need to access 'oldfile' from new.php. Can that be done?
  3. Thanks for the response... The sitemap for the site will have links to ~200 landing pages that should ideally have url's ending in html. Rather than have to create ~200 distinct pages, I thought it might be possible to have all the xxx.html url's call the same php page, and dynamically serve up the various pages, with titles, keywords, alt tags, content, etc. programmed to reflect the url requested. I want to do this with pages that load as html pages, tho, not php pages with get's in the url. Thoughts?
  4. Working on a site with a couple hundred virtually identical landing pages to maximize SEO. Rather than hard code the pages, I am wondering if there is a way to have one page that handles all the url's and dynamically codes and loads with title, keywords, content & alt tags all specific to the particular url requested. Seems like the challenge is doing it in a way that does not constitute a redirect. Is it better to do this in the .htaccess?
  5. this does not work for me... $category=mysql_real_escape_string($_GET['category']); if (is_int($category)) { i echo out $category and confirm it is an integer and yet the if statement does not fire what am i missing?
  6. That suggestion helped me find the problem... Another form in the project displays the imploded array as a comma delimited list. I added a space after the comma in the implode statement so I could just grab the string and output it as is. So when I ran the in_array, I was comparing strings with the extra space, against strings without the space. Thanks for your help!
  7. Thanks xyph... I'm almost there! The issue now is that only the first of several checked values comes back checked. Here's the current code... <?php // $session->userinfo['specialization'] is a database field. // echo $session->userinfo['specialization']; THIS WORKS AND OUTPUTS THREE VALUES AS "Automotive, Aerospace, Biotech/Life Sciences" $aSpecialization = array('Automotive', 'Aerospace', 'Biotech/Life Sciences', 'Chemicals', 'Damages Analysis', 'Electronics', 'Litigation', 'Manufacturing ', 'Materials', 'Medical Devices', 'Mobile Applications', 'Patent Prosecution', 'Physics', 'Renewable Energy', 'Semiconductors', 'Software', 'Telecommunications', 'Utilities'); //converting comma separated into array using explode function $dbspecialization= explode(',',$session->userinfo['specialization']); // echo $dbspecialization; THIS IS CONFIRMED AR AN ARRAY... OOUTPUTS 'Array' foreach ($aSpecialization as $specialization) { if(in_array($specialization,$dbspecialization)) { echo '<input name="specialization[]" type="checkbox" value="'.$specialization.'" CHECKED> '.$specialization.' <br />'; } else { echo '<input name="specialization[]" type="checkbox" value="'.$specialization.'"> '.$specialization.' <br />'; } } ?> So I'm still missing something.. Thoughts?
  8. Trying to get a form to display checked and unchecked values based on what is in the database. Hard coded form works fine. I implode the array and it goes into the database as a comma delimited string. But I need to let users edit the checkbox values, so I need to create the form by exploding the string, iterating through the array, and outputting the checkbox form elements. Here's what I have... <p>Specialization: <p> <?php //echo $session->userinfo['specialization']; THIS DISPLAYS THE STRING CORRECTLY $aSpecialization = array('Automotive', 'Aerospace', 'Biotech/Life Sciences', 'Chemicals', 'Damages Analysis', 'Electronics', 'Litigation', 'Manufacturing ', 'Materials', 'Medical Devices', 'Mobile Applications', 'Patent Prosecution', 'Physics', 'Renewable Energy', 'Semiconductors', 'Software', 'Telecommunications', 'Utilities'); //converting comma separated into array using explode function $dbspecialization= explode(',',$session->userinfo['specialization']); // echo $dbspecialization; THIS IS CONFIRMED AS AN array foreach ($aSpecialization as $specialization) { if(in_array($specialization,$dbspecialization)) { echo '<input name="specialization[]" type="checkbox" value="$specialization" CHECKED> $aSpecialization[] <br />'; } else { echo '<input name="specialization[]" type="checkbox" value="$specialization"> $aSpecialization[] <br />'; } } ?> But the output I get is... <input name="specialization[]" type="checkbox" value="$specialization" CHECKED> $aSpecialization[] <br /> <input name="specialization[]" type="checkbox" value="$specialization"> $aSpecialization[] <br /> <input name="specialization[]" type="checkbox" value="$specialization"> $aSpecialization[] <br /> etc... What am I missing?
  9. Trying to sort out setting a cookie that allows visitor to decide which sub domain to go directly to in subsequent visits. Somewhat complicated by the fact that the sub domains are running seprate instances of wordpress. Here's the code... any suggestions appreciated! <?php if (isset($_POST['submitted'])) { $site=$_POST['site']; setcookie("SitePref",$site, time() + 60*60*24*30, 'historybee.com'); if ($site == 'ms') { header("Location: http://ms.historybee.com/"); } elseif ($site == 'hs') { define('WP_USE_THEMES', true); require('./wp-blog-header.php'); } } else { //if we have a cookie, load the site if (isset($_COOKIE['SitePref'])) { if (($_COOKIE['SitePref']) == 'hs') { define('WP_USE_THEMES', true); require('./wp-blog-header.php'); } else { header("Location: http://ms.historybee.com/"); } } else { //if we don't have a cookie, load the form ?> <!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=utf-8"> <title>The National History Bee</title> </head> <body style="margin:0;padding:0;background: url('http://ms.historybee.com/wp-content/themes/makinghistoryblue/img/body_bg_hb5.jpg') repeat-x scroll center top #F2BF3B;"> <div align="center" style="width:800px;margin:0 auto;background:#fff;"> <p><img src="http://ms.historybee.com/wp-content/themes/makinghistoryblue/img/nhb_logo.png"> <p><h1>Welcome to the National History Bee!</h1> <p>The National History Bee has both High School and Middle School competitions. <p>Please choose which site you would like to visit. Your choice will be remembered for 30 days. <form action= "<?php echo $_SERVER['PHP_SELF']; ?>" method ="POST"> <input type="radio" name="site" value="ms"> Middle School Competition <input type="radio" name="site" value="hs"> High School Competition <input type ="hidden" name="submitted" value="true"> <p><input type="submit" value="Remember My Choice"> </form> <br /><br /><br /> </div> </body> </html> <?php } } ?>
  10. you're right... the date never went into the dbase correctly.
  11. Gett an error from some custom code I inherited in a WordPress installation. Here is the error... Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [<a href='datetime.--construct'>datetime.--construct</a>]: Failed to parse time string (--) at position 0 (-): Unexpected character' in /home2/history8/public_html/bee/wp-content/themes/makinghistoryblue/beeteachers.php:27 Stack trace: #0 /home2/history8/public_html/bee/wp-content/themes/makinghistoryblue/beeteachers.php(27): DateTime->__construct('--') #1 /home2/history8/public_html/bee/wp-includes/plugin.php(395): bee_teachers('') #2 /home2/history8/public_html/bee/wp-admin/admin.php(151): do_action('bee_teachers', Array) #3 {main} thrown in /home2/history8/public_html/bee/wp-content/themes/makinghistoryblue/beeteachers.php on line 27 Here is the code... <?php $teachers = $wpdb->get_results("SELECT * FROM bee_teachers,bee_postmeta WHERE bee_teachers.statebee=bee_postmeta.post_id and meta_key='regional_date' ORDER BY meta_value ASC"); $today = new DateTime(); foreach ($teachers as $teacher): $site = get_post($teacher->statebee)->post_title; $date = new DateTime($teacher->meta_value); // this is line 27, mentioned in the error if($date<$today) $style=' style="color:#999"'; else $style=''; ?> If I remm out these lines, the query works, just no styling difference based upon date... $date = new DateTime($teacher->meta_value); // this is line 27, mentioned in the error if($date<$today) $style=' style="color:#999"'; else $style=''; Thoughts?
  12. In a LAMP environment at Media Temple, at least one pdf i'm hosting is hanging in IE (FF, Chrome, etc. work fine). In IE, the PDF partially downloads but then just hangs. It opens, but only to a certain page. Everything works fine if I host the file on a Win box. IE gets the whole thing. Any thoughts?
  13. Thanks to all. Now I just need to pore over all of it and try to learn what I don't understand!
  14. tried this... <?php error_reporting(E_ALL); include ('tempconv.class.php'); $temp = new Temperature(100); echo "In Fahrenheit: " . $temp->getTemp("f"); ?> ...but i don't get anything
×
×
  • 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.