Daily Archives

Articles indexed Monday April 26 2010

Page 7/110 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • php edit database entery script not working.

    - by Jacksta
    I have two files which show all contats in a database, then edits them. The second script keeps directing the browser back due to this part. I cant work out how to make it work! :) <?php if (!$_POST[id]) { header( "Location: pick_modcontact.php"); exit; } else { session_start(); } if ($_SESSION[valid] != "yes") { header( "Location: pick_modcontact.php"); exit; } This script shows all contacts in a database which is an "address book" this part works fine. please see below. Name:pick_modcontact.php if ($_SESSION[valid] != "yes") { header( "Location: contact_menu.php"); exit; } $db_name = "testDB"; $table_name = "my_contacts"; $connection = @mysql_connect("localhost", "admin", "user") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT id, f_name, l_name FROM $table_name ORDER BY f_name"; $result = @mysql_query($sql, $connection) or die(mysql_error()); $num = @mysql_num_rows($result); if ($num < 1) { $display_block = "<p><em>Sorry No Results!</em></p>"; } else { while ($row = mysql_fetch_array($result)) { $id = $row['id']; $f_name = $row['f_name']; $l_name = $row['l_name']; $option_block .= "<option value\"$id\">$f_name, $l_name</option>"; } $display_block = "<form method=\"POST\" action=\"show_modcontact.php\"> <p><strong>Contact:</strong> <select name=\"id\">$option_block</select> <input type=\"submit\" name=\"submit\" value=\"Select This Contact\"></p> </form>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modify A Contact</title> </head> <body> <h1>My Contact Management System</h1> <h2><em>Modify a Contact</em></h2> <p>Select a contact from the list below, to modify the contact's record.</p> <? echo "$display_block"; ?> <br> <p><a href="contact_menu.php">Return to Main Menu</a></p> </body> </html> This script is for modifying the contact: named show_modcontact.php <?php if (!$_POST[id]) { header( "Location: pick_modcontact.php"); exit; } else { session_start(); } if ($_SESSION[valid] != "yes") { header( "Location: pick_modcontact.php"); exit; } $db_name = "testDB"; $table_name = "my_contacts"; $connection = @mysql_connect("localhost", "admin_cantsayno", "cantsayno") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT f_name, l_name, address1, address2, address3, postcode, prim_tel, sec_tel, email, birthday FROM $table_name WHERE id = '$_POST[id]'"; $result = @mysql_query($sql, $connection) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $f_name = $row['f_name']; $l_name = $row['l_name']; $address1 = $row['address1']; $address2 = $row['address2']; $address3 = $row['address3']; $country = $row['country']; $prim_tel = $row['prim_tel']; $sec_tel = $row['sec_tel']; $email = $row['email']; $birthday = $row['birthday']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modify A Contact</title> </head> <body> <form action="do_modcontact.php" method="post"> <input type="id" value="<? echo "$_POST[id]"; ?>" /> <table cellpadding="5" cellspacing="3"> <tr> <th>Name & Address Information</th> <th> Other Contact / Personal Information</th> </tr> <tr> <td align="top"> <p><strong>First Name:</strong><br /> <input type="text" name="f_name" value="<? echo "$f_name" ?>" size="35" maxlength="75" /></p> <p><strong>Last Name:</strong><br /> <input type="text" name="l_name" value="<? echo "$l_name" ?>" size="35" maxlength="75" /></p> <p><strong>Address1:</strong><br /> <input type="text" name="f_name" value="<? echo "$address1" ?>" size="35" maxlength="75" /></p> <p><strong>Address2:</strong><br /> <input type="text" name="f_name" value="<? echo "$address2" ?>" size="35" maxlength="75" /></p> <p><strong>Address3:</strong><br /> <input type="text" name="f_name" value="<? echo "$address3" ?>" size="35" maxlength="75" /> </p> <p><strong>Postcode:</strong><br /> <input type="text" name="f_name" value="<? echo "$postcode" ?>" size="35" maxlength="75" /></p> <p><strong>Country:</strong><br /> <input type="text" name="f_name" value="<? echo "$country" ?>" size="35" maxlength="75" /> </p> <p><strong>First Name:</strong><br /> <input type="text" name="f_name" value="<? echo "$f_name" ?>" size="35" maxlength="75" /></p> </td> <td align="top"> <p><strong>Prim Tel:</strong><br /> <input type="text" name="f_name" value="<? echo "$prim_tel" ?>" size="35" maxlength="75" /></p> <p><strong>Sec Tel:</strong><br /> <input type="text" name="f_name" value="<? echo "$sec_tel" ?>" size="35" maxlength="75" /></p> <p><strong>Email:</strong><br /> <input type="text" name="f_name" value="<? echo "$email" ?>" size="35" maxlength="75" /> </p> <p><strong>Birthday:</strong><br /> <input type="text" name="f_name" value="<? echo "$birthday" ?>" size="35" maxlength="75" /> </p> </td> </tr> <tr> <td align="center"> <p><input type="submit" name="submit" value="Update Contact" /></p> <br /> <p><a href="contact_menu.php">Retuen To Menu</a></p> </td> </tr> </table> </form> </body> </html>

    Read the article

  • Help naming a class that has a single public method called Execute()

    - by devoured elysium
    I have designed the following class that should work kind of like a method (usually the user will just run Execute()): public abstract class ??? { protected bool hasFailed = false; protected bool hasRun = false; public bool HasFailed { get { return hasFailed; } } public bool HasRun { get { return hasRun; } } private void Restart() { hasFailed = false; hasRun = false; } public bool Execute() { ExecuteImplementation(); bool returnValue = hasFailed; Restart(); return returnValue; } protected abstract void ExecuteImplementation(); } My question is: how should I name this class? Runnable? Method(sounds awkward)?

    Read the article

  • Source Control at home

    - by Sash
    I am trying to setup a dev environment at home. My primary development environment is VS.NET 2008 (now it is VS 2010 Premium) with SQL Server 2008. Objectives / Requirements : - Should be simple and lightweight - Should have a Visual Studio plugin (cost should be less than $50, if its not free) - should work just fine with continuous integration systems like TFS and CruiseControl.NET - VSS is not an option. Thanks in advance, SK

    Read the article

  • NSTableViewCell uses value from other cells

    - by Michael Z
    Hi Guys: I have problem with using dequeueReusableCellWithIdentifier method. Whenever I use this one, one cell would display its own value and value that does not belong to it. This first and second images show the problem, while the third image shows the proper data.The problem seems to be caused by old value not being wiped off and the new value being added on top if it. Which seems very strange.

    Read the article

  • jQuery Custom Gallery and jCarousel problem

    - by steve
    Active site can be seen here: http://www.studioimbrue.com/index2.php There are currently two small problems with the coding. First: when the page loads and you attempt to click on one of the large images to advance, nothing happens. Once a thumbnail is clicked, the click functionality of the large image comes available. I'm trying to fix it so when the page loads, the user can just start clicking the large image. Second: when an image is clicked, the thumbnail highlight changes. The only problem there is once it gets past 4, the "current" thumbnail needs to be seen, thus the carousel should go to that one. Right now the code for that is nextThumb.closest('.thumbscontainer').jcarousel('next'); but that makes it scroll every time you click. Thanks for any help

    Read the article

  • Preserve HTML font-size when iPhone orientation changes from portrait to landscape

    - by DShultz
    I have a mobile web application with an unordered list containing multiple listitems with a hyperlink inside of each li: <ul> <li id="home" class="active"> <a href="home.html">HOME</a></div> </li> <li id="home" class="active"> <a href="test.html">TEST</a></div> </li> </ul> ...My question is how can I format the hyperlinks so that they DON'T change size when viewed on an iPhone, and the accellerometer switches from portrait - landscape? Right now, I have the hyperlink font size spec'ed to 14px, but when switching to landscape, it blows way up to like 20px. I want the font-size to stay the same. Here is the selector: ul li a { font-size:14px; text-decoration: none; color: #cc9999; }

    Read the article

  • Future proofing client-server code?

    - by Koran
    Hi, We have a web based client-server product. The client is expected to be used in the upwards of 1M users (a famous company is going to use it). Our server is set up in the cloud. One of the major questions while designing is how to make the whole program future proof. Say: Cloud provider goes down, then move automatically to backup in another cloud Move to a different server altogether etc The options we thought till now are: DNS: Running a DNS name server on the cloud ourselves. Directory server - The directory server also lives on the cloud Have our server returning future movements and future URLs etc to the client - wherein the client is specifically designed to handle those scenarios Since this should be a usual problem, which is the best solution for the same? Since our company is a very small one, we are looking at the least technically and financially expensive solution (say option 3 etc)? Could someone provide some pointers for the same? K

    Read the article

  • Unset core.editor in Msysgit

    - by mathee
    I set my editor per an SO entry: http://stackoverflow.com/questions/780425/how-do-i-setup-diffmerge-with-msysgit-gitk. I'm wondering how to undo this because I want to switch back to the default editing program.

    Read the article

  • Oracle SQL CMD Line!!!

    - by DAVID
    Hi when ever perform select statements in the command line tool it doesnt use all of the space.. ive modified buffer size and window size and it just doesnt work. here is the Screenshot http://img19.imageshack.us/img19/8954/cmdoracle.jpg

    Read the article

  • How to get GWT 2.0 and Restlet 2.0 to play nice

    - by Holograham
    Hello, I am having trouble getting Restlet to play nice with GWT in the same project. I have been trying the examples from Restlets website to no avail I am using Eclipse, Maven2 plugin, GWT, and Restlet GWT. I have never used server side code in this GWT project before and I know there is some custom setup involved. I am deploying locally for the time being using the built in Jetty in GWT Hosted Mode. I can get my front end to display but my back end is not executing. I did add this to my web.xml file which is from the example (for the time being I am trying to drop the example into my project). <servlet> <servlet-name>adapter</servlet-name> <servlet-class>org.restlet.ext.gwt.GwtShellServletWrapper</servlet-class> <init-param> <param-name>org.restlet.application</param-name> <param-value>org.restlet.example.gwt.server.TestServerApplication</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>adapter</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> I did notice that my web.xml file is located separately from my war deployment directory. My project dir structure is setup as follows. Project Root src/main/java src/main/resources src/main/test JRE Maven Dependecies GWT SDK src main webapp WEB-INF web.xml target war <my project dir> WEB-INF lib pom.xml So there is no web.xml under my war files WEB-INF directory. I am new to this type of application so it is most likely a matter of me not understanding the directory structure and how my GWT project is compiling into these dirs. Any help is appreciated! If I need to provide any more info let me know. Thanks

    Read the article

  • How can I access the ListViewItems of a WPF ListView?

    - by David Schmitt
    Within an event, I'd like to put the focus on a specific TextBox within the ListViewItem's template. The XAML looks like this: <ListView x:Name="myList" ItemsSource="{Binding SomeList}"> <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <!-- Focus this! --> <TextBox x:Name="myBox"/> I've tried the following in the code behind: (myList.FindName("myBox") as TextBox).Focus(); but I seem to have misunderstood the FindName() docs, because it returns null. Also the ListView.Items doesn't help, because that (of course) contains my bound business objects and no ListViewItems. Neither does myList.ItemContainerGenerator.ContainerFromItem(item), which also returns null.

    Read the article

  • Restrict number of lines in html JLabel

    - by Mike
    I have a JLabel that needs to display some html-formatted text. However, I want to restrict this to being 4 lines long (and if so, provide a button to see everything). So far, I've tried setting the maximum size manually or via a layout manager. However, both of these solutions can cause part of a line to be displayed.

    Read the article

  • how to souce a csh script in bash to set the enviroment

    - by Daniel
    We have oracle running on Solaris, and the shell is by default CSH. So the login script set the oracle_home,oracle_sid in csh also. But I don't like csh and want to use bash to do my work. So how to source the csh login script in bash? e.g, the following is what in the .cshrc file. And when use bash, I'd like use these variables. One way is to copy the variables again and use bash command, such as export ORACLE_SID=TEST. But doing so will let us to maintain two copy of the files. And when we change the database name, or upgrade the database, I need to maintian the bash login file seperately. It's nice to just use something like source .cshr in bash, but it doesn't work. setenv ORACLE_SID TEST setenv ORACLE_HOME /oracle/TEST/home/products/10204 setenv EPC_DISABLED TRUE setenv MANPATH /usr/local/man:/usr/share/man setenv EDITOR vi setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/sfw/lib/64 setenv NLS_LANG AMERICAN_AMERICA.UTF8 setenv NLS_DATE_FORMAT "DD-MON-RR"

    Read the article

  • Cant we use a Set or collection as a return type in GAE?

    - by user273422
    In my code i have used Set<Employees> as a return type to my function addEmp(). So, i m gettin an Compilation error. The Error is: Compiling module com.employeedepartmentgae.Employeedepartmentgae Refreshing module from source Validating newly compiled units Removing units with errors [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java' [ERROR] Line 6: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 18: Employee cannot be resolved to a type [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java' [ERROR] Line 6: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 20: Employee cannot be resolved to a type [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java' [ERROR] Line 12: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 75: The method addEmp(String, String, String, AsyncCallback) from the type GreetingServiceAsync refers to the missing type Employee [ERROR] Line 75: The type new AsyncCallback(){} must implement the inherited abstract method AsyncCallback.onSuccess(Set) [ERROR] Line 75: Employee cannot be resolved to a type [ERROR] Line 94: The method onSuccess(Set) of type new AsyncCallback(){} must override or implement a supertype method [ERROR] Line 94: Employee cannot be resolved to a type [ERROR] Line 96: Employee cannot be resolved to a type [ERROR] Line 96: Employee cannot be resolved to a type [ERROR] Line 98: Employee cannot be resolved to a type Removing invalidated units [WARN] Compilation unit 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/Employeedepartmentgae.java' is removed due to invalid reference(s): [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java [WARN] Compilation unit 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/DepartmentWidget.java' is removed due to invalid reference(s): [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java Computing all possible rebind results for 'com.employeedepartmentgae.client.Employeedepartmentgae' Rebinding com.employeedepartmentgae.client.Employeedepartmentgae Checking rule [ERROR] Unable to find type 'com.employeedepartmentgae.client.Employeedepartmentgae' [ERROR] Hint: Previous compiler errors may have made this type unavailable [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly So please help me.....

    Read the article

  • Exposing headers on iPhone static library

    - by leolobato
    Hello guys, I've followed this tutorial for setting up a static library with common classes from 3 projects we are working on. It's pretty simple, create a new static library project on xcode, add the code there, a change some headers role from project to public. The tutorial says I should add my library folder to the header search paths recursively. Is this the right way to go? I mean, on my library project, I have files separated in folders like Global/, InfoScreen/, Additions/. I was trying to setup one LOKit.h file on the root folder, and inside that file #import everything I need to expose. So on my host project I don't need to add the folder recursively to the header search path, and would just #import "LOKit.h". But I couldn't get this to work, the host project won't build complaining about all the classes I didn't add to LOKit.h, even though the library project builds. So, my question is, what is the right way of exposing header files when I setup a Cocoa Touch Static Library project on xCode?

    Read the article

  • Matching a rotated bitmap to a collage image

    - by Dmi
    Hi, My problem is that I have an image of a detailed street map. On this map, there can be a certain small image of a sign (such as a traffic light icon) rotated at any angle, maybe resized. I have this small image in a bitmap. Is there any algorithm or technique by which I can locate this bitmap if a copy of it exists, rotated and maybe resized, in the large collage image? This is similar to the problem with Augmented Reality and locating the marker image, but mine is only 2D with no perspective distortion.

    Read the article

  • Javascript Detect All Images (Including Asynchronous)

    - by Zach
    Is there a way in javascript to detect all images in a document, including those that may be loaded asynchronously (and maybe after the DOM is ready)? I'm looking to create a function that can detect if Google Analytics has been loaded by searching through the DOM looking for "__utm.gif". document.images doesn't seem to hold this image as it's loaded asynchronously and not displayed.

    Read the article

  • What is the equivalent of "colspan" in an Android TableLayout?

    - by Spike Williams
    I'm using a TableLayout in Android. Right now I have one TableRow with two items in it, and, below that, a TableRow with one item it it. It renders like this: ----------------------------- | Cell 1 | Cell 2 | ----------------------------- | Cell 3 | --------------- What I want to do is make Cell 3 stretch across both upper cells, so it looks like this: ----------------------------- | Cell 1 | Cell 2 | ----------------------------- | Cell 3 | ----------------------------- In HTML I'd use a COLSPAN.... how do I make this work in Android?

    Read the article

  • Web CMS That Outputs to Flat Static Pages (.html) via FTP to Remote Server?

    - by Sootah
    I have a web app project that I will be starting to work on shortly. One of the features included is going to be a content management system where users can add content and then that content will be combined with a template and then output as a regular .html file. This .html file would then be FTPed to their own web host. As I've always believed in not reinventing the wheel I figured I'd see if there are any quality customizable CMSes out there that do this already do this. For instance, Blogger.com allows you to post all of your content to your account there; but offers the option to let you use your own hosting. Any time you publish a new article then a new .html page is generated (as well as an updated index page with links to the new article) and then the updated content is FTPed to your own server. What I would like is something like this that I can modify to more closely suit my needs. Required Features: Able to host on my own server Written in PHP Users add content through their account, then when posted it is FTPed as .html to their server Any appropriate pages are also updated to link to the new content (like the index page or whatnot) Templateable Customizable Optional (but very much desired) features: Written in CodeIgniter or a similar PHP framework While CodeIgniter isn't strictly required, I would very much prefer it. It speeds up development time and makes things much easier to implement. So - any suggestions? I've stumbled across a few CMSes that push to remote servers as static pages, but the ones I've found all are hosted on the developers servers which means that I cannot modify it at all. Thanks again fellow StackOverflowians! -Sootah

    Read the article

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