Jump to content

james_byrne

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by james_byrne

  1. When I have installed WAMP in the past I do not remember that option, I will look when i get a miniuite though and see what i can come up with. And i do not understand what you mean by you do not have a website. WAMP is server software that runs Apache, Mysql, and PHP server all in one. So the box that you install wamp on will be hosting your site. Unless you were to move it to another box when the code is finished.
  2. in my opinion i would use a mysql database instead, of a access one. But see this tutorial on how to use a access database with php: http://www.databasedev.co.uk/microsoft-access-and-php.html. With the wamp error, i have no idea. I have used mamp quite a bit and never seen that error. My best guess would be to try to reinstall.
  3. ok, i have found out that the code i am using was not that great, the article uses some wrong things. I have fixed it up now though. The only issue i am having is centering the watermark. I think the most effective way to do that though. Would be through making the watermark image larger. And making it centered. I appreciate all your guyses help.
  4. ok thanks for your help. I appreciate it.
  5. I am using this open-source flv player so that i can play flv files in a web window, But my question is if you look that the code which is below it tells you the name of the flv file that that player is currently playing. I am wondering if there is a way that i can make that secure so that people can not just go and type the name of the flv file in there browser and have it download. Please let me know if you can help me. Thanks in advance for the help. FLV player code: <script type='text/javascript' src='swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=superman.flv'); s1.write('preview'); </script>
  6. ok so here is the code i am using, that is not working. But my current problem has changed a little bit, i have got it to display the image now, but it displays it with a box in the corner that has a black background then my watermark in that box. The watermark is a transparent png image though. and that should allow it to work the way i want it to. Below is my code, please let me know if you can help. Thanks in advance for the help. <? header('content-type: image/jpeg'); $src = "upload/cat15-id33.jpg"; $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($src); $size = getimagesize($src); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?>
  7. I would like to have a script on my site to eather watermark images on the fly, or to actually save the watermarked images. I have found this tutorial and it seems to work great, all except when the images is suppose to get displayed it does not show the image but instead shows wired caracters, like if you opend a jpg image in notepad. I just know i am missing something. But with this script is there anyway to save the watermarked image. Let me know please. Thank you A link to the script: http://www.sitepoint.com/article/watermark-images-php
  8. I am trying to make a cms for a website, and i am not really that knowledgeable in php, i have done more codding in asp. but i need to know how to after you have had php complete a task to redirect to a page. I have found a way with the header function but that will not work for me because there is already content on the page. I know in asp you do response.redirect(url) is there something simmlar in php?? Thanks in advance for the help.
  9. Ya you are correct, so i made it so it at least tells me that it is sending the e-mail now. The only thing is that it is not sending anything at all. Something else to troubleshoot. But thanks to everyone for the help. I appreciate it.
  10. I have tired this and i am getting a error. I am using this in a function. error: Warning: Cannot modify header information - headers already sent by (output started at /var/www/vcalendar/common_functions.php:316) in /var/www/vcalendar/registration.php on line 532 here is there original code: function SendEmailMessage($variable, $email_to, $parameters) { global $calendar_config; $value = 0; if (strlen($variable)) { $db = new clsDBcalendar(); $SQL = "SELECT email_template_from, ". "email_templates.email_template_subject AS mainSubject, ". "email_templates_lang.email_template_subject AS localeSubject, ". "email_templates.email_template_body AS mainBody, ". "email_templates_lang.email_template_body AS localeBody ". "FROM email_templates LEFT JOIN email_templates_lang ". "ON email_templates.email_template_id = email_templates_lang.email_template_id ". "WHERE email_template_type = ".$db->ToSQL($variable, ccsText). " AND language_id = ".$db->ToSQL(CCGetSession("locale"), ccsText); $db->query($SQL); if ($db->next_record()) { $email_subject = CCStrLen($db->f("localeSubject"))? $db->f("localeSubject") : $db->f("mainSubject"); $email_body = CCStrLen($db->f("localeBody"))? $db->f("localeBody") : $db->f("mainBody"); $email_from = CCStrLen($db->f("email_template_from"))? $db->f("email_template_from") : $calendar_config["site_email"$ while (list($key,$value) = each($parameters)) $email_body = str_replace($key,$value,$email_body); $email_body = str_replace("{site_url}",ServerURL,$email_body); if (strlen(trim($calendar_config["SMTP"]))) { $value = mailsmtp($email_from, $email_to, $email_subject, $email_body, "From: $email_from\nContent-Type: tex$ } else { $value = @mail($email_to, $email_subject, $email_body, "From: $email_from\nContent-Type: text/plain"); if ($value) $value = ""; else $value = "Email sending ERROR"; } } $db->close(); } return $value; } and when i change it it looks like this: function SendEmailMessage($variable, $email_to, $parameters) { global $calendar_config; $value = 0; if (strlen($variable)) { $db = new clsDBcalendar(); $SQL = "SELECT email_template_from, ". "email_templates.email_template_subject AS mainSubject, ". "email_templates_lang.email_template_subject AS localeSubject, ". "email_templates.email_template_body AS mainBody, ". "email_templates_lang.email_template_body AS localeBody ". "FROM email_templates LEFT JOIN email_templates_lang ". "ON email_templates.email_template_id = email_templates_lang.email_template_id ". "WHERE email_template_type = ".$db->ToSQL($variable, ccsText). " AND language_id = ".$db->ToSQL(CCGetSession("locale"), ccsText); $db->query($SQL); if ($db->next_record()) { $email_subject = CCStrLen($db->f("localeSubject"))? $db->f("localeSubject") : $db->f("mainSubject"); $email_body = CCStrLen($db->f("localeBody"))? $db->f("localeBody") : $db->f("mainBody"); $email_from = CCStrLen($db->f("email_template_from"))? $db->f("email_template_from") : $calendar_config["site_email"$ while (list($key,$value) = each($parameters)) $email_body = str_replace($key,$value,$email_body); $email_body = str_replace("{site_url}",ServerURL,$email_body); require_once "Mail.php"; $from = $email_from; $to = $email_to; $subject = $email_subject; $body = $email_body; $host = "mysmtpserver"; $username = "XXXXXX"; $password = "XXXXXXXXXX"; $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array('host' =>$host, 'auth' => $ture, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); $vaule = ""; } else { echo("<p>Message successfully sent!</p>"); $value = "Email sending ERROR"; } } $db->close(); } return $value; } if i run a smiler script in its own file it works fine, but it will not work it in a function i guess. Is there anyone who has any ideas. Thanks in advance for the help.
  11. I am trying to use vcalendar on a site that i am working on and i need to edit the e-mail function they are using to put a user name and password in for the smtp server. My question is how can i pass the a user name and password for my smtp server to the php mail function so that it can use my smtp server as a relay. Thanks in advance for the help.
×
×
  • 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.