Search Results

Search found 13807 results on 553 pages for 'undefined reference'.

Page 3/553 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery: form input values turns up undefined

    - by Seerumi
    Having problem with this bit of code qith jQuery. it should pick the values from current form and then submit them, but when I try to get them with jQuery they always turn up undefined. I know the SQL results are fine since they show correctly in HTML table, so it must be my inferior javascript skills. New with jQuery and I'm at loss :( PHP/HTML: echo "<table>\n" while ($row = odbc_fetch_array($query)) { echo "<form class='catForm'>\n"; echo "<input type=hidden class='catID' name='catID' value='".$row['running_id']."'/>\n"; echo "<tr>\n"; echo "<td>".$row['running_id']."</td>\n"; echo "<td>".$row['site_id']."</td>\n"; echo "<td>".$row['main_category']."</td>\n"; echo "<td>".$row['map_name']."</td>\n"; echo "<td><input type=textfield class='bCatID' value='".$row['mapping_id']."' size=6/></td>\n"; echo "<td><input type=submit class='saveCat' value='Save'/></td>\n"; echo "<td><input type=submit class='killCat' value='Delete' /></td>\n"; echo "</tr>\n"; echo "</form>\n"; } echo "</table>"; jQuery: $(".catForm").submit(function () { var id = $(this).find('.catID').val(); var bCatID = $(this).find('.bCatID').val(); var dataString = 'id='+id+'&bCatID='+bCatID; $.ajax({ type: "POST", url: 'adminUI/bin/updateSCategories.php', dataType : 'json', data: dataString, success: function(data) { if (data.error == true) $('.failure').html("Error, save failed.").show().fadeOut(2000); if (data.error == false) $('.success').html("Saved succesfully").show().fadeOut(2000); }, error: function(XMLHttpRequest, textStatus, errorThrown) { $('.failure').html("Error, save failed.").show().fadeOut(2000); } }); return false; }); RESULT: id: undefined bCatID: undefined

    Read the article

  • How to check for undefined or null variable in javascript

    - by Thomas Wanner
    We are frequently using the following code pattern in our javascript code if(typeof(some_variable) != 'undefined' && some_variable != null) { // do something with some_variable } and I'm wondering whether there is a less verbose way of checking that has the same effect. According to some forums and literature saying simply if(some_variable) { // do something with some_variable } should have the same effect. Unfortunately, Firebug evaluates such a statement as error on runtime when some_variable is undefined, whereas the first one is just fine for him. Is this only an (unwanted) behavior of Firebug or is there really some difference between those two ways ?

    Read the article

  • Oh no, Not another Undefined Reference Question!

    - by roony
    Unfortunately yes. I have my shared library compiled, the linker doesn't complain about not finding it but still I get undefined reference error. Thinking that I might be doing something wrong I did a little research and found this nice, simple walkthrough: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html which I've followed to the letter but still I get: $ gcc -Wall main.c -o dynamically_linked -L.\ -lmean /tmp/ccZjkkkl.o: In function `main': main.c:(.text+0x42): undefined reference to `mean' collect2: ld returned 1 exit status This is pretty simple stuff so what's going wrong?!?!? Can anyone suggest something in my set up that might need checking/tweeking? GCC 4.3.2 Fedora 10 64-bit

    Read the article

  • How come $(this) is undefined after ajax call

    - by JohnnyQ
    I am doing an ajax request when an anchor tag is clicked with an ID set to href. Btw, this anchor tag is dynamically created. <a href="983" class="commentDeleteLink">delete</a> When the anchor tag is clicked the following code is executed: $('.commentDeleteLink').live('click', function(event) { event.preventDefault(); var result = confirm('Proceed?'); if ( result ) { $.ajax({ url: window.config.AJAX_REQUEST, type: "POST", data: { action : 'DELCOMMENT', comment : $('#commentText').val(), comment_id : $(this).attr('href') }, success: function(result) { alert($(this).attr('href')); //$(this).fadeOut(slow); } }); } }); When I tried to display $(this).attr('href') it says it's "undefined". What I really want to do is fadeOut the anchor tag but when I investigated the value of $(this) it is "undefined". What could be wrong with the snippet above?

    Read the article

  • Why does Sharepoint 2010 Web Reference work, but Service Reference does not

    - by Darien Ford
    Sharepoint is setup to use NTLM authentication. When I reference http://myserver/Sites/Ops/_vti_bin/Lists.asmx?WSDL as a Web Reference, I can call the methods and get valid responses. When I reference the same url as a Service Reference, the server throws an exception when calling methods. My account is admin on the Sharepoint Farm. This is the app.config for the service reference (mostly auto generated): <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="ListsSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://myserver/Sites/Ops/_vti_bin/Lists.asmx" binding="basicHttpBinding" bindingConfiguration="ListsSoap" contract="SharepointLists.ListsSoap" name="ListsSoap" /> </client> </system.serviceModel> </configuration> Saddly, the only information the exception provides is this: "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown." No other details. The code that I'm using is: public ListClass() { _Client = new SharepointLists.ListsSoapClient(); } public System.Xml.Linq.XElement GetTaskList() { return _Client.GetList("Tasks"); } Any thoughts? I would like to use the Service Reference rather than the Web Reference. UPDATE: I tried Rob's suggestion and got this error: HTTP GET Error URI: http://myserver/Sites/Ops/_vti_bin/Lists.asmx The document at the url http://myserver/Sites/Ops/_vti_bin/Lists.asmx was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'http://myserver/Sites/Ops/_vti_bin/Lists.asmx' is 'The document format is not recognized (the content type is 'text/html; charset=utf-8').'. - Report from 'DISCO Document' is 'There was an error downloading 'http://myserver/_vti_bin/Lists.asmx?disco'.'. - The request failed with HTTP status 404: Not Found. - Report from 'WSDL Document' is 'The document format is not recognized (the con tent type is 'text/html; charset=utf-8').'. - Report from 'XML Schema' is 'The document format is not recognized (the conten t type is 'text/html; charset=utf-8').'.

    Read the article

  • What tasks should be explicitly mentioned in a job reference? [closed]

    - by Martin
    Glossary A job reference (see also the german version) is a letter from the (former) employer that states what the employee did, and how well he did it. There are oh so weird rules here on how to phrase stuff therein, but this is not what this question is about. Question I hope this can even be generally answered, but even if country/region specific, I think there is enough international know-how on this site to get useful answers for different regions. I was wondering how detailed the tasks a programmer / developer did should be spelled out in a job reference. (After all, they can be spelled out in all detail in a CV when applying for a new job.) So how much detail is usual for a job reference? Example Developed Windows applications in C++ or Developed Windows Desktop Applications using C++ with MS Visual Studio 2005 and MFC, utilising Boost 1.47 and specif library xyz, focusing on subsystem abc for numerical calculations of ... etc. What makes more sense?

    Read the article

  • Function inside jquery returns undefined

    - by steamboy
    Hello Guys, The function I called inside jquery returns undefined. I checked the function and it returns correct data when I firebugged it. function addToPlaylist(component_type,add_to_pl_value,pl_list_no) { add_to_pl_value_split = add_to_pl_value.split(":"); $.ajax({ type: "POST", url: "ds/index.php/playlist/check_folder", data: "component_type="+component_type+"&value="+add_to_pl_value_split[1], success: function(msg) { if(msg == 'not_folder') { if(component_type == 'video') { rendered_item = render_list_item_video(add_to_pl_value_split[0],add_to_pl_value_split[1],pl_list_no) } else if(component_type == 'image') { rendered_item = render_list_item_image(add_to_pl_value_split[0],add_to_pl_value_split[1],pl_list_no) } } else { //List files from folder folder_name = add_to_pl_value_split[1].replace(' ','-'); var x = msg; // json eval('var file='+x); var rendered_item; for ( var i in file ) { //console.log(file[i]); if(component_type == 'video') { rendered_item = render_list_item_video(folder_name+'-'+i,file[i],pl_list_no) + rendered_item; } if(component_type == 'image') { rendered_item = render_list_item_image(folder_name+'-'+i,file[i],pl_list_no) + rendered_item; } } } $("#files").html(filebrowser_list); //Reload Playlist console.log(rendered_item); return rendered_item; }, error: function() { alert("An error occured while updating. Try again in a while"); } }) } $('document').ready(function() { addToPlaylist($('#component_type').val(),ui_item,0); //This one returns undefined });

    Read the article

  • Resource reference passing in puppet

    - by paweloque
    Is it possible to pass puppet resource references to other resources? My use-case is to build a jenkins build pipeline with puppet. To chain jenkins jobs into a pipeline I need to pass the successor job to a job. A subset of the definition is: jobs::build { "Build ${release_name}": release => $release_name, jenkins_jobs_path => $jenkins_jobs_path, successors => 'Deploy', } jobs::deploy { "Deploy ${release_name}": release => $release_name, jenkins_jobs_path => $jenkins_jobs_path, successors => 'Smoke Test', } In the def you see that I define the successors by name, i.e. 'Deploy' and in case of the second job 'Smoke Test'. What I'd like to do is to pass a reference to a resource and extract the name from it: jobs::build { "Build ${release_name}": release => $release_name, jenkins_jobs_path => $jenkins_jobs_path, successors => Jobs::Deploy["Deploy ${release_name}"], } jobs::deploy { "Deploy ${release_name}": release => $release_name, jenkins_jobs_path => $jenkins_jobs_path, successors => Jobs::Smoke_test["Smoke Test ${release_name}"], } And then within the jobs::deploy and jobs::build definition I'd access the resource by reference and query for it's type, etc.. Is it possible to achieve this in puppet?

    Read the article

  • MinGW/G++/g95 link problem - libf95 undefined reference to `MAIN_'

    - by pivakaka
    Hi folks, Summing up, my problem consists on compiling g95 objects inside a C++ application. Actually, I'm constructing an interface for an old fortran program. For this task, I'm using the wxWidgets GUI library, and calling fortran subroutines when necessary. At the beginning, I was developing the entire project compiling my fortran files with gfortran (which comes with GCC) and linking them with my app by the g++ -o... command. Everything was working fine but some numbers values calculated by my fotran subroutines returned NAN values. Doing some research, I realized that compiling my fortran files with gfortran with the -m32 flag, generates this NAN values problem. Although compiling with -m64 flag, my code works properly well. The only trouble here is that my App should be 32bits and then I tryed another compiller. Here I found g95 Fortran compiler, which compiles my fortran code and gives the right output on a 32bits environment. But when I'm trying to link these g95 objects into my program I see this following error: g++ -oCyclonTechTower.exe src\fortran\Modulo_Global.o src\fortran\Prop_Fisicas.o src\fortran\inversa.o src\fortran\tower.o src\fortran\PredadeCarga.o src\fortran\gota.o src\fortran\tadi.o src\view\SimulationORSATCustomDialog.o src\view\SimulationChildGUIFrame.o src\view\ParentGUIFrame.o src\view\ClientGUIFrame.o src\model\TowerData.o src\controller\SimulationController.o src\THEIACyclonTechTower.o ..\Resource\resource.o -Lc:\wxWidgets-2.6.4\lib -Lc:\MinGW\lib\gcc-lib\i686-pc-mingw32\4.1.2 -Bdynamic -Wl,--subsystem,windows -mwindows c:\wxWidgets-2.6.4\lib\libwx_mswu-2.6.a -lwxregexu-2.6 -lwxexpat-2.6 -lwxtiff-2.6 -lwxjpeg-2.6 -lwxpng-2.6 -lwxzlib-2.6 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lgcc -lf95 c:\MinGW\lib\gcc-lib\i686-pc-mingw32\4.1.2/libf95.a(main.o):(.text+0x32): undefined reference to `MAIN_' collect2: ld returned 1 exit status Build error occurred, build is stopped Time consumed: 1531 ms. I have already read the g95 Manual for integration with C++ and I'm actually calling these functions bellow for controlling the fortran environment: void g95_runtime_start(int argc, char *argv[]); void g95_runtime_stop(); I also included the g95 Fortran Runtime Library libf95.a and the libgcc.a into my linker command. Finishing, I don't have a main method implemented because this is managed by wxWidgets, and my fortran subroutines can not have a main function because this is a C++ program calling fortran functions. Can some of you guys help me with this problem? How can I fix this undefined reference to MAIN__ problem? Any idea will be much appreciated. Thanks in advance, George

    Read the article

  • Javascript: previous property is undefined

    - by Matrym
    Why is it saying that "lbp is undefined" on the line of "creditText"? How do I refer to previous properties in a config file such as this? var lbp = { // Pertinant page properties, such as Author, Keywords, URL or Title page: { theURL: window.location.toString(), }, // Configurable user defaults defaults: { creditText: lbp.page.theURL } } Thanks in advance for your help

    Read the article

  • undefined method `bytes' for for String in Ruby

    - by artsince
    I am working with ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] and I get undefined method `bytes' for #<String:0x2a95ec2268> (NoMethodError) even though my code works on ruby 1.8.7. patchlevel 249 I saw somewhere that you need to add require "jcode" for a similar method not defined error with each_byte. I tried adding that but it still does not work. Any suggestions are very appreciated.

    Read the article

  • Variable is Undefined

    - by Matrym
    var bod = document.getElementsByTagName("body")[0]; bod.style.backgroundColor = setBgcolor.defaults.color; Why does bod come back as undefined when the above is called at window.onload?

    Read the article

  • Why don't purely functional languages use reference counting?

    - by Zifre
    In purely functional languages, data is immutable. With reference counting, creating a reference cycle requires changing already created data. It seems like purely functional languages could use reference counting without worrying about the possibility of cycles. Am is right? If so, why don't they? I understand that reference counting is slower than GC in many cases, but at least it reduces pause times. It would be nice to have the option to use reference counting in cases where pause times are bad.

    Read the article

  • C# parameters by reference and .net garbage collection

    - by Yarko
    I have been trying to figure out the intricacies of the .NET garbage collection system and I have a question related to C# reference parameters. If I understand correctly, variables defined in a method are stored on the stack and are not affected by garbage collection. So, in this example: public class Test { public Test() { } public int DoIt() { int t = 7; Increment(ref t); return t; } private int Increment(ref int p) { p++; } } the return value of DoIt() will be 8. Since the location of t is on the stack, then that memory cannot be garbage collected or compacted and the reference variable in Increment() will always point to the proper contents of t. However, suppose we have: public class Test { private int t = 7; public Test() { } public int DoIt() { Increment(ref t); return t; } private int Increment(ref int p) { p++; } } Now, t is stored on the heap as it is a value of a specific instance of my class. Isn't this possibly a problem if I pass this value as a reference parameter? If I pass t as a reference parameter, p will point to the current location of t. However, if the garbage collector moves this object during a compact, won't that mess up the reference to t in Increment()? Or does the garbage collector update even references created by passing reference parameters? Do I have to worry about this at all? The only mention of worrying about memory being compacted on MSDN (that I can find) is in relation to passing managed references to unmanaged code. Hopefully that's because I don't have to worry about any managed references in managed code. :)

    Read the article

  • Service reference not generating client types

    - by Cranialsurge
    I am trying to consume a WCF service in a class library by adding a service reference to it. In one of the class libraries it gets consumed properly and I can access the client types in order to generate a proxy off of them. However in my second class library (or even in a console test app), when i add the same service reference, it only exposes the types that are involved in the contract operations and not the client type for me to generate a proxy against. e.g. Endpoint has 2 services exposed - ISvc1 and ISvc2. When I add a service reference to this endpoint in the first class library I get ISvc1Client andf ISvc2Client to generate proxies off of in order to use the operations exposed via those 2 contracts. In addition to these clients the service reference also exposes the types involved in the operations like (type 1, type 2 etc.) this is what I need. However when i try to add a service reference to the same endpoing in another console application or class library only Type 1, Type 2 etc. are exposed and not ISvc1Client and ISvc2Client because of which I cannot generate a proxy to access the operations I need. I am unable to determine why the service reference gets properly generated in one class library but not in the other or the test console app.

    Read the article

  • undefined symbols when compiling libjingle for Mac OS X

    - by wwh37
    Compiling libjinge-0.4.0 on my Leopard returned the following errors: /bin/sh ../../../libtool --silent --tag=CXX --mode=link g++ -g -o login login-login_main.o login-xmppsocket.o login-xmppthread.o login-xmpppump.o login-xmppauth.o ../../../talk/xmpp/libcricketxmpp.la ../../../talk/xmllite/libcricketxmllite.la ../../../talk/base/libcricketbase.la -lexpat -lpthread -lssl -lcrypto Undefined symbols: "_BIO_clear_flags", referenced from: socket_read(bio_st*, char*, int)in libcricketbase.a(openssladapter.o) socket_write(bio_st*, char const*, int)in libcricketbase.a(openssladapter.o) "_BIO_set_flags", referenced from: socket_read(bio_st*, char*, int)in libcricketbase.a(openssladapter.o) socket_write(bio_st*, char const*, int)in libcricketbase.a(openssladapter.o) Any ideas? I couldn't find an answer... Thanks!

    Read the article

  • Javascript undefined variable

    - by djairo
    I have a problem with a javascript error: $("#slider") is undefined How can i solve this problem? <script type="text/javascript"> $(document).ready(function() { $("#slider").easySlider({ controlsBefore: '<p id="controls">', controlsAfter: '</p>', prevId: 'prevBtn', nextId: 'nextBtn' }); }); </script> This is my html <div id='slider'> <table> <tr> <td width='325'>hello</td> <td width='325'>hello</td> </table> </div>

    Read the article

  • Undefined reference to ...

    - by Patrick LaChance
    I keep getting this error message every time I try to compile, and I cannot find out what the problem is. any help would be greatly appreciated: C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::List()' C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::add(int)' collect2: ld returned 1 exit status code: //List.h #ifndef LIST_H #define LIST_H #include <exception> //brief Definition of linked list class class List { public: /** \brief Exception for operating on empty list */ class Empty : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Exception for invalid operations other than operating on an empty list */ class InvalidOperation : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Node within List */ class Node { public: /** data element stored in this node */ int element; /** next node in list */ Node* next; /** previous node in list */ Node* previous; Node (int element); ~Node(); void print() const; void printDebug() const; }; List(); ~List(); void add(int element); void remove(int element); int first()const; int last()const; int removeFirst(); int removeLast(); bool isEmpty()const; int size()const; void printForward() const; void printReverse() const; void printDebug() const; /** enables extra output for debugging purposes */ static bool traceOn; private: /** head of list */ Node* head; /** tail of list */ Node* tail; /** count of number of nodes */ int count; }; #endif //List.cpp I only included the parts of List.cpp that might be the issue #include "List.h" #include <iostream> #include <iomanip> using namespace std; List::List() { //List::size = NULL; head = NULL; tail = NULL; } List::~List() { Node* current; while(head != NULL) { current = head-> next; delete current->previous; if (current->next!=NULL) { head = current; } else { delete current; } } } void List::add(int element) { Node* newNode; Node* current; newNode->element = element; if(newNode->element > head->element) { current = head->next; } else { head->previous = newNode; newNode->next = head; newNode->previous = NULL; return; } while(newNode->element > current->element) { current = current->next; } if(newNode->element <= current->element) { newNode->previous = current->previous; newNode->next = current; } } //main.cpp #include "List.h" #include <iostream> #include <string> using namespace std; //void add(int element); int main (char** argv, int argc) { List* MyList = new List(); bool quit = false; string value; int element; while(quit==false) { cin>>value; if(value == "add") { cin>>element; MyList->add(element); } if(value=="quit") { quit = true; } } return 0; } I'm doing everything I think I'm suppose to be doing. main.cpp isn't complete yet, just trying to get the add function to work first. Any help will be greatly appreciated.

    Read the article

  • Error with swig: undefined symbol: _ZN7hosters11hostersLink7getLinkEi

    - by Eduardo
    I'm trying to make a python binding for the this library: http://code.google.com/p/hosterslib/. I'm using swig, heres is the code: %module pyhosters %{ include "hosters/hosters.hpp" %} %include "hosters/hosters.hpp" I run "swig -c++ -python -o swig_wrap.cxx swig.i" and I compile with "g++ -O2 -fPIC -shared -o _pyhosters.so swig_wrap.cxx python-config --libs --cflags -lhosters -lcln -lhtmlcxx pkg-config libglog --libs --cflags -I/usr/include/python2.6 -Wall -Wextra" But when I run python and I import it, I get: import pyhosters Traceback (most recent call last): File "", line 1, in File "./pyhosters.py", line 7, in import _pyhosters ImportError: ./_pyhosters.so: undefined symbol: _ZN7hosters11hostersLink7getLinkEi How can I solve that? Thanks.

    Read the article

  • jQuery Plugin with $.getJSON Returning undefined?

    - by Oscar Godson
    Inside of a jQuery plugin I made I have: $.getJSON(base_url,{ agenda_id:defaults.id, action:defaults.action+defaults.type, output:defaults.output },function(json){ return json; }); And in a separate JS file (yes, it comes after the plugin): json = $('#agenda-live-preview').agenda({action:'get',type:'agenda',output:'json'}); alert(json[0].agenda_id); If i do the above $.getJSON and put an alert inside of the $.getJSON it works and returns "3", which is correct. If I do it like the json=$('#agenda-live-preview').agenda(...)... it returns undefined. My JSON is valid, and the json[0].agenda_id is correct also, I know it's in a callback, so how do I get the stuff inside of a callback in a function return?

    Read the article

  • innerHTML yielding undefined, but correct data is visible

    - by Mike Dyer
    var Model,node; document.getElementById('sedans').innerHTML=''; var thismodelabbr,prevmodelabbr; for(var j=0; j<xmlDoc.getElementsByTagName('data').length; j++){ node = xmlDoc.getElementsByTagName('data')[j]; thismodelabbr=node.getAttribute('model'); if(prevmodelabbr!=thismodelabbr){ Model+='<a href="">'+ node.getAttribute('model')+'</a>'; } prevmodelabbr=thismodelabbr; document.getElementById('sedans').innerHTML=Model; } The above javascript snippet is working correctly and as needed, but I'm getting an "Undefined" response before the entry is displayed within its respective page. I'm assuming it has to do with the .innerHTML call. Any insight would be deeply appreciated.

    Read the article

  • paging php error - undefined index

    - by fusion
    i've a search form with paging. when the user enters the keyword initially, it works fine and displays the required output; however, it also shows this error: Notice: Undefined index: page in C:\Users\user\Documents\Projects\Pro\search.php on line 21 Call Stack: 0.0011 372344 1. {main}() C:\Users\user\Documents\Projects\Pro\search.php:0 . .and if the user clicks on the 'next' page, it shows no output with this error thrown: Notice: Undefined index: q in C:\Users\user\Documents\Projects\Pro\search.php on line 19 Call Stack: 0.0016 372048 1. {main}() C:\Users\user\Documents\Projects\Pro\search.php:0 this is my code: <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); include 'config.php'; $search_result = ""; $search_result = trim($_GET["q"]); $page= $_GET["page"]; //Get the page number to show if($page == "") $page=1; $search_result = mysql_real_escape_string($search_result); //Check if the string is empty if ($search_result == "") { echo "<p class='error'>Search Error. Please Enter Your Search Query.</p>" ; exit(); } if ($search_result == "%" || $search_result == "_" || $search_result == "+" ) { echo "<p class='error1'>Search Error. Please Enter a Valid Search Query.</p>" ; exit(); } if(!empty($search_result)) { // the table to search $table = "thquotes"; // explode search words into an array $arraySearch = explode(" ", $search_result); // table fields to search $arrayFields = array(0 => "cQuotes"); $countSearch = count($arraySearch); $a = 0; $b = 0; $query = "SELECT cQuotes, vAuthor, cArabic, vReference FROM ".$table." WHERE ("; $countFields = count($arrayFields); while ($a < $countFields) { while ($b < $countSearch) { $query = $query."$arrayFields[$a] LIKE '%$arraySearch[$b]%'"; $b++; if ($b < $countSearch) { $query = $query." AND "; } } $b = 0; $a++; if ($a < $countFields) { $query = $query.") OR ("; } } $query = $query.")"; $result = mysql_query($query, $conn) or die ('Error: '.mysql_error()); $totalrows = mysql_num_rows($result); if($totalrows < 1) { echo '<span class="error2">No matches found for "'.$search_result.'"</span>'; } else { $limit = 3; //Number of results per page $numpages=ceil($totalrows/$limit); $query = $query." ORDER BY idQuotes LIMIT " . ($page-1)*$limit . ",$limit"; $result = mysql_query($query, $conn) or die('Error:' .mysql_error()); ?> <div class="caption">Search Results</div> <div class="center_div"> <table> <?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); ?> <tr> <td style="text-align:right; font-size:15px;"><?php h($row['cArabic']); ?></td> <td style="font-size:16px;"><?php echo $cQuote; ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']); ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td> </tr> <?php } ?> </table> </div> <?php //Create and print the Navigation bar $nav=""; if($page > 1) { $nav .= "<a href=\"search.php?page=" . ($page-1) . "&string=" .urlencode($search_result) . "\"><< Prev</a>"; } for($i = 1 ; $i <= $numpages ; $i++) { if($i == $page) { $nav .= "<B>$i</B>"; }else{ $nav .= "<a href=\"search.php?page=" . $i . "&string=" .urlencode($search_result) . "\">$i</a>"; } } if($page < $numpages) { $nav .= "<a href=\"search.php?page=" . ($page+1) . "&searchstring=" .urlencode($search_result) . "\">Next >></a>"; } echo "<br /><br />" . $nav; } } else { exit(); } ?>

    Read the article

  • jQuery Cycle plugin pagerAnchorBuilder images becoming undefined

    - by Casey Becking
    I have a slideshow built in flash that I want to mimic in jQuery. The slide show uses the images from the slideshow as the pager numbers. The problem im having is once i apply links to the slideshow images the pagerAnchorBuilder image returns an undefined for the src of the image. Javascript - $(function() { $('#slideshow').before('<ul id="nav">').cycle({ fx: 'fade', timeout: 7000, pager: '#nav', pagerAnchorBuilder: function(idx, slide) { return '<li><a href="#"><img src="' + slide.src + '" width="100" height="60" /></a></li>'; } }); }); HTML - <div id="slideshow" class="pics"> <a href="http://google.com"><img src="home_1.jpg" width="1000" height="600" /></a> <a href="http://google.com"><img src="home_2.jpg" width="1000" height="600" /></a> <a href="http://google.com"><img src="home_3.jpg" width="1000" height="600" /></a> <a href="http://google.com"><img src="home_4.jpg" width="1000" height="600" /></a> <a href="http://google.com"><img src="home_5.jpg" width="1000" height="600" /></a> </div> If i remove the href's from the slideshow the images in the pager show up without issues. Im not sure if this is a bug or something i need to find a fix for?

    Read the article

  • PHP Codeigniter Undefined Offset Error

    - by Matt
    Hello, I am building a Codeigniter shopping cart. On the cart details page I have a form input field allowing the user to type in the quantity required of a product, and a submit button to post the information to the update function. When there is just one item in the cart, when updating the quantity everything works as it should. However, when there is more than one item, changing the quantity of an item and clicking submit results in a ‘Undefined Offset 1: error on the following code in the Model (specifically the two lines within the array) : function validate_update_cart() { $total = $this->cart->total_items(); $item = $this->input->post('rowid'); $qty = $this->input->post('qty'); for($i=0;$i < $total;$i++) { $data = array( 'rowid' => $item[$i], 'qty' => $qty[$i] ); $this->cart->update($data); } } This is the View code to which the above refers: <form action="<?php echo base_url(); ?>home/update" method="post"> <div><input type="hidden" name="rowid[]" value="<?php echo $item['rowid']; ?>"/></div> <div><input type="text" name="qty[]" value="<?php echo $item['qty']; ?>" maxlength="2" class="chg-qty"/></div> <div><input type="submit" value="update" class="update-quantity"/></div> </form> And this is the Controller: function update() { $this->products_model->validate_update_cart(); redirect('cart'); } Please can anyone explain why this is happening? Many thanks, Matt

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >