Jump to content

pgsjoe

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pgsjoe's Achievements

Member

Member (2/5)

0

Reputation

  1. well that's why I know it's not a javascript problem, the script works fine. So I posted it in the PHP help area because I think it's just the way the php is arranged within the script. I just close out the php ?> put the script in, cut into the middle of the script with php <? database retrieval of information ?> then back into the javascript.
  2. it will not let me post the code for some reason. even in code format. you can view it here.... http://www.dynamicdrive.com/forums/showthread.php?t=13462 or here.... http://www.asse.org/gau/help.php thanks for looking into it!
  3. well I wasn't printing/echoing the script using PHP. I was closing out the PHP tags, entering in the javascript, opening the php tags in the editable region of the code, closing the php tags out and going back into the javascript. is there something special that has to be done to it? do I have to print the code through PHP? as for it not working at all, I've been using it for a while on a regular HTML page and it's been holding up okay.
  4. so I pulled some script off of DynamicDrive.com and used it on a regular HTML page and it worked awesome. But, once I tried to incorporate PHP into it, all of the sudden "it don't work so good". The script is suppose to float the menu on the page, and as you scroll down, it moves with you. And again it works fine on the regular page, so I'm almost positive it's not the javascript that's messed up. The box is taking on the CSS attributes (which it should) and parsing the correct information, as well as the rest of the page looking as it should, but the box doesn't float. I know there's a difference between client-side and server-side coding, but I really don't know what to do here. if you know anything, thanks in advance. So for some reason it won't let me post the code up...keeps giving me a "page cannot be displayed" error. So here's a link to a text version of the code. I've marked off the code that's not working with dashed lines. http://www.asse.org/gau/help.php and, if you need to see it. that's here... http://www.asse.org/gau/gauform.php thank you again in advance. this one is killing me!
  5. If someone enters in a paragraph of text with two or three links, as well as an e-mail address on my form and into the SQL database; in straight text format, no html on it whatsoever. Is there a function that I can use to scan the text and if anything is suppose to be a link, then to turn it into a link. Something like.... [code]if (www) {     $linktext = take remainder of text through ".com" (or whatever extension) to to the next space;     echo '<a href="' . $linktext . '" target="_blank">' . $linktext . '</a> ';     } if (@) {     $emailtext = read text before @ symbol to a space, read text after @ symbol through next space.     echo '<a href="mailto:' . $emailtext . '">' . $emailtext . '</a>';     }[/code] And the same for http://
  6. this could be a waste of time and I apologize if it's already common knowledge. I was hoping there was a function that would make it as simple as: * scanning a field * if http://, www, or @ exist to turn the surrounding into a link Tried searching on google as well as the forums, but could not figure out the correct terms to search on. Does this function exist, if so, where...oh where do I find it?!
  7. as for the mail error, that's on your server end and looks like it's not going to send even if you do get it. the problem seems to be that you're not pulling the variables from your form. The value of the "Name" textfield isn't $Name, it's [code]$Name = $_POST['name'];[/code] Try doing this for your code instead... [code] if (isset($_POST['name'])) { $Name = $_POST['Name']; $Practice = $_POST['Practice']; //etc. //then your code for the msg part of it... $msg = "OrthoRx Contact Page Submission\n\n"; $msg .= "Name: $Name\n\n"; //etc. //finally, the mail info $to = "$myemail@mydomain.com"; $subject = "CONTACT PAGE FROM OrthoRx WEBSITE"; $mailheaders = "From: OrthoRx Contact Page Submission Form <$emailAddress>\n"; $mailheaders .= "Reply-To:$Email_Address <$emailAddress>\n\n"; // Mail to address mail ( $to, $subject, $msg, $mailheaders ); //and don't forget to close out the if statement } [/code]
  8. ran into my next problem in "splitting the array". how can I control what it's spitting out? here's what I mean. [b]spitting out:[/b] [i]September 2006 - pdf version August 2006 - pdf version February 2006 - pdf version November 2005 - pdf version October 2005 - pdf version July 2005 - pdf version December 2004 - pdf version[/i] [b]what I want:[/b] [i]2006 Newsletters: September 2006 - pdf version August 2006 - pdf version February 2006 - pdf version 2005 Newsletters: November 2005 - pdf version October 2005 - pdf version July 2005 - pdf version 2004 Newsletters: December 2004 - pdf version[/i] or to be able to specify a range to print out...like so.... [i]2005-2006 Newsletters (July - June): June 2006 April 2006 December 2005 September 2005 July 2005 2004-2005 Newsletters: June 2005 May 2005 December 2005 July 2004[/i] I guess what I'm asking is that I don't know how to split up the krsort that it's spitting out. Help....again? Here's the code I'm using: [code] <?php if ($handle = opendir('./docs')) {   //echo "Directory handle: $handle\n";   //echo "Files:\n";   /* This is the correct way to loop over the directory. */   while (false !== ($file = readdir($handle))) { $tests = array($file); $months = array( '01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December', ); foreach ($tests as $test) { ### Make sure the name is valid. if (!preg_match('/^(\d{2})(\d{2})\.(doc|pdf)$/', $test, $matches)) { //echo "Skipping invalid file '$test'<br/>"; continue; } ### Make sure the month is valid. $month = $matches[2]; if (!array_key_exists($month, $months)) { //echo "Skipping invalid month for '$test'</br>"; continue; } ### Print. $year = 2000 + $matches[1]; $extension = $matches[3]; $files["$year$month"] = $months[$month] . ' ' . $year . ' - <a href="/docs/' . $file . '" target="_blank">' . $extension . ' version</a><br/>'; } } if ($files==0) echo "no newsletters currently on file"; else { krsort($files, SORT_NUMERIC); foreach ($files as $newsletter) { echo "$newsletter"; } }   closedir($handle); } ?>    [/code]
  9. if you've got any "answering juice" left in you...I don't know how to do that. the good news though, I will only ever ask once and also dissect it to understand it. thanks again.
  10. Wow...what a beauty! Actually got it working and everything to read the directory and spit 'em out. Now I'll push my luck one further...is there a way to arrange them in reverse order so the most recent month spits out on top?
  11. As long as you have the day, date and year your user does not need to input the actual day. You can echo that information out of php. I use day-month-year in seperate drop downs, then before inserting you can put it together and insert it into your database as a date. [code]$date = $year.'-'.$month.'-'.$day;[/code] Hope this helps, I've never answered anyone's question before.
  12. I'm still quite new to PHP so I appreciate the patience. WHAT I'VE GOT: About 75 different websites who all send me their newsletters to put up online. I have a naming convention, so each one of them gets named two digit year, then month (ex: 0609.pdf). Have to update the page manually everytime a newsletter is added as well as upload the pdf file. Can't automate by date because they all send in at different times. WHAT I'D LIKE: To have PHP read the directory and if 0609.pdf exists to echo 'September 2006 Newsletter (pdf version)' as a link. PROBLEM: Sometimes it's a PDF, sometimes it's a word DOC.
  13. damn! finally something I'd be able to answer and someone else beats me to it.
×
×
  • 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.