Search Results

Search found 19375 results on 775 pages for 'codeigniter url'.

Page 20/775 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • IIS7 url rewrite rules

    - by sympatric greg
    In a hosted environment, I will be utilizing subdomains (and virtual directories) for various coding projects. I have a rewrite rule that changes 'subdomain.domain.com/url' to 'domain.com/subdomain/url'. This worked fine, except that the browser couldn't find resources with paths generated by ResolveURL("~/something"). The server was using the Application Path of "/subdomain/" so based on the rewrite rule, the browser's request for "/subdomain/something" was being looked for in "/subdomain/subdomain/something" were it wasn't to be found. either of these urls were valid: http://www.domain.com/subdomain/something http://subdomain.domain.com/something I resolved this by adding a another url rewrite rule to the subdomain: <rule name="RemoveSuperDir"> <match url="subdomain/(.*)" /> <action type="Rewrite" url="{R:1}" /> </rule> So for each subdomain that I might add, I will need to add such a rule. Is there a way to write a single rule at the domain level to resolve this issue?

    Read the article

  • django url matching with Lighttpd fastcgi

    - by 7seb
    I have a problem with url. I can access the djando app home page ( localhost/djangotest/ ) but can't access the admin section ( localhost/djangotest/admin/ ). I can access it using the django server instead of lighttpd. Lighttp conf : fastcgi.server = ( "/djangotest/" => ( "main" => ( "host" => "127.0.0.1", "port" => 3033, "check-local" => "disable", ) ), ) url.rewrite-once = ( "^(/media.*)$" => "$1", "^/favicon\.ico$" => "/media/favicon.ico", "^/djangotest/[^?](.*)$" => "/djangotest/?$1", ) The django url.py is just : (i just uncommented the good lines) : from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), ) I tried many things but without success ... (no need to link to https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/ ) lighttpd/1.4.28 Python 2.7.2+ Django 1.3.0

    Read the article

  • Mod Rewrite Help - Pseudo-Subdirectories

    - by Gimpyfuzznut
    I am dealing with a frustrating problem with Joomla that is going to require some url trickery. The idea is straight-forward but after reading a bunch of guides for mod-rewrite, I still can't seem to get it work. Let's say my site is www.mysite.com. Joomla is already performing some rewriting for SEF urls so I have links like www.mysite.com/home and www.mysite.com/news and so on. I want to be able to have (4) pseudo-subdirectories like www.mysite.com/mode1/ and www.mysite.com/mode2/ and so on. These subdirectories should work as if the subdirectory isn't there, ie both www.mysite.com/mode1/home and www.mysite.com/mode2/home should pull up the same www.mysite.com/home. It should point any www.mysite.com/mode1/anypagehere to www.mysite.com/anypagehere. The reason I am asking for this is because I will be reading the url for mode1, mode2, etc, to modify the template page. There will be a landing page that will direct people to /mode1/ and /mode2/ etc and the template will change based on that. Note, that I don't want to actually pass a parameter to the url accessible by a GET or whatever because Joomla removes it (perhaps because of my current mod_rewrite settings). I've pasted the current .htaccess file. RewriteBase /joomla ##########Rewrite rules to block out some common exploits RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] # Block out any script trying to base64_encode crap to send via URL RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] # Block out any script that includes a <script> tag in URL RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] # Block out any script trying to set a PHP GLOBALS variable via URL RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST variable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) # Send all blocked request to homepage with 403 Forbidden error! RewriteRule ^(.*)$ index.php [F,L] ########## Begin - Joomla! core SEF Section RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/index.php RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] RewriteRule (.*) index.php #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] ########## End - Joomla! core SEF Section

    Read the article

  • IIS7 URL Rewrite for URL with &rsquo;

    - by blizz
    I'm trying to redirect the following URL in IIS7 using the URL Rewrite module: Category/Cat-3/Objectives-of-Pre-Maintenance/WHAT&rsquo;S-THE-STORY-ON-LOW-CARB-DIETS-AND-EXERCISE-.aspx but for the life of me I can not get it. I tried replacing the &rsquo; with an actual single quote, and that worked fine! But for the purpose of this redirect, I need the HTML code for the quote, and not the quote itself. Here is the rule from web config: <rule name="Redirect" patternSyntax="ECMAScript" stopProcessing="true"> <match url="^Category/Cat-3/Objectives-of-Pre-Maintenance/WHAT&amp;rsquo;S-THE-STORY-ON-LOW-CARB-DIETS-AND-EXERCISE-\.aspx" /> <conditions> <add input="{HTTP_HOST}" pattern="www.example.com" /> </conditions> <action type="Redirect" url="http://www.example.com/redirecturl/" appendQueryString="false" /> </rule> Any ideas would be very helpful! Thanks

    Read the article

  • .htaccess redirect, from old dirty URL to a clean new URL with parameters

    - by JustAnil
    I have the following 2 links, I'm not great with .htaccess rules yet. Old URL: http://www.mywebsite.org.uk/donate/donate.php?charity_id=885&project_id=18111 New URL: http://new.mywebsite.org.uk/donation/to/885/18111 I want all the traffic coming from the old URL to the new url (including the parameters charity_id & project_id). I'm trying to learn .htaccess rules, but finding the tutorials online to be kinda vague. I'd really like a simple explanation on the .htaccess rules. (Give a man a fish, feed him for a day, teach a man to fish, feed him for a lifetime). The correct answer will be the answer with a simple and useful explanation (along with the rules if possible!).

    Read the article

  • Proper way of deleting records with Codeigniter

    - by luckytaxi
    I came across another Stackoverflow post regarding Get vs Post and it made me think. With CI, my URL for deleting a record is http://domain.com/item/delete/100, which deletes record id 100 from my DB. The record_id is pulled via $this->uri->segment. In my model I do have a where clause that checks that the user is indeed the owner of that record. A user_id is stored in a session inside the DB. Is that good enough? My understanding is, POST should be used for one time modification for data and GET is for retrieving regards (e.g. viewing an item or permalink).

    Read the article

  • Problem with ajax form on Codeigniter

    - by Code Burn
    Everytime I test the email is send correctly. (I have tested in PC: IE6, IE7, IE8, Safari, Firefox, Chrome. MAC: Safari, Firefox, Chrome.) Nome: Jon Doe Empresa: Star Cargo: Developer Email: [email protected] Telefone: 090909222988 Assunto: Subject here.. But I keep recieving emails like this from costumers: Nome: Empresa: Cargo: Email: Telefone: Assunto: CONTACT_FORM.PHP <form name="frm" id="frm"> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Nome<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="Cnome" id="Cnome" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Empresa<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmpresa" id="CEmpresa" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Cargo</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CCargo" id="CCargo" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Email<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmail" id="CEmail" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Telefone</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CTelefone" id="CTelefone" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Assunto<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><textarea class="texto textocinzaescuro" name="CAssunto" id="CAssunto" rows="2" cols="28"></textarea></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >&nbsp;</div> <div class="campoFormulario inputDeCampo" style="text-align:right;" ><input id="Cbutton" class="texto textocinzaescuro" type="submit" name="submit" value="Enviar" /></div> </form> <script type="text/javascript"> $(function() { $("#Cbutton").click(function() { if(validarForm()){ var Cnome = $("input#Cnome").val(); var CEmpresa = $("input#CEmpresa").val(); var CEmail = $("input#CEmail").val(); var CCargo = $("input#CCargo").val(); var CTelefone = $("input#CTelefone").val(); var CAssunto = $("textarea#CAssunto").val(); var dataString = 'nome='+ Cnome + '&Empresa=' + CEmpresa + '&Email=' + CEmail + '&Cargo=' + CCargo + '&Telefone=' + CTelefone + '&Assunto=' + CAssunto; //alert (dataString);return false; $.ajax({ type: "POST", url: "http://www.myserver.com/index.php/pt/envia", data: dataString, success: function() { $('#frm').remove(); $('#blocoform').append("<br />Obrigado. <img id='checkmark' src='http://www.myserver.com/public/images/estrutura/ok.gif' /><br />Será contactado brevemente.<br /><br /><br /><br /><br /><br />") .hide() .fadeIn(1500); } }); } return false; }); }); function validarForm(){ var error = 0; if(!validateNome(document.getElementById("Cnome"))){ error = 1 ;} if(!validateNome(document.getElementById("CEmpresa"))){ error = 1 ;} if(!validateEmail(document.getElementById("CEmail"))){ error = 1 ;} if(!validateNome(document.getElementById("CAssunto"))){ error = 1 ;} if(error == 0){ //frm.submit(); return true; }else{ alert('Preencha os campos correctamente.'); return false; } } function validateNome(fld){ if( fld.value.length == 0 ){ fld.style.backgroundColor = '#FFFFCC'; //alert('Descrição é um campo obrigatório.'); return false; }else { fld.style.background = 'White'; return true; } } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateEmail(fld) { var tfld = trim(fld.value); var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = '#FFFFCC'; //alert('Email é um campo obrigatório.'); return false; } else if (!emailFilter.test(tfld)) { //alert('Email inválido.'); fld.style.background = '#FFFFCC'; return false; } else if (fld.value.match(illegalChars)) { fld.style.background = '#FFFFCC'; //alert('Email inválido.'); return false; } else { fld.style.background = 'White'; return true; } } </script> FUNCTION ENVIA (email sender): function envia() { $this->load->helper(array('form', 'url')); $nome = $_POST['nome']; $empresa = $_POST['Empresa']; $cargo = $_POST['Cargo']; $email = $_POST['Email']; $telefone = $_POST['Telefone']; $assunto = $_POST['Assunto']; $mensagem = " Nome:".$nome." Empresa:".$empresa." Cargo:".$cargo." Email:".$email." Telefone:".$telefone." Assunto:".$assunto.""; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: no-reply' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail('[email protected]', $mensagem, $headers); }

    Read the article

  • CodeIgniter - Post multiple arrays to controller

    - by Bobe
    I have a dynamically generated form that allows users to enter new data and edit existing data. When the form is submitted, it collates the input values and groups them according to whether they are new or not, the former being denoted by class="new-entry". So the function generates two arrays: updateData and insertData. Both arrays are of similar formats: [ 0: { 'id' = 1, 'value' = foo }, 1: { 'id' = 1, 'value' = 'bar' }, etc... ] I am combining them into a new array object to send via ajax to the controller: var postData = { 'update_data': updateData, 'insert_data': insertData }; Then in the ajax call: $.post(url, postData, function() { // some code }); However, in the controller, doing print_r($this->input->post()) or print_r($_POST) as a test only returns Array(). Even $this->input->post('update_data') returns nothing. How can I retrieve these arrays in the controller?

    Read the article

  • Codeigniter + ajax(jQuery) session problem

    - by faya
    Hello, I have a problem in server side retrieving session with using ajax post request. Here is my sample code: JavaScript: $(function() { $('.jid_hidden_data').submit(function() { var serialized = $(this).serialize(); var sUrl = "http://localhost/stuff"; $.ajax({ url: sUrl, type: "POST", data: serialized, success: function(data) { alert(data); } }) return false; }); }); CodeIngiter(PHP) side: function stuff() { $post_stuff = $this->input->post('my_stuff'); // WORKS PERFECTLY $user_id = $this->session->userdata('user_id'); // RETURNS NULL } Where commented returns NULL it should return users session data, because it really exists. What is the problem? Method post doesn't get cookies or what? Thanks for any help!

    Read the article

  • codeigniter and form action trailing / issue??

    - by alex
    Hi, I am having a bit of an issue with the way CI is dealing with /. In a regular form i notice that the following form action didn't work action="mydomain.com/ci-controller/login/" but this one does work action="mydomain.com/ci-controller/login" Strange but he it worked. But now i need this from a iframe, i the iframe i have a login form which sets the parents url to mydomain.com/ci-controller/login, but i get the same error as it was calling mydomain.com/ci-controller/login/ Could my problem be that the call from the iframe adds a trailing / which is not visible?? Any thoughts

    Read the article

  • Understanding the passing of data/life of a script in web development/CodeIgniter

    - by Pete Jodo
    I hope I worded the title accurately enough but I typically use Java and don't have much experience in Web Development/PHP/CodeIgniter. I have a difficult time understanding the life cycle of a script as I found out trying to implement a certain feature to a website I am developing (as a means of learning how to). I'll first describe the feature I tried implementing and then the problem I ran into that made me question my fundamental understanding of how scripts work since I'm used to typical OOP. Ok so here goes... I have a webpage that has 2 basic tasks a user can do, create and delete an entry. What I attempted to implement was a way to time a user how long it takes them to complete a certain task. The way I did this was have a homepage where there would be a list of tasks a user to choose from (in this case 2, create and delete). A user would click a task which would link to the 'true' homepage where the user then would be expected to complete the task. My script looks like this: <?php class Site extends CI_Controller { var $task1; var $tasks = array( "task1" => NULL, "date1" => 0, "date2" => 0, "diff" => 0); function __construct() { parent::__construct(); include 'timetask.php'; $this->task1 = new TimeTask("create"); } function index() { $this->tasks['task1'] = $this->task1->getTask(); $this->tasks['diff'] = $this->task1->getTimeDiff(); if($this->tasks['diff'] == NULL) { $this->tasks['diff'] = 0; } $this->load->view('usability_test', $this->tasks); } function origIndex() { $this->task1->setDate1(new DateTime()); $this->tasks['date1'] = $this->task1->getDate1()->getTimestamp(); $data = array(); if($q = $this->site_model->get_records()) { $data['records'] = $q; } $this->load->view('options_view', $data); } function create() { $this->task1->setDate2(new DateTime()); $this->tasks['date2'] = $this->task1->getDate2()->getTimestamp(); $data = array( 'author' => $this->input->post('author'), 'title' => $this->input->post('title'), 'contents' => $this->input->post('contents') ); $this->site_model->add_record($data); $this->index(); } I only included create to keep it short. Then I also have the TimeTask class, that actually another StackOverflow so kindly helped me with: <?php class TimeTask { private $task; /** * @var DateTime */ private $date1, $date2; function __construct($currTask) { $this->task = $currTask; } public function getTimeDiff() { $hasDiff = $this->date1 && $this->date2; if ($hasDiff) { return $this->date2->getTimestamp() - $this->date1->getTimestamp(); } else { return NULL; } } public function __toString() { return (string) $this->getTimeDiff(); } /** * @return \DateTime */ public function getDate1() { return $this->date1; } /** * @param \DateTime $date1 */ public function setDate1(DateTime $date1) { $this->date1 = $date1; } /** * @return \DateTime */ public function getDate2() { return $this->date2; } /** * @param \DateTime $date2 */ public function setDate2(DateTime $date2) { $this->date2 = $date2; } /** * @return get current task */ public function getTask() { return $this->task; } } ?> I don't think posting the views is necessary for the question but here is atleast how the links are made. ...and... id", $row-title); ? Now there's no error in the code but it doesn't do what I expect of it and the reason I assume why is because that each time a function of the script is called via a new page it is NOT the same instance of the script called previously so any previously created objects are no longer there. This confuses me and leaves me quite unsure of how to implement this gracefully. Some ways I would guess of how to do this is by passing the necessary data through the URL or have data saved in a database and retrieve it later to compare the times. What would be a recommended way to do, not just this, but anything that needs previously created data? Also, am I correct to think that a script is only 'alive' for one webpage at a time? Thanks!

    Read the article

  • passing multiple queries to view with codeigniter

    - by LvS
    I am trying to build a forum with Codeigniter. So far i have the forums themselves displayed and the threads displayed, based on the creating dynamic news tutorial. But that is 2 different pages, i need to obviously display them into one page, like this: Forum 1 - thread 1 - thread 2 - thread 3 Forum 2 - thread 1 - thread 2 etc. And then the next step is obviously to display all the posts in a thread. Most likely with some pagination going on. But that is for later. For now i have the forum controller (slimmed version): <?php class Forum extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('forum_model'); $this->lang->load('forum'); $this->lang->load('dutch'); } public function index() { $data['forums'] = $this->forum_model->get_forums(); $data['title'] = $this->lang->line('title'); $data['view'] = $this->lang->line('view'); $this->load->view('templates/header', $data); $this->load->view('forum/index', $data); $this->load->view('templates/footer'); } public function view($slug) { $data['forum_item'] = $this->forum_model->get_forums($slug); if (empty($data['forum_item'])) { show_404(); } $data['title'] = $data['forum_item']['title']; $this->load->view('templates/header', $data); $this->load->view('forum/view', $data); $this->load->view('templates/footer'); } } ?> And the forum_model (also slimmed down) <?php class Forum_model extends CI_Model { public function __construct() { $this->load->database(); } public function get_forums($slug = FALSE) { if ($slug === FALSE) { $query= $this->db->get('forum'); return $query->result_array(); } $query = $this->db->get_where('forum', array('slug' => $slug)); return $query->row_array(); } public function get_threads($forumid, $limit, $offset) { $query = $this->db->get_where('thread', array('forumid', $forumid), $limit, $offset); return $query->result_array(); } } ?> And the view file <?php foreach ($forums as $forum_item): ?> <h2><?=$forum_item['title']?></h2> <div id="main"> <?=$forum_item['description']?> </div> <p><a href="forum/<?php echo $forum_item['slug'] ?>"><?=$view?></a></p> <?php endforeach ?> Now that last one, i would like to have something like this: <?php foreach ($forums as $forum_item): ?> <h2><?=$forum_item['title']?></h2> <div id="main"> <?=$forum_item['description']?> </div> <?php foreach ($threads as $thread_item): ?> <h2><?php echo $thread_item['title'] ?></h2> <p><a href="thread/<?php echo $thread_item['slug'] ?>"><?=$view?></a></p> <?php endforeach ?> <?php endforeach ?> But the question is, how do i get the model to return like a double query to the view, so that it contains both the forums and the threads within each forum. I tried to make a foreach loop in the get_forum function, but when i do this: public function get_forums($slug = FALSE) { if ($slug === FALSE) { $query= $this->db->get('forum'); foreach ($query->row_array() as $forum_item) { $thread_query=$this->get_threads($forum_item->forumid, 50, 0); } return $query->result_array(); } $query = $this->db->get_where('forum', array('slug' => $slug)); return $query->row_array(); } i get the error A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: models/forum_model.php Line Number: 16 I hope anyone has some good tips, thanks! Lenny *EDIT*** Thanks for the feedback. I have been puzzling and this seems to work now :) $query= $this->db->get('forum'); foreach ($query->result() as $forum_item) { $forum[$forum_item->forumid]['title']=$forum_item->title; $thread_query=$this->db->get_where('thread', array('forumid' => $forum_item->forumid), 20, 0); foreach ($thread_query->result() as $thread_item) { $forum[$forum_item->forumid]['thread'][]=$thread_item->title; } } return $forum; } What is now next, is how to display this multidimensional array in the view, with foreach statements.... Any suggestions ? Thanks

    Read the article

  • ajax not working in codeigniter

    - by user1800797
    I'm trying to send a post request using the ajax jquery function and return some data into a window asynchronously. Here's what I have so far. It doesn't seem to be working. in the view: $.ajax({ url: '/dashboard/presskits/media/get_video_link/', type: 'POST', dataType: 'json', data: { encoded_link : encoded_link }, cache: false, success: function(output_string){ // $('#edit_video_info').append(output_string); alert(output_string.url_data); } // End of success function of ajax form }); // End of ajax call }); in the controller: public function get_video_link() { $temp_url = $this->input->post('encoded_link'); $output_string = json_encode(array('url_data' => $temp_url)); return $output_string; }

    Read the article

  • Defautlt Contoller in CodeIgniter

    - by gregavola
    Hello everyone, I am wondering if there is any other configuration options for a default controller. For example - if I have a controller called "site" and I set the default controller in the following file: application/config/routes.php to: $route['default_controller'] = "site"; I should be able to go to http://localhost and that brings up the index(); function in the site controller. However, if I try to do go to http://localhost/index.php/index2 to load the index2(); function I get a 404 error. If i change the URL to http://localhost/index.php/site/index2 it works fine - but I thought already set the default controller. Is there any way around this? Any thoughts?

    Read the article

  • removing index.php of codeigniter on local

    - by Aldi Aryanto
    i'm trying to remove index.php,in my localhost, but it seems doesn't working,its on http://localhost/testing i put .htacces in 'testing' directory under the htdocs LoadModule rewrite_module modules/mod_rewrite.so at apache/conf also already uncheck here my .htaccess RewriteEngine On RewriteBase /testing/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /testing/index.php/$1 [L] here my config $config['base_url'] = "http://localhost/testing"; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO'; when i access login controller, it's not found Not Found The requested URL /testing/login was not found on this server. I really don't know what to try next. Any help would be appreciated.

    Read the article

  • Default Contoller in CodeIgniter

    - by gregavola
    I am wondering if there is any other configuration options for a default controller. For example - if I have a controller called "site" and I set the default controller in the following file: application/config/routes.php to: $route['default_controller'] = "site"; I should be able to go to http://localhost and that brings up the index(); function in the site controller. However, if I try to do go to http://localhost/index.php/index2 to load the index2(); function I get a 404 error. If I change the URL to http://localhost/index.php/site/index2 it works fine - but I thought already set the default controller. Is there any way around this?

    Read the article

  • Problem with jquery ajax form on Codeigniter

    - by Code Burn
    Everytime I test the email is send correctly. (I have tested in PC: IE6, IE7, IE8, Safari, Firefox, Chrome. MAC: Safari, Firefox, Chrome.) The _POST done in jquery (javascript). Then when I turn off javascript in my browser nothing happens, because nothing is _POSTed. Nome: Jon Doe Empresa: Star Cargo: Developer Email: [email protected] Telefone: 090909222988 Assunto: Subject here.. But I keep recieving emails like this from costumers: Nome: Empresa: Cargo: Email: Telefone: Assunto: CONTACT_FORM.PHP <form name="frm" id="frm"> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Nome<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="Cnome" id="Cnome" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Empresa<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmpresa" id="CEmpresa" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Cargo</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CCargo" id="CCargo" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Email<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmail" id="CEmail" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Telefone</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CTelefone" id="CTelefone" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Assunto<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><textarea class="texto textocinzaescuro" name="CAssunto" id="CAssunto" rows="2" cols="28"></textarea></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >&nbsp;</div> <div class="campoFormulario inputDeCampo" style="text-align:right;" ><input id="Cbutton" class="texto textocinzaescuro" type="submit" name="submit" value="Enviar" /></div> </form> <script type="text/javascript"> $(function() { $("#Cbutton").click(function() { if(validarForm()){ var Cnome = $("input#Cnome").val(); var CEmpresa = $("input#CEmpresa").val(); var CEmail = $("input#CEmail").val(); var CCargo = $("input#CCargo").val(); var CTelefone = $("input#CTelefone").val(); var CAssunto = $("textarea#CAssunto").val(); var dataString = 'nome='+ Cnome + '&Empresa=' + CEmpresa + '&Email=' + CEmail + '&Cargo=' + CCargo + '&Telefone=' + CTelefone + '&Assunto=' + CAssunto; //alert (dataString);return false; $.ajax({ type: "POST", url: "http://www.myserver.com/index.php/pt/envia", data: dataString, success: function() { $('#frm').remove(); $('#blocoform').append("<br />Obrigado. <img id='checkmark' src='http://www.myserver.com/public/images/estrutura/ok.gif' /><br />Será contactado brevemente.<br /><br /><br /><br /><br /><br />") .hide() .fadeIn(1500); } }); } return false; }); }); function validarForm(){ var error = 0; if(!validateNome(document.getElementById("Cnome"))){ error = 1 ;} if(!validateNome(document.getElementById("CEmpresa"))){ error = 1 ;} if(!validateEmail(document.getElementById("CEmail"))){ error = 1 ;} if(!validateNome(document.getElementById("CAssunto"))){ error = 1 ;} if(error == 0){ //frm.submit(); return true; }else{ alert('Preencha os campos correctamente.'); return false; } } function validateNome(fld){ if( fld.value.length == 0 ){ fld.style.backgroundColor = '#FFFFCC'; //alert('Descrição é um campo obrigatório.'); return false; }else { fld.style.background = 'White'; return true; } } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateEmail(fld) { var tfld = trim(fld.value); var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = '#FFFFCC'; //alert('Email é um campo obrigatório.'); return false; } else if (!emailFilter.test(tfld)) { //alert('Email inválido.'); fld.style.background = '#FFFFCC'; return false; } else if (fld.value.match(illegalChars)) { fld.style.background = '#FFFFCC'; //alert('Email inválido.'); return false; } else { fld.style.background = 'White'; return true; } } </script> FUNCTION ENVIA (email sender): function envia() { $this->load->helper(array('form', 'url')); $nome = $_POST['nome']; $empresa = $_POST['Empresa']; $cargo = $_POST['Cargo']; $email = $_POST['Email']; $telefone = $_POST['Telefone']; $assunto = $_POST['Assunto']; $mensagem = " Nome:".$nome." Empresa:".$empresa." Cargo:".$cargo." Email:".$email." Telefone:".$telefone." Assunto:".$assunto.""; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: no-reply' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail('[email protected]', $mensagem, $headers); }

    Read the article

  • Creating a personal URL for all users to my site

    - by Abs
    Hello all, When a user registers with my site I want to offer them a login page and a user area with the URL: http://user1.mysite.com http://user2.mysite.com http://user3.mysite.com ... I did a google search for this but I wasn't sure of the right terms... How can I do this without having to actually create lots of subdomains - I am sure its not done this way - is it URL re-writing? Apache mod_rewrite? If so can someone give me an example please or is there a better way of doing this? Btw, I am using Codeigniter - if Codeigniter has something that can do this, I would rather use that. Thanks all for any help

    Read the article

  • jquery ajax post not working with .load in codeigniter

    - by bravo
    i wish to .load multiple views result with jquery ajax the original code (js) $(document).ready(function(){ $("#uid").change( function(){ var uid=$("#uid").val(); $.ajax({ type: "POST", url: "<?= site_url('sp_profile/ajax_userdetail') ?>", dataType: "json", data: "uid="+uid, cache:false, success: function(data){ $("#content").html(data); } }); return false; }); }); this return only one result in what if i want to load 3 results like in <div id="content"></div> <div id="content1"></div> <div id="content2"></div> content could be userid content2 could be user first name content3 could be user last name my js should using .load instead of html right? let me know if i'm wrong. success: function(data){ $("#content").load("<?= site_url('sp_profile/ajax_userdetail')?>"); $("#content2").load("<?= site_url('sp_profile/ajax_userdetail')?>"); $("#content3").load("<?= site_url('sp_profile/ajax_userdetail')?>"); } i stuck with this thing for whole day.. please anyone show me the right way to do the controller and js code.

    Read the article

  • stripping default.aspx and //www from the url

    - by b0x0rz
    the code to strip /Default.aspx and //www is not working (as expected): protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext context = HttpContext.Current; string url = context.Request.RawUrl.ToString(); bool doRedirect = false; // remove > default.aspx if (url.EndsWith("/default.aspx", StringComparison.OrdinalIgnoreCase)) { url = url.Substring(0, url.Length - 12); doRedirect = true; } // remove > www if (url.Contains("//www")) { url = url.Replace("//www", "//"); doRedirect = true; } // redirect if necessary if (doRedirect) { context.Response.Redirect(url); } } it works usually, but when submitting a form (sign in for example) the code above INTERCEPTS the request and then does a redirect to the same page. example: try to arrive at page: ~/SignIn/Default.aspx the requests gets intercepted and fixed to: ~/SignIn/ fill the form, click sign in the current page url goes from: ~/SignIn/ to ~/SignIn/Default.aspx and gets fixed again, thus voiding the processing of the method SignIn (which would have redirected the browser to /SignIn/Success/) and the page is reloaded as ~/SignIn/ and no sign in was done. please help. not sure what / how to fix here. the main REQUIREMENT here is: remove /Default.aspx and //www from url's thnx

    Read the article

  • Codeigniter: Simple ajax submit not working

    - by Kevin Brown
    jQuery: $('#welcome-message').submit(function() { // inside event callbacks 'this' is the DOM element so we first // wrap it in a jQuery object and then invoke ajaxSubmit $(this).ajaxSubmit({}); $(this).fadeTo(400, 0, function () { // Links with the class "close" will close parent $(this).slideUp(400); }); return false; }); Controller: function welcome_message() { if(isset($_POST['welcome_message'])) { $this-_my_private_function(); } } private function _my_private_function() { $id = $this->session->userdata('id'); $profile['welcome_message'] = '0'; $this->db->update('be_user_profiles',$profile, array('user_id' => $id)); redirect('home', 'location'); } html: <?php print form_open('home/welcome_message',array('class'=>'horizontal','id'=>'welcome-message'))?> <p> Before you can complete the assessment, you need to complete your profile. Once that's done you'll be ready! After you have completed the assessment, you will be able to view the results from your profile. </p> <input type="checkbox" value="0" name="welcome_message" checked="false"> Don't show me this again </input> <p> <input class="button submit" type="submit" class="close-box" value="Close" /> </p> <?php print form_close()?> This should be working. My hypothesis is that the data isn't being passed to the function...but I really have no idea! It works when I visit the function in the url.

    Read the article

  • making query from different related tables using codeigniter

    - by fatemeh karam
    I'm using codeigniter as i mentioned this is a part of my view code foreach($projects_query as $row)// $row indicates the projects { ?> <tr><td><h3><button type="submit" class="button red-gradient glossy" name = "project_click" > <?php echo $row->txtTaskName; ?></button></h3></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> <?php foreach($tasks_query as $row2) { // if( $row->txtTaskName == "TestProject") if($row->intTaskID == $row2->intInside)// intInside indicades that the current task($row2) is the subset of which task (system , subsystem or project) { if($row2->intSummary == 0)//if the task(the system) is an executable task & doesn't have any subtask: { $query_team_user_id = $this->admin_in_out_model->get_user_team_task_query($row2->intTaskID);//runs the function and generates a query from tbl_userteamtask where intTaskID equals to the selected row's intTaskID foreach($query_team_user_id as $row_teamid) { $query_teamname = $this->admin_in_out_model->get_team_name($row_teamid->intTeamID); $query_fn_ln = $this->admin_in_out_model->get_fn_ln_from_userid($row_teamid->intUserID); foreach($query_teamname as $row_teamname) {?> <tr><td></td><td></td><td><h4> <?php echo $row2->txtTaskName;?></h4></td> <td><b><font color='#F33558'><?php echo $row_teamname->txtTeamName;?></font></b></td> <?php } foreach($query_fn_ln as $row_f_l_name) {?> <td> <?php echo $row_f_l_name->txtFirstname." ".$row_f_l_name->txtLastname;?></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td> <?php }?> </tr> <?php } } else{ ?> <tr><td></td><td></td><td><h4> <?php echo $row2->txtTaskName;?></h4></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><?php } foreach($tasks_query as $row_subsystems) { if($row_subsystems->intInside == $row2->intTaskID )//if the task is the subtask of a system(it means the task is a subsystem) { if($row_subsystems->intSummary == 0)//if the task is an executable task & doesn't have any subtask: { $query_team_user_id = $this->admin_in_out_model->get_user_team_task_query($row_subsystems->intTaskID); foreach($query_team_user_id as $row_teamid) {?> <tr><?php $query_teamname = $this->admin_in_out_model->get_team_name($row_teamid->intTeamID); $query_fn_ln = $this->admin_in_out_model->get_fn_ln_from_userid($row_teamid->intUserID); foreach($query_teamname as $row_teamname) {?> <td></td><td></td><td><h5><?php echo $row_subsystems->txtTaskName?></h5><br/></td> <td><b><font color='#F33558'><?php echo $row_teamname->txtTeamName;?></font></b></td><?php } foreach($query_fn_ln as $row_f_l_name) {?> <td><?php echo $row_f_l_name->txtFirstname." ".$row_f_l_name->txtLastname;?></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><?php }?> </tr><?php } } else{ ?><tr><td></td><td></td><td><h5><?php echo $row_subsystems->txtTaskName?></h5></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><?php } foreach($tasks_query as $row_tasks) { if($row_tasks->intInside == $row_subsystems->intTaskID )//if the task is the subtask of a subsystem { if($row_tasks->intSummary == 0)//if the task is an executable task & doesn't have any subtask: { $query_team_user_id = $this->admin_in_out_model->get_user_team_task_query($row_tasks->intTaskID); foreach($query_team_user_id as $row_teamid) {?> <tr><?php $query_teamname = $this->admin_in_out_model->get_team_name($row_teamid->intTeamID); $query_fn_ln = $this->admin_in_out_model->get_fn_ln_from_userid($row_teamid->intUserID); foreach($query_teamname as $row_teamname) {?> <td></td><td></td><td><b><?php echo $row_tasks->txtTaskName;?></b></td> <td><b><font color='#F33558'><?php echo $row_teamname->txtTeamName;?></font></b></td><?php } foreach($query_fn_ln as $row_f_l_name) {?> <td><?php echo $row_f_l_name->txtFirstname." ".$row_f_l_name->txtLastname;?></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><?php }?> </tr><?php } } } } } } } } }?> and in controller i have $projects_query = $this->admin_in_out_model->get_projects(); $tasks_query = $this->admin_in_out_model->get_systems(); $userteamtask = $this->admin_in_out_model->get_user_team_task(); $data['tasks_query'] = $tasks_query; $data['projects_query'] = $projects_query; $this->load->view('project_view',$data); but as you see I'm calling my model functions within the view how can i do something else to do this i mean not calling my model function in my view I have to add that, my model function have parameters these are the model functions: function get_projects() { $this -> db -> select('*'); $this -> db -> from('tbl_task'); $this -> db -> where('intInside','0'); $query = $this->db->get(); return $query->result(); } function get_systems() { $this -> db -> select('*'); $this -> db -> from('tbl_task '); $this -> db -> where('intInside <> ','0'); $query = $this->db->get(); return $query->result(); } function get_user_team_task_query($task_id)//gets information from tbl_userteamtask where the field intTaskID is equal to $task_id { $this -> db -> select('*'); $this -> db -> from('tbl_userteamtask'); $this -> db -> where('intTaskID',$task_id); $query_teamid = $this->db->get(); return $query_teamid->result(); } function get_user_team_task()//gets information from tbl_userteamtask where the field intTaskID is equal to $task_id { $this -> db -> select('*'); $this -> db -> from('tbl_userteamtask'); // $this -> db -> where('intTaskID',$task_id); $query_teamid = $this->db->get(); return $query_teamid->result(); } function get_team_name($query_teamid) { $this -> db -> select('*'); $this -> db -> from('tbl_team'); $this -> db -> where('intTeamID',$query_teamid); $query_teamname = $this->db->get(); return $query_teamname->result(); } function get_user_name($query_userid) { $this -> db -> select('*'); $this -> db -> from('tbl_user'); $this -> db -> where('intUserID',$query_userid); $query_username = $this->db->get(); return $query_username->result(); } function get_fn_ln_from_userid($selected_id) { $this -> db -> select('tbl_user.intUserID, tbl_user.intPersonID,tbl_person.intPersonID,tbl_person.txtFirstname, tbl_person.txtLastname'); $this -> db -> from('tbl_user , tbl_person'); $where = "tbl_user.intPersonID = tbl_person.intPersonID "; $this -> db -> where($where); $this -> db -> where('tbl_user.intUserID', $selected_id); $query = $this -> db -> get();//makes query from DB return $query->result(); } do I have to use subquery ? is this true? i mean can i do this? foreach( $data as $key => $each ) { $data[$key]['team_id'] = $this->get_user_team_task_query( $each['intTaskID'] ); foreach($data[$key]['team_id'] as $key_teamname => $each) { $data[$key_teamname]['team_name'] = $this->get_team_name( $each['intTeamID'] ); } } the model code: foreach( $data as $key => $each ) { $data[$key]['intTaskID'] = $each['intTaskID']; $data[$key]['team_id'] = $this->get_user_team_task_query( $each['intTaskID'] ); foreach($data[$key]['team_id'] as $key => $each) { $data[$key]['team_name'] = $this->get_team_name( $each['intTeamID'] ); #fetching of the teamname and saving in the array $data[$key]['user_name'] = $this->get_fn_ln_from_userid( $each['intUserID'] ); foreach($data[$key]['user_name'] as $key => $each) { $data[$key]['first_name'] = $each['txtFirstname'] ; $data[$key]['last_name'] = $each['txtLastname'] ; } $data[$key]['first_name'] = $data[$key]['first_name']; $data[$key]['last_name'] = $data[$key]['last_name']; } }

    Read the article

  • Best Practice for Images with Codeigniter : Generating Thumbs or Resizing on the Fly

    - by Steve K
    Hi all, I know there’s been a good deal written on thumbnail generation and the like with CI, but I wanted to explain what I’ve made and see what kind of best-practice advice I could find. Here’s my story… Currently, I have a site which allows users to upload collections of photos to projects they’ve created after first creating an account. Upon account creation, the site generates folders for the users in the following fashion for each of five pre-defined projects: /students/username/project_num/images/thumbs/ (This is to say that within a pre-created students folder, the username, project_num, images and thumbs folders are created recursively five times.) When a user uploads images to a project, I have a gallery controller which uploads the full images into the images folder for the project_num, and then creates a smaller thumbnail which maintains its ratio. So far so good. On the index page of the site, where these thumbnails and full images are displayed, I had a bit of a brain lapse, thinking I could simply output the full image while resizing it via css for a ‘medium-size’ image which would lead to the full-size image when clicked. (To be clear, the path is: Click on thumbnail— Load scaled full-size (medium-size) image via ajax into a display area above thumbs— Click on medium-sized image— Load full size image via lightbox, or something of that nature.) I have everything working to this point, except, as one might imagine, resizing the full-sized images with css doesn’t maintain aspect ratio for the thumbs, which means I need to find the best way to resize these. In thinking about it, I figured I had two options: I could resize the image on the fly when the user clicks a thumbnail to load the medium-sized image via ajax. (I have a method ‘get_image($url)’ in my gallery controller which simply loads a view with an image tag and the image source passed to it, etc.) I thought perhaps I could send it first to my gallery model, resize it there on the fly, and send it on to the view. The problem I’m having is that resizing it on the fly and echoing it out gives me the raw image data (I apologize, I don’t know that’s the right term). I’ve tried using data_uris to format the raw data into something echoable, but with no success. Is this method possible? The second option I considered was to generate a second medium-sized thumbnail when the user uploads the image with maintain_ratio set to true. This method is slightly less ideal, given that when providing a way for the user to delete their projects, I’ll need to scan for an additional set of images to delete. Not a huge deal, definitely, but something I figured could be avoided by generating the medium-sized image on the fly. I hope I’ve been clear in my explanations, if long-winded! I’m very curious to see what suggestions folks have about the best way to handle this. Much thanks for reading, and any suggestions are much-appreciated! Steve K.

    Read the article

  • Do I really need to remove special characters in a URL?

    - by anarchoi
    I have an FTP account shared with friends where we upload underground music albums and then we use the links to share the downloads in a music forum. The problem is that the album names are in french so there is a lot of special characters in the name. So the URL looks like http://www.mydomain.com/downloads/Some Band - En français avec des caractères spéciaux (2013) [7'' EP].zip For me it works perfectly and I can download the file by using this URL, but I have read everywhere that special chars are bad in URL. Is there any reason why I must remove the special characters or encode the URL? Is everyone able to access a URL with special characters or will some older browsers not be able to download the files? I really don't care about SEO or anything else. I just want the download links to work for everyone. Since the files are uploaded through FTP, I can't use PHP to remove the special characters with a regex, so I really don't know what to do.

    Read the article

  • is there any IIS setting require for url rewriting?

    - by Samir
    Hello, i have used URL rewriting using global.asax file. url rewriting is working file on local machine but when i made it online its not working. void Application_BeginRequest(Object sender, EventArgs e) { var extension = Path.GetExtension(Request.PhysicalPath).ToLower(); if (File.Exists(Request.PhysicalPath)) { if (extension == ".html") { Response.WriteFile(Request.PhysicalPath); Response.End(); } return; } var path = Request.Path; if (!Context.Items.Contains("ORIGINAL_REQUEST")) Context.Items.Add("ORIGINAL_REQUEST", path); if (extension == ".html") { var resource = UrlRewriting.FindRequestedResource(); var command = UrlRewriting.GetExecutionPath(resource); Context.RewritePath(command, true); } } url is:ind205.cfmdeveloper.com when you click on about us ,demo,advertise page it will not display. so please let me know is there any IIS setting require, reply me soon thanks Samir

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >