Jump to content

illuz1on

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

illuz1on's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I have made a bit more progress... <?php $mynewprice = $product_price; function deleteFirstChar( $mynewprice ) { return substr( $mynewprice, 1 ); } $rightprice = deleteFirstChar( $mynewprice ); ?> I was hoping $rightprice would be the stripped value of 550.00 -------------------------- I think im struggling because $product_price returns this: <div class="yagendoo_productPrice"> <span class="yagendoo_productPrice"> R550.00 </span> </div> So I think now, I need to make it strip ALL characters except for numeric chars.. Any ideas?
  2. Hi, Im looking at using a statement like this to remove all text characters from a string. $outgoing = substr_replace($incoming,"",-1); The string is a currency that has a currency symbol in the beginning of the string, like "R500.00" I would like to remove the R, so it is just a numeric value... Please can you help me with any ideas on how to get this going? Been reading so much and its all confused me too badly. Regards, Chris
  3. Thanks for the reply, still a bit confused though.. "Or if the second box is a dropdown you could do a show on it. I'm also sure there is a way with plain javascript except I don't know off the top of my head hopefully this helps ya out." The second one would be a dropdown - what do you mean a show on it? What would the include file contents be?
  4. [code]Hi, I have a select like below in my form, I want a second box to populate but differently for each activity. I would like to do this by means of something like this (case method really).. Any help would be much appreciated.. been struggling with it. Thanks alot, Chris [code] If () case '1'; query to fill for activity 1 case '2'; query to fill for activity 2 etc.. etc.. This is my current select for activity... <select name="posActivity" id="posActivity"> <option selected>Select an option</option> <option value="Abseiling Table Mountain">Abseiling Table Mountain</option> <option value="Breede River Rafting">Breede River Rafting</option> <option value="Table Mountain Hiking">Table Mountain Hiking</option> <option value="Kloofing Suicide Gorge">Kloofing Suicide Gorge</option> <option value="Surfing Cape Peninsula Tour">Surfing Cape Peninsula Tour</option> <option value="Quad Biking Mountain Expedition">Quad Biking Mountain Expedition</option> <option value="Scuba Diving">Scuba Diving</option> <option value="Shark Cage Diving">Shark Cage Diving</option> <option value="Tandem Skydiving">Tandem Skydiving</option> <option value="Sunset Horse Riding">Sunset Horse Riding</option> <option value="Cape Peninsula Tour">Cape Peninsula Tour</option> <option value="Safari">Safari</option> <option value="Wine Tasting">Wine Tasting</option> </select> [/code][/code]
  5. Thanks Ken, using your solution there and it works perfectly. Im also puzzling on how to make it send this mail to 2 recipients... at the moment its just the one... As in, support@ and to support2@ Here is another extract.. Thanks again, Chris $yourName = 'Cape-Town-Alive'; $yourEmail = 'support@capetownalive.co.za'; $yourSubject = 'New booking request'; $to = $yourName; $subject = 'New Booking Request: '.cleanPosUrl($_POST['posActivity']); $msg_flds = array('Name','Email','Staying','Country','Contact','Activity','Text'); $tmp = array(); $tmp[] = 'Cape Town Alive - Cape Xtreme Booking Request'; foreach($msg_flds as $fld) $tmp[] = $fld . ': ' . cleanPosUrl($_POST['pos' . $fld]); $message = implode("\r\n",$tmp); $tmp = array(); $tmp[] = "From: ".cleanPosUrl($_POST['posName'])." <".cleanPosUrl($_POST['posEmail']).">"; $tmp[] = "To: $yourName <$yourEmail>"; $headers = implode("\r\n",$tmp); $mailit = mail($to,$subject,$message,$headers);
  6. Hi, Im having problems with the snippet below, the $message part.. can anyone help me with the syntax please? Any help will be much appreciated.. Thanks alot Chris $message = 'Cape Town Alive - Cape Xtreme Booking Request' <br> 'Name:' . cleanPosUrl($_POST['posName']); . 'Email:' . cleanPosUrl($_POST['posEmail']); . 'Staying:' . cleanPosUrl($_POST['posStaying']); . 'Country:' . cleanPosUrl($_POST['posCountry']); . 'Contact:' . cleanPosUrl($_POST['posContact']); . 'Actvity:' . cleanPosUrl($_POST['posActivity']); . 'Comments:' . cleanPosUrl($_POST['posComments']); $headers = "From: ".cleanPosUrl($_POST['posName'])." <".cleanPosUrl($_POST['posEmail']).">\r\n"; $headers .= 'To: '.$yourName.' <'.$yourEmail.'>'."\r\n"; $mailit = mail($to,$subject,$message,$headers);
  7. Hi, I run a Joomla website, and I am trying to custom code a piece of code that performs the following function: When a comment is posted with JomComment on either a SOBI2 item, content item or blog, it inserts a line into SQL with the relevant LINK, TITLE, URL and TIME, which is then displayed as you can imagine. The link and title have to be taken from the specific components table in the database... I need more of a syntax and usage check of the PHP/SQL I use here, the method and insertion and etc is fine, the only problem is that is doesnt fetch the appropriate TITLE. The output looks like so: # Reviews : Chris Edington just wrote a blog titled 0 The 0 should be the title, fetched from the specific components table, fetched by ID which it gets out of the $bigstring (which is a full url, http://etc) with the substr code. Please if anyone can spot any errors or let me know how I could reapply this code properly, would be much appreciated, my first code i actually written myself so would love to succeed on this project! Thanks alot, Chris Thanks alot, <? if ($data->option == "com_content") { $strSQL1 = "SELECT `title` FROM #__content WHERE `id`='{$data->contentid}'"; $this->cms->db->query($strSQL1); $shoutName = $this->cms->db->get_value(); global $database; $link = $_SERVER['HTTP_REFERER']; $cool = $newid; $shout='[iurl='.sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$this->cms->user->id.'&Itemid=140').']'.$this->cms->user->name.'[/iurl] just wrote '.$cool.' a blog titled [iurl='.$link.']'.stripslashes($shoutName).'[/iurl]'; $database->setQuery("INSERT INTO #__liveshoutbox (time,name,text,url) VALUES ('".time()."','Reviews','".mysql_real_escape_string($shout)."','".$link."')"); $res = $database->query(); } ELSEIF ($data->option == "com_res2") { $bigstring = $_SERVER['HTTP_REFERER']; $newid = substr($bigstring,75,2); $strSQL1 = "SELECT `title` FROM #___res2_item WHERE `id`='$newid'"; $this->cms->db->query($strSQL1); $shoutName = $this->cms->db->get_value(); global $database; $link = $_SERVER['HTTP_REFERER']; $cool = $newid; $shout='[iurl='.sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$this->cms->user->id.'&Itemid=140').']'.$this->cms->user->name.'[/iurl] just wrote '.$cool.' a blog titled [iurl='.$link.']'.stripslashes($shoutName).'[/iurl]'; $database->setQuery("INSERT INTO #__liveshoutbox (time,name,text,url) VALUES ('".time()."','Reviews','".mysql_real_escape_string($shout)."','".$link."')"); $res = $database->query(); } ELSEIF ($data->option == "com_night2") { $bigstring = $_SERVER['HTTP_REFERER']; $newid = substr($bigstring,75,2); $strSQL1 = "SELECT `title` FROM #___night2_item WHERE `id`='$newid'"; $this->cms->db->query($strSQL1); $shoutName = $this->cms->db->get_value(); global $database; $link = $_SERVER['HTTP_REFERER']; $cool = $newid; $shout='[iurl='.sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$this->cms->user->id.'&Itemid=140').']'.$this->cms->user->name.'[/iurl] just wrote '.$cool.' a blog titled [iurl='.$link.']'.stripslashes($shoutName).'[/iurl]'; $database->setQuery("INSERT INTO #__liveshoutbox (time,name,text,url) VALUES ('".time()."','Reviews','".mysql_real_escape_string($shout)."','".$link."')"); $res = $database->query(); } ELSEIF ($data->option == "com_myblog") { $strSQL1 = "SELECT `title` FROM #___content WHERE `id`='{$data->contentid}'"; $this->cms->db->query($strSQL1); $shoutName = $this->cms->db->get_value(); } ELSE { $newid = "999"; $shout='[iurl='.sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$this->cms->user->id.'&Itemid=140').']'.$this->cms->user->name.'[/iurl] just wrote '.$newid.' a blog titled [iurl='.$link.']'.stripslashes($shoutName).'[/iurl]'; $database->setQuery("INSERT INTO #__liveshoutbox (time,name,text,url) VALUES ('".time()."','Reviews','".mysql_real_escape_string($shout)."','".$link."')"); $res = $database->query(); } ?>
  8. Im not sure what you mean by "And"... Well at the moment it brings up a box with all the id's and the values. I want to be able to use those values in a PHP mail function... but cant see how to? function showValues(form){ var values = ''; var len = form.length - 1; //Leave off Submit Button for(i=0; i<len; i++){ if(form[i].id.indexOf("C")!=-1||form[i].id.indexOf("B")!=-1)//Skip Continue and Back Buttons continue; values += form[i].id; values += ': '; values += form[i].value; values += '\n'; } alert(values); }
  9. Hey, I have a script that gets a whole bunch of values over a couple of pages, and this is how it output's at the moment. function showValues(form){ var values = ''; var len = form.length - 1; //Leave off Submit Button for(i=0; i<len; i++){ if(form[i].id.indexOf("C")!=-1||form[i].id.indexOf("B")!=-1)//Skip Continue and Back Buttons continue; values += form[i].id; values += ': '; values += form[i].value; values += '\n'; } alert(values); } [code] Im trying to get these values to something I could use in a PHP Mail function, so I can let the owner of the site see what the user selected, in the email the mailer sends him. Alternatively, if I could insert them into a database that would also be fine.. Any advice on how I would go about this? Thanks Chris [/code]
  10. I been looking around, and in the PHP manual its the same as I have there? foreach ($arr as $value) { echo "Value: $value<br />\n"; } Really cant figure out where to remove them
  11. Thanks for the help, much appreciated, but im still quite new to this and not sure what exactly to do, gave it a try but still same error..
  12. Ok I get some errors now, Parse error: syntax error, unexpected T_ELSE in /usr/www/users/taxmon/test.php on line 14 Something wrong with the else statement?
  13. Hey, I cant figure out in this contact form script the recipient email will be? Where would I enter the person receiving the mail's address? Thanks alot, Chris <? Error_Reporting(E_ALL & ~E_NOTICE); while ($request = current($_REQUEST)) { if (key($_REQUEST)!='recipient') { $pre_array=split ("&777&", $request); $post_vars[key($_REQUEST)][0]=$pre_array[0]; $post_vars[key($_REQUEST)][1]=$pre_array[1]; } next($_REQUEST); } reset($post_vars); $subject="From ".$post_vars['your_name'][0] ; $headers= "From: ".$post_vars['your_email'][0] ."\n"; $headers.='Content-type: text/html; charset=iso-8859-1'; $message=''; while ($mess = current($post_vars)) { if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) { $message.="<strong>".$mess[1]."</strong> ".$mess[0]."<br>"; } next($post_vars); } mail($_REQUEST['recipient'], $subject, " <html> <head> <title>Contact letter</title> </head> <body> <br> ".$message." </body> </html>" , $headers); echo ("Your message was successfully sent!"); ?> <script> resizeTo(300, 300); </script>
  14. Ok ive even simplified it, and it still wont work for me when I load the page.. it just shows a blank page as you can see here.. http://taxmon.designrobot.co.za/test.php Im really desperate to get this code working, really would appreciate any advice <body> <?php $thisPage = ( isset($_POST['showpage']) and ctype_digit($_POST['showpage'])? $_POST['showpage'] : '1' ); if ( $thisPage == '7' ) { // This is the last page - show/process results here foreach( $_POST as $name => $value ) { print "$name - $value<br>"; } else { // Other page - Create form and hidden inputs print '<form method="post" action="'.$_SERVER['php_SELF'].'">'; foreach ( $_POST as $name => $value ) { print '<input type="hidden" name="'.$name.'" value="'.$value.'">'; switch ( $thisPage ) { case '6': print '<input type="hidden" name="showpage" value="7">'; // Put PAGE 4 inputs here // END PAGE 6 break; case '5': print '<input type="hidden" name="showpage" value="6">'; // Put PAGE 4 inputs here // END PAGE 5 break; case '4': print '<input type="hidden" name="showpage" value="5">'; // Put PAGE 4 inputs here // END PAGE 4 break; case '3': print '<input type="hidden" name="showpage" value="4">'; // Put PAGE 3 inputs here // END PAGE 3 break; case '2': print '<input type="hidden" name="showpage" value="3">'; // Put PAGE 2 inputs here // END PAGE 2 break; case '1': default: print '<input type="hidden" name="showpage" value="2">'; // Start PG 1 print "hello"; // END PG 1 break; } print '</form>'; } ?> </body>
×
×
  • 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.