mrkhan
Members-
Posts
89 -
Joined
-
Last visited
Everything posted by mrkhan
-
Thanks diogo, but my issue is there is many JS files loading in each other and its simply not possible to add each file. is there way to load JS file from root or some JS function to get application root path? Thanks
-
Hello, i am trying to solve one issue from 2 days but no luck. i am developing one project in PW and its working perfect as always but issue is in footer file i am using one JS file as bellow <script src="<?php echo $config->urls->templates?>assets/js/script.js"></script> file load but script.js use few other files as bellow include('js/jquery.easing.1.3.js'); these files are not loading , i have copied the JS folder in root and Home page start working but when i goto sub pages JS again stop working. issue is with JS path. how to fix that ? Thanks
-
Thanks for all your help.
-
Hello pwired, thanks for your reply. i have did same but still same. <i class="fa fa-check-circle-o"></i> is deleted when i come from HTML to source. see the picture on bellow link of my field. http://s18.postimg.org/3ztuw45h5/Screen_Shot_2015_11_07_at_10_42_11_PM.png Thanks
-
Hello, i am trying to add <i class="fa fa-check-circle-o"></i> tag in body field but this tag is getting cleared by CKEditor. even in body field i have switch off the ACF and HTML purifier. i also try to put bellow lines in EXTRA Allowed Content <i>foo</i> <i> <i class="fa fa-check-circle-o"></i> now when i put above code in HTML source and press OK the above code got deleted. see attachment. how to fix this? Thanks
-
Hello, i am trying to built a contact form using Ajax. here is my code <form method="post" action="<?=$config->urls->root;?>subscribe/contact.php" id="contactForm1"> <input type="text" id="fullname" name="fullname" class="textbox" placeholder="Your name" required=""> <input required="" type="email" id="email" name="email" class="textbox" placeholder="Your email" > <input type="submit" value="Send"> </form> here is my Java Script <script> $(function() { var frm = $('#contactForm1'); frm.submit(function (ev) { ev.preventDefault(); var fullname = $('#fullname').val(); var email = $('#email').val(); $.ajax({ type: 'post', url: frm.attr('action'), data: 'fullname=' + fullname+'&email=' + email, success: function(results) { if(results==1) { $("#suscess").show(); } if(results==2) { $("#fail").show(); } } }); // end ajax }); }); </script> and here is my PHP file <?php $emailTo = "myemail@domain.com"; // sanitize form values or create empty $form = array( 'fullname' => $sanitizer->text($input->post->fullname), 'email' => $sanitizer->email($input->post->email), ); $msg = "Full name: $form[fullname]\n" . "Email: $form[email]" ; if(mail($emailTo, "Website contact form submission", "$msg", "From: $form[email]")) { echo "1"; }else{ echo "2" } ?> the error i am getting is on $sanitizer->text mail( Undefined variable: email i am thinking may be this PHP file in root/subscribe thats why processwire variables are not loading. also i can't access the PHP from Template folder. how to fix this issue. Thanks
-
Hello, thanks for reply and yes i am looking for Ryan's answer on PW core. Thanks
-
Hello, i am developing one web application in PW and my customer want to know that does PW support all security measures in OWASP? this is just for their website security and they want to be sure that their CMS is safe. i hope many of you are aware of this and help me in this. Thanks
-
Hello, thanks for response, i actually solve my problem by using Wire Mail SMTP Module. http://modules.processwire.com/modules/wire-mail-smtp/ its same like wireMail() and also have attachment option too, vary easy to use. Thanks
- 5 replies
-
- 2
-
- attachment
-
(and 1 more)
Tagged with:
-
Hello, thanks for update i really like the function wiremail() but how to attach form uploaded file with email using this function ? as for security i want to make it as much secure i can like 1. check file on uploading or attaching with email. 2. delete file after emails send. or any thing other option you can think for security. Thanks
- 5 replies
-
- attachment
-
(and 1 more)
Tagged with:
-
Hello, from the day i am using PW every day i am loving it more and more, its really great. i am trying to create a page for website where people can apply for job and send CV as attachment too. i was searching forums from last few days and create one page with combinations of many posts in form, my code is bellow. <style> #email2 { display:none; } #message-error { color:#F00;} #message-success { color:#09F;} </style> <?php // check if the form was submitted $spam_check=trim($input->post->email2); if($input->post->submit && $spam_check == '') { $sent = false; $error = ""; $emailTo = $page->email; // sanitize form values or create empty $form = array( 'fullname' => $sanitizer->text($input->post->fullname), 'job_title' => $sanitizer->text($input->post->job_title), 'job_id' => $sanitizer->text($input->post->job_id), 'contact' => $sanitizer->text($input->post->contact), 'email' => $sanitizer->email($input->post->email), 'comments' => $sanitizer->textarea($input->post->comments), ); $msg = "Full Name: $form[fullname]\n" . "Contact number: $form[contact]\n" . "Job Title: $form[job_title]\n" . "Job Id: $form[job_id]\n" . "Email: $form[email]\n" . "Comments: $form[comments]"; // attachment if(isset($_POST['submit']) && !empty($_FILES['file']['size'])) { $filename = $_FILES["file"]["name"]; $filetype = $_FILES["file"]["type"]; $filesize = $_FILES["file"]["size"]; $filetemp = $_FILES["file"]["tmp_name"]; if($filesize < 10) throw new Exception("File too small"); if($filesize > 1000000) throw new Exception("File too big"); $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if(!in_array($ext, array('doc', 'pdf', 'docx'))) throw new Exception("Invalid file type"); $destination = $config->paths->cache . $user->name . '.' . $ext; if(!move_uploaded_file($filetemp, $destination)) throw new Exception("Unable to move uploaded file"); $fp = fopen($destination, "rb"); $file = fread($fp, $filesize); $file = chunk_split(base64_encode($file)); unlink($destination); } // This two steps to help avoid spam $headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n"; $headers .= "X-Mailer: PHP v".phpversion()."\r\n"; // With message $headers .= "Content-Type: text/html; charset=utf-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; $headers .= "".$message."\n"; $headers .= "--".$num."\n"; // Attachment headers $headers .= "Content-Type:".$filetype." "; $headers .= "name=\"".$filename."\"r\n"; $headers .= "Content-Transfer-Encoding: base64\r\n"; $headers .= "Content-Disposition: attachment; "; $headers .= "filename=\"".$filename."\"\r\n\n"; $headers .= "".$file."\r\n"; $headers .= "--".$num."--"; if(mail($emailTo, "Job Application", $msg, "From: $form[email]",$headers)) { // populate body with success message, or pull it from another PW field $messageok = "<div id='message-success'><p>Thanks, your message has been sent.<b>We will Contact you back</p> </div>"; $sent = true; }else{ $error= "<div id='message-error'><p>Error! Mail Not Sent.</p></div>"; $sent = false; } } include("./head.inc"); ?> here is my form code Please enter your contact details below.<br /><br /> <?php if(strlen($error)>1) { echo $error; } // to get JOB title and id $job=$pages->get($input->urlSegment1); if(!$sent) { ?> <form action="./" method="post" class="contact-form" id="contactform"> <input id="job_title" name="job_title" type="hidden" value="<?php echo $job->title;?>" /> <input id="job_id" name="job_id" type="hidden" value="<?php echo $job->job_id;?>" /> <input Placeholder="Please Enter Your Name" name="fullname" id="fullname" value="<?php echo $form[fullname];?>" /> <input type="text" Placeholder="Please Enter Your Contact Number" name="contact" id="contact" value="<?php echo $form[contact];?>" /> <input type="text" name="email" id="email" Placeholder="Please Enter Your Email" /> <input type="file" name="file" id="file" value="Uplode Cv" /> <textarea id="comments" name="comments" cols="60" rows="3" Placeholder="Please Enter Your Message"><?php echo $form[comments];?> <input type="text" name="email2" id="email2"> <input name="submit" id="submit" type="submit" value="Send" /> </form> <?php }else{ echo $messageok; } include("./foot.inc"); ?> form is displaying properly but emails are not going and i am getting error "Error! Mail Not Sent." what i want to do is send email with attachment and then delete uploaded file from server and of course secure. really appreciate your update. Thanks
- 5 replies
-
- 1
-
- attachment
-
(and 1 more)
Tagged with:
-
Hello kongondo, thanks for your reply and i have download the profile but its different than i am looking for. i have job pages with template name job. i want to search from these pages. can you give me example of combining two select box in $jobs=$pages->find("template=job,$search_cat"); for example i have one select box name "select A" and other is "select B", how can i combine these two in above search if value is selected. Thanks
-
Hello, any update how can i make search page using multiple drop box. or any previous forum example? Thanks
-
Hello, i am trying to built one job search form but its not working, bellow is my code <form method="get" action="<?=$config->urls->root;?>search/"> <input type="text" placeholder="Keyword Search" name="keyword" id="keyword"> <select name="job_sector" id="job_sector"> <option>All Sectors</option> <option>Human Resources</option> <option>Consulting</option> </select> <select name="job_level" id="job_level"> <option>All Jobs Level</option> <option>Executive</option> <option>Manager</option> </select> <select name="job_location" id="job_location" > <option>All Locations </option> <option>city1</option> <option>city2</option> </select> <input type="submit" class="btn btn-primary btn-medium" value="Search Jobs" > </form> <?php $search_cat=""; // find any matching keyword if($input->get->job_keyword) { $search_cat="job_keyword~=".$input->get->job_keyword; } if($input->get->job_sector) { $search_cat=$search_cat.",job_sector=".$input->get->job_sector; } if($input->get->job_level) { $search_cat=$search_cat.",job_level=".$input->get->job_level; } if($input->get->job_location) { $search_cat=$search_cat.",job_location=".$input->get->job_location; } $jobs=$pages->find("template=job,$search_cat"); foreach($jobs as $job) { ?> but this code is not working. i want to find all pages with template job and any field select on form. Thanks
-
Hello, in my hosting server they are using suphp php handler, is this possible to use symlink in this php handler ? if its possible , how ? do that folder need some special permission for user who is accessing that folder or what ? or is there any other way of using one wire installation for multiple domains without using symlink. Thanks
-
Hi, i am trying to setup multi site on web server with few domains. on local host i was using symlink but now i am unable to create a symlink on web server, i have talked to web hosting company and they told me that they did't allow symlink due to security reasons. now i am thinking of some other way to have one wire folder and run 3 websites on 3 different domains. i found this link https://processwire.com/talk/topic/3534-one-processwire-installation-folder-for-multiple-sites-without-symbolic-links/ where it suggest to change variable in index.php file but i could not figure out how to do that. all my three domains are in one server and this is physical path of server with wire folder /home/domain1/public_html/wire for example my new domains which want to access wire folder is "domain2" so now what will be values for $rootPath = ? $rootPathWeb = ? $appPath = ? $appPathWeb = ? Thanks
-
Hello, thanks LostKobrakai for quick reply. i am using latest version of PW ProcessWire 2.5.24 dev. and i can't see any error in error log. i have copied "templates-admin" in site folder of website and uninstall the default admin theme. "wire" folder is on other domain and i am using it as "symlink". i also noticed some thing, if i install the default admin theme , i see admin page as attachment. its only on webserver. also if you notice in this i even can't see pages too. after more debugging in "default.php" in templates-admin directory i find out there is no value for "$content" i try this command aa <?php echo $content; exit;?> in local host i can see out put with pages but in web server it only show " aa " but no pages. but if i copy "wire" folder not "symlink" this variable have vales and show pages... Thanks
-
Hello i am using PW in Multi site using "symlink" website is working fine. for admin panel i am using custom theme and i have "templates-admin" folder in site folder too. but when i login to admin panel i can't see any pages. like attached screen shoot. but if i remove the "symlink" folder and put actual "wire" directory in website every thing works fine. how to fix this issue as i want to have one "wire" directory for all my sites in PW for future updating purpose. Thanks
-
Thanks
-
Hello , i am working on website where i need to upload PDF file with each product, its pretty standard i think here is what i am doing 1. i have created a new file type field name "pdf_file" and assign it to product template. for showing PDF file in website , after searching this forum i have come to this solution , please guide me if its wrong. 1. i have created a new template name "pdf" 2. i have created a new page from "pdf" template and its url is "site/pdf", also i have allow the URL Segments. 3. now from my product page i have created a link to open pdf file like this "site/pdf/page_id" 3. in "pdf.php" file i have bellow code <?php $pfile1=$input->urlSegment1; $pfile=$pages->get($pfile1); if($pfile->pdf_file->url){ $options = array( 'exit' => true, 'forceDownload' => false, 'downloadFilename' => '', ); wireSendFile($pfile->pdf_file->url,$options); } when this page open i got following error Error: Exception: File does not exist (in /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Functions.php line 536) #0 /Applications/XAMPP/xamppfiles/htdocs/site1/site/templates/pdf.php(18): wireSendFile(‘/site1/site...', Array) #1 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/TemplateFile.php(169): require('/Applications/X...') #2 [internal function]: TemplateFile->___render() #3 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Wire.php(365): call_user_func_array(Array, Array) #4 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/core/Wire.php(320): Wire->runHooks('render', Array) #5 /Applications/XAMPP/xamppfiles/htdocs/sit1/wire/modules/PageRender.module(356): Wire->__call('render', Array) #6 /Applications/XAMPP/xamppfiles/htdocs/site1/wire/modules/PageRender.module(356): TemplateFile->render() #7 [internal function]: PageRender->___renderPage(Object(HookEvent)) #8 /Applications/XAMPP/xamppfiles/htdocs/sit1/wire/core/Wire.php(365): call_user_func_array(Array, Array) #9 /Applications/XAMPP/xamppfiles/htdocs/s This error message was shown because you are logged in as a Superuser. Error has been logged. i am not sure i am doing proper & secure way to display PDF file on website. as i said earlier what i actually want to do is Display PDF file in new tab when click on PDF icon from website in secure way. Thanks for helping always.
-
Thanks every one for helping me. here is what i did to solve my issue just to help some one if he looking for same solution. my website directory structure is Home ⌊ site1 ⌊ site ⌊ wire ⌊ site2 ⌊ site ⌊ site3 ⌊ site if you see i have only one directory of wire in site1 folder. in other two websites site2 and site3 i created a PHP file in root and name it link.php so i can access this site like http://domain/link.php or http://localhost/site2/link.php here is my code for link.php <?php// for localhost , we can also set this according to our web server path also $target = '/Applications/XAMPP/xamppfiles/htdocs/site1/wire'; $shortcut = 'wire'; symlink($target, $shortcut); echo readlink($shortcut); ?> when you run this PHP this will create a link directory to your WIRE directory and website will start working
-
Hello diogo, i like your structure and want to have multisite like this but i don't understand do i need to have wire directory in each website home web1 public_html wire (the real one) site etc... web2 public_html wire (link to the first wire) site etc... web3 public_html wire (also link to the first wire) site etc... as you say wire (link to the first wire) what do you mean by this ? and this is what i am struggling how to create that link from web2 or web3 to real wire directory in web1, do i need to do settings in some file as index.config.php in root is working for me Thanks
-
i am sorry but i can't figure out how to fix that in localhost, now i have uploaded there websites on web server now my domains are as under 1. domain1.com ⌊ site-domain1 ⌊ wire and physical path is : /home/web1/public_html/site-domain1/ & /home/web1/public_html/wire/ 2. domain2.com ⌊ site-domain2 and physical path is : /home/web2/public_html/site-domain2/ 3. domain3.com ⌊ site-domain3 and physical path is : /home/web3/public_html/site-domain3/ all the 3 domains are on one server, can you please guide me how to make these sites running, i mean entry in index.config.php it might be vary simple & i am trying all my best but i can't figure out how to get it working. Thanks
-
Hello Martijn Geerts, ok if my folder structure is like this htdocs ⌊ site-web1 ⌊ site-web2 ⌊ wire what will be my in my index.config.php to load http://localhost/web1 http://localhost/web2 Thanks
-
why can't we have as i write ? and how we will have wire folder on web server ?