627 Posted Topics
Re: all you need is: [CODE] var LI = document.getElementById('change'); if( LI ) { //you located an element with id='change' LI.className='someOtherClassNameHere'; } else { //no element contains id="change" } [/CODE] | |
Re: give them the SAME name ([iCODE]name='date'[/iCODE]), but different values. Then [iCODE]$_GET['date'][/iCODE] will give you the date of the button that was clicked. | |
Re: Are ALL of those db fields NUMERIC data types? If you are inserting text, you need apostrophes around the value. If you are inserting a NUMBER then do not put apostrophes around the value - ex: [CODE]INSERT INTO Person(email,age) VALUES('john@company.com',23)[/CODE] | |
Re: instead of [iCODE]$pct_data = new pie_value(...);[/iCODE] you need [iCODE]$pct_data[B][color=red][][/color][/B] = new pie_value(...);[/iCODE] | |
Re: [CODE=php] <?php if($logged_in) { echo "Welcome back, $logged_row[username] "; ?> <a href="<?= $_SERVER["REQUEST_URI"] . '&action=logout' ?>"><?= $lang['ACC_LOGOUT'] ?></a> <?php } else { print('<a href="http://xxx/login.html">Login</a> / <a href="http://xxx.com/signup.html">Signup</a>'); } ?>[/CODE] | |
Re: Currently you have TWO open <form> tags. Get rid of the first one and instead put the [iCODE]<FORM>[/iCODE] around the [iCODE]<table>[/iCODE] and give your form an [iCODE]id="Add_Record"[/iCODE]: [CODE] <html> <head> <!-- <link rel="stylesheet" media="screen" href="DynCalendar/dynCalendar.css" /> <script language="javascript" type="text/javascript" src="DynCalendar/browserSniffer.js"></script> <script language="javascript" type="text/javascript" src="DynCalendar/dynCalendar.js"></script> --> <link rel="stylesheet" media="screen" href="http://www.phpguru.org/css/dynCalendar.css" /> … | |
Re: Adding a second column is really NOT the ideal approach/solution. What if you add more groups and a person needs to belong to many groups. What you need to do is to add a table to list the groups and another table that holds the membership info: [CODE] Person id … | |
Re: I can go to your site now and attempt to request /Nathaniel10.php and you WILL find a reference to it in your log file. However, that does not mean that I "uploaded" said file to your server. It merely indicates that I "tried" to access a file named "Nathaniel10.php" (regardless … | |
Re: you cannot use myslq_real_escape_string() UNLESS you are connected to your DB first. Did you? WRONG: [CODE]<?php $username=mysql_real_escape_string($_POST['username']); $password=mysql_real_escape_string($_POST['password']); mysql_connect(...) or die( mysql_error() ); mysql_select_db(...) or die( mysql_error() ); mysql_query("SELECT * FROM Person WHERE username='$username' AND password='$password'" ) or die( mysql_error() ); ?>[/CODE] CORRECT: [CODE]<?php mysql_connect(...) or die( mysql_error() ); mysql_select_db(...) … | |
Re: [CODE] <input id="txtstext" class="t-box" name="txtstext" type="text" value="<?php echo htmlentities($_GET['var'],ENT_QUOTES); ?>" style="width:100px"> [/CODE] | |
Re: try: [CODE] function isAlphabet(elem, helperMsg){ var alphaExp = /[a-z]+/i; var nums=/\d+/; var alnum=/^[a-z\d]+$/i; if(elem.value.match(alnum) && elem.value.match(alphaExp) && elem.value.match(nums) ){ return true; }else{ alert(helperMsg); setTimeout(function(){elem.focus();},20); return false; } } [/CODE] | |
Re: try: [CODE] <script type="text/javascript"> function goToAnchor() { location.href = <?php echo sprintf('"display_tattoos_2009.php?in=%s#placeholder%s";', $imagenum, $imagenum); ?> } </script> [/CODE] | |
Re: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:/www.w3.org/TR/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" /> <title> Oefeningen 3 week 1</title> </head> <body> <table border="1"> <tr> <th>Fahrenheit</th> <th>Celsius</th> </tr> <?php $Tf = 32 ; $Tc = 0.00; while( $Tc < 100.01) { ?> <tr> <td> <?php echo … | |
Re: instead of: [CODE=javascript]var dropInsertBeforeElement = createElement("<div id='drop_insert_before_" + this.id + "' style='height:6px; width:" + totalWidth + "px;'>");[/CODE] try: [CODE=javascript] var dropInsertBeforeElement = document.createElement("div"); dropInsertBeforeElement.id='drop_insert_before_' + this.id; dropInsertBeforeElement.style.height='6px'; dropInsertBeforeElement.style.width= totalWidth + 'px'; [/CODE] | |
Re: [QUOTE]apart from whether the extra is free or not, it just enters 0 into each column.[/QUOTE] which input element determines this? What html markup is your script generating? It would be easier to understand the problem is you post a link to your page. | |
Re: instead of requesting: [CODE]$url='http://example.com/vast/1/73188';[/CODE] try requesting [CODE]$url='http://example.com/vast/1/73188?cb=' . time();[/CODE] | |
Re: [QUOTE]If there is already Data in the field should I be using UPDATE instead of INSERT?[/QUOTE] UPDATE [QUOTE]How do I specify which record/primary key is to update?[/QUOTE] currently you are generating: [CODE=php] ... echo "<input type='text' size='2' name='PTS1011_wk1'>"; ... echo "<input type='text' size='2' name='GP1011_wk1'>"; ... [/CODE] for each player. I … | |
Re: [QUOTE]If I were to follow what I think the other forum is suggestion, I would need to put each keyword in a separate table or column? [/QUOTE] A column, NOT a table. And yes, that is exactly what I would do. [CODE][B]Bulb[/B] id ... [B]Category[/B] id name [B] Keyword[/B] id … | |
Re: It sounds like you are executing: [CODE=php] $res = mysql_query("some query here"); while($row = mysql_fetch_assoc($res) ) { //...code here } [/CODE] what you need to do is add " or die( mysql_error() );" so that you get details about the error. [code=php] $res = mysql_query("some query here") or die( mysql_error() … | |
Re: [QUOTE]i've tried using bactick character but it failed.[/QUOTE] Then you either are NOT using MySQL OR you probably used apostrophes instead of backticks. The backtick (`) is the one on the same key as the ~ character. | |
![]() | Re: I suppose you could simply include a couple of radio buttons: [CODE] <input type="radio" name="member" value="buyer" checked="checked"/>Buyer <input type="radio" name="member" value="seller"/>Seller [/CODE] (OR a select list with the two options). ![]() |
Re: If the tables already exists, make sure that: -BOTH are using INNODB engine. -In both tables, the fields are of the same type and size ( ex : INT(10)) then try: [CODE=mysql] ALTER TABLE `childTableNameHere` ADD CONSTRAINT `parentTableNameHerechildTableNameHere` FOREIGN KEY (`parentTableNameHere_primaryFieldNameHere` ) REFERENCES `parentTableNameHere`( `primaryFieldNameHere` ) [/CODE] | |
Re: your problem is because your HTML markup is INVALID. For example, find your first [iCODE]<TR>[/iCODE] element. You have not stated where the [iCODE]<TABLE>[/iCODE] begins! Here's another example. If you were to add [iCODE]<table>[/iCODE] to fix the problem I mentioned above, then you have: [icode]<div><span id='writedist'></span></div>[/icode] as a child of [iCODE]<table>[/iCODE]. … | |
Re: [quote]i basically have a back end site php/mysql with clients addresses etc, i need to be able to send that data to another site where they have login and passord for and it pre populate the forms in the other site as best as it can.[/quote] but then you said … | |
Re: Then instead of selecting ALL the records, select only the ones that are null: [CODE]SELECT * FROM `tableName` WHERE `columnName` IS NULL[/CODE] | |
Re: try [iCODE]echo stripslashes($_POST['content']);[/iCODE] | |
Re: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><font size="+4">~~~FeedTitle~~~</font></title> <meta name="description" content="~~~FeedDescription~~~"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link href="http://www.feedforall.com/rss2html/ffa-29.css" rel='stylesheet' type='text/css'> <style type="text/css"> a { font-size: 30px; } .a font { text-align: center; } body { background: #FFFFFF url(http://www.backgroundlabs.com/backgrounds/358.gif) scroll repeat top left; } </style> </head> <body> … | |
Re: In validateAddUserForm() you are using [iCODE]$error .= ...;[/iCODE] but you have not initialized $error. Initialize it at the very top of your function (before the if clause). If you are still not seeing anything, begin adding [iCODE]echo sprintf('%s(): %s',__FUNCTION__,__LINE__);[/iCODE] statements throughout your function(s) so find out which lines are actually … | |
Re: are you being redirected to contractorlogin.php at least? Assuming you are, then in contractorlogin.php you MUST be storing the username in a session. As for the code you posted, you may want to use an EQUAL instead of a LIKE in your query: [CODE] <?php session_start(); if (!isset($_SESSION['memberusername'])){ header("Location: contractorlogin.php"); … | |
Re: Try enclosing the names in apostrophes - [iCODE]'smith, james'; 'beckam, david'[/iCODE] | |
Re: try: [CODE=php] <?php include_once('inc/functions.php'); // Get the search variable from URL $var = @mysql_safe($_GET['q']) ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=10000; // check for an empty string and display a message. if ($trimmed == "") { $error = "<tr><td colspan='2' style='text-align: center; … | |
Re: This is something you should do from the server dynamically. Do you have PHP? | |
Re: the easiest approach would be to "instruct" your form to send it directly to google: [CODE] <form method="get" action="http://www.google.co.uk/search"> <input type="hidden" name="btnG" value="Google Search"/> <input type="text" name="q" value=""/> <input type="submit" name="submit" value="Submit"/> </form> [/CODE] and if you want it in a new window: [CODE] <form target="_blank" method="get" action="http://www.google.co.uk/search"> ... </form> … | |
Re: [QUOTE]but now when I test my alerts, I get div tag alerts in my SUCCESS alert, and for COMPLETE: success [/QUOTE] OK, but does the SUCCESS alert also have the output of your php search script? try: [CODE] $(document).ready(function(){ $("form.ajax").submit(function(){ var ajax_div = $(this).attr("id")+"_results"; var data = $(this).serialize(); var url … | |
Re: I already told you that this: [CODE]list($name, $type, $size, $content) = mysql_fetch_array($result);[/CODE] needs to be using [iCODE]mysql_fetch_assoc()[/iCODE], even if you get a blank screen. The blank screen is due to some other issue. In your case, if you open firefox, go the link you provided, then click on test.php. Press … | |
Re: [QUOTE]Is this a mime-type issue in the header section?[/QUOTE] It sure sounds like it. On line 11, try changing: [CODE]mysql_fetch_array($result)[/CODE] to: [CODE]mysql_fetch_assoc($result)[/CODE] | |
Re: are you getting any error message reported? Have you verified that the script actually attempts to execute that query? Does the authenticated DB user have permissions to delete records on that db? Does you paragraph have the word 'Example' (uppercase) as opposed to 'example' (all lowercase)? | |
Re: what error message did you get? [url]http://us2.php.net/manual/en/function.mssql-get-last-message.php[/url] [CODE] ... mssql_select_db('dbname') or die('MSSQL error: ' . mssql_get_last_message()); [/CODE] | |
Re: using [url]http://www.dustindiaz.com/getelementsbyclass/[/url] try: [CODE] if( !document.getElementsByClassName ) { document.getElementsByClassName=function(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, … | |
Re: [CODE] $sql = sprintf("UPDATE sheets SET artist = '%s', title = '%s', active = '%s' WHERE id=%s " ,mysql_real_escape_string($artist) ,mysql_real_escape_string($title) ,mysql_real_escape_string($activestatus) ,mysql_real_escape_string($value) ); $result = mysql_query($sql) or die(mysql_error().'<br>'.$sql); [/CODE] | |
Re: [QUOTE]This is what I have in the body of my doc (I didn't include the head because it doesn't seem relevant): [CODE]<body> [COLOR="Red"]<php?[/COLOR] echo "Hello World. You suck!"; ?> </body> [/CODE][/QUOTE] OK, but: a. The name of the file need to end in ".php" b. You MUST use the proper … | |
Re: [QUOTE]give them a result as a link which able to redirect them based on their search[/QUOTE] assuming your search.php page is doing: [CODE=php]$query = "SELECT linkURL, linkText FROM Resources WHERE linkText LIKE '%{$searchTerm}%'"; [/CODE] (where Resources is your table name) and then generating: [CODE] <a href="http://remotesite.com">some text</a> [/CODE] when you … | |
Re: the variables declared OUTSIDE the function do NOT exist within the function. So you need to pass all of them (INCLUDING the connection to the db - assuming somewhere you did [iCODE][B]$dbConnection[/B]=mysql_connect(...)[/iCODE]: [CODE] $test = date_sched($month,$date,$num_teachers,$timeslot,$dbConnection); function date_sched($month,$date,$num_teachers,$slot,$dbConnection){ ... } [/CODE] ALTERNATIVELY, you can use the [B]global[/B] keyword to instruct … | |
Re: I see your method is "doPost()". I don't work with JSP, but IF in fact your server-side script is expecting a POST request, then the ajax you need to set the appropriate headers. So, REPLACE [iCODE] xhrequest.send(null);[/iCODE] with the following: [CODE] xhrequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhrequest.setRequestHeader('Content-Length',0); xhrequest.send(''); [/CODE] | |
Re: Refer to: [url]http://www.php.net/manual/en/filter.filters.sanitize.php[/url] | |
Re: Before answering your question, make sure you close your <FORM> tags at the end of each tab. Otherwise you will get unexpected behaviour across browsers. As for your problem, the easiest approach to your problem is to bind an onsubmit method to your forms and submit an ajax request. That … | |
Re: the browser submits the [B]NAME[/B] of your input fields, NOT the [B]id[/B]. So you MUST give your fields a [iCODE]name="..."[/iCODE] attribute: [CODE]<input type=text id="usrName" name="usrName" size="20">[/CODE] the same goes for the other fields. | |
Re: on the non-working code, these: [CODE=php] $renderjcrl = $renderjcrl . '<div id=\"carousel-cars-horiz\">'; $renderjcrl = $renderjcrl . '<ul id=\"carousel-cars\" class=\"jcarousel-skin-tango\">';[/CODE] will end up sending [CODE]id=\"....\"[/CODE] to the browser - meaning, the browser will get the backslash AND the double quotes because (unlike your first code) your overall string is enclosed in … | |
Re: are you using the html entity for the pound symbol? &#+163; (remove the + sign. I added it because it was being interpreted as html on this site's editor) [url]http://htmlhelp.com/reference/html40/entities/latin1.html[/url] Also, try adding this to your document's <head>: [CODE]<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />[/CODE] |
The End.