Jump to content

pgsjoe

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by pgsjoe

  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.
  14. YES! That's exactly what I was looking for. You rule. Thank you.
  15. I'm sure there's a name for what I'm looking for, I just don't know it, or how to do it. Basically, I have a form for people to enter their teams. So they would put the name for team, then each person's name, e-mail and phone. I then want these to enter into the database in 4 fields. Team Name, Name, E-mail, Phone...but for each person. So how would I do such a thing? Thanks in advance. I really appreciate it.
  16. I'm not well versed in SQL or PHP! Thanks guys. You rule!
  17. so I'm already using this.... [code]  $result = @mysql_query('SELECT * FROM `vince` WHERE `display` = "yes" GROUP BY showdate ASC, pk ASC'); if (!$result) {   exit('<p>Error performing query: ' .       mysql_error() . '</p>'); } while ($row = mysql_fetch_array($result)) { [/code] to pull from my database. But I only want to return the first 3 results by date. How? Thanks in advance.
  18. So using a series of if statements, I've gone through and combined some smaller websites that I run into one paged websites with different information under each if statement. i.e.- if (chapter) ...chapter info if (links) ...link info I've got information that I want to show up on the index page, but when someone clicks on a different link I want that information to go away. The statement I'm using for this is.... [code] if (isset($_GET['news']) || isset($_GET['all'])) { ...page info... }[/code] My question is, what do I set the index page information as to display when only the web address is put in. Right now, inside a statement like that, the page shows up blank. Then when you click on the home page link, you are shown what's there. Is there something like index.php=1 that will make it show up when only the URL is entered in the address bar? Did I lose you?
  19. get me started?!?!! you did all the legwork, it's practically done. thanks brutha.
  20. Not sure if it's suppose to be Javascript driven or PHP but here's what I want to do. I have two radio buttons on a form. "Member" and "NONmember". If they check "Member" I wanted to do that cool little thing where a field would then pop up asking for their member number, but that field is not there unless they "check" that particular button, and then if it's not clicked it goes away. My guess is Javascript, something along the lines of an onClick="return(memberyes)"; I'm just not versed enough in it to write it. But, if there's a PHP way, that'd be awesome. Thanks in advance. - JoE - ------------------------------------ tried this so far with no luck. [code]<script type="text/javascript"> function member(yes) {     var thisform=document.semfest;         if (thisform.member[1].checked)             print ('<tr>       <td>if member, member #:  </td>       <td><input name="membernumber" type="text"></td>     </tr>');     } </script> <input name="member" type="radio" value="member" onClick="return member(yes)"> Member <input name="member" type="radio" value="NONmember"> NonMember[/code]
  21. situation: I have a jobs database. All job info is in there. My primary key is a field called "pk" and automatically increments. I also have a field called "id" which is a 30 character randomly generated string used for editing purposes. the jobs 'print' out on the page in order of the PK field, but now when I delete a job, I need to almost do a ripple delete and have the numbers resort back into an order beginning at 1. example: I have jobs 1-45. I delete jobs 5-10. I now need this list to reflect this change and label the jobs as 1-40, instead of what it's doing which is 1-4, 11-45. I'm quite the newbie still...so please be gentle. - JoE -
  22. So I decided I want the ID #'s assigned to each row in my database to be off the wall confusing just to make sure nobody would be able to guess other ones. Here's why...a person enters an event into the database, they get an e-mail back with a link to edit the event that is reference by the ID. So obviously using IDs as simple as 32, 33, 34 some jerk could easily mess with all listings. So I found this code.... [code]settype($template, "string"); // you could repeat the alphabet to get more randomness $template = "1234567890abcdefghijklmnopqrstuvwxyz"; function GetRandomString($length) {        global $template;        settype($length, "integer");        settype($rndstring, "string");        settype($a, "integer");        settype($b, "integer");              for ($a = 0; $a <= $length; $a++) {                $b = rand(0, strlen($template) - 1);                $rndstring .= $template[$b];        }              return $rndstring;       }    $id = GetRandomString(30);[/code] And it works beautifully! Get the id as: vzda0brfh10by64qoby25m440n99jhj Now, it feeds it into the database, even displays it back on the page. But, for some reason, it won't allow me to edit it. The "edit" process I'm running through worked for, and still works for any IDs set as a couple digits. I changed my primary key from INT to VARCHAR since it wouldn't accept TEXT as a primary. Just seems weird that it will read and register in the database, but not allow me to edit it. So, wonder if anyone has any ideas why this would happen or if there's a better way. Oh, one more question. I was contemplating using the rand() function, because it says it goes up to 32,000 or something, and I know I won't need more than that. But, if using it as a primary, do I have to worry about it duplicating numbers and then not allowing my customers to post? Thanks in advance.
  23. [!--quoteo(post=358302:date=Mar 25 2006, 12:06 PM:name=annihilate)--][div class=\'quotetop\']QUOTE(annihilate @ Mar 25 2006, 12:06 PM) [snapback]358302[/snapback][/div][div class=\'quotemain\'][!--quotec--] Echo out the value of $sql to the browser and see if it contains the correct value for id. [/quote] As is...just got this... [code]UPDATE calendar SET date='2006-03-01', type='', chapter='No Chapter Currently Listed', website='http://', title='Jon B', location='', address='', city='', state='', zip='', description='No Description', email='', display='', remove='2006-03-07' WHERE id='' This event has been updated. Way to go, champ![/code] Removed the quotes from $id to make this.... [code]      $sql = "UPDATE calendar SET           date='$date',        type='$type',        chapter='$chapter',        website='$website',        title='$title',        location='$location',        address='$address',        city='$city',        state='$state',        zip='$zip',        description='$description',        email='$email',           display='$display',        remove='$remove'        WHERE id=$id";               echo $sql;       //replace event with info from above [/code] And got this...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]UPDATE calendar SET date='2006-03-01', type='', chapter='No Chapter Currently Listed', website='http://', title='Boxing Day', location='', address='', city='', state='', zip='', description='No Description', email='', display='', remove='2006-03-07' WHERE id= Error adding submitted event: You have an error in your SQL syntax near '' at line 16 Please contact our web support.[/quote] Do note though...the title is the updated title I entered in. So it's reading that much correctly. Got it to work with this pretty little puppy right here! Thanks for all your help man. $id = $_POST['id'];
×
×
  • 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.