627 Posted Topics

Member Avatar for samarudge

assuming [iCODE][0-9a-zA-Z_-][/iCODE] represents the set of allowed characters, and that $url contains the hyperlink you want to "clean", then try: [CODE]$url = preg_replace('#[^0-9a-zA-Z_-]#','',$url);[/CODE]

Member Avatar for samarudge
0
136
Member Avatar for cassie261

[QUOTE]I'm suppose to select any row from my database...[/QUOTE] Where are you specifying which row/record to delete? I don't see you supplying an input field to supply the initial MatricNo to search for. For it to delete, first it needs to search, and for it to enter the "search" if …

Member Avatar for hielo
0
104
Member Avatar for bhaskar.k

On lines 232 AND 236 you have: [iCODE]<a href="<?php $_SERVER['PHP_SELF']?>index.php...[/iCODE] change them to: [iCODE]<a href="<?php [COLOR="Red"][B]echo [/B][/COLOR]$_SERVER['PHP_SELF'][COLOR="Red"][B];[/B][/COLOR]?>index.php...[/iCODE]

Member Avatar for hielo
0
90
Member Avatar for ndabbz

[QUOTE]but the previous, next and the page number links are not there at all[/QUOTE] Have you verified that your query actually returns MORE than 10 records? For purposes of testing, change: [iCODE]$display=10; //setting the number of records to display per page[/iCODE] to: [iCODE]$display=5; //setting the number of records to display …

Member Avatar for hielo
0
111
Member Avatar for filch

[iCODE]elseif[/iCODE] should be [CODE]else if[/CODE] (you need a space in between). Also, in your HTML, your [iCODE]<OPTION>[/iCODE] tags need to have those values as well and don't forget that js is case sensitive: [CODE] <option value="institutional memberhip">Institutional Memberhip</option> <option value="individual membership">Individual Membership</option> [/CODE]

Member Avatar for hielo
0
114
Member Avatar for sameeya007

on the last value you are inserting you have: [iCODE][COLOR="Red"]'[/COLOR]null[COLOR="Red"]'[/COLOR][/iCODE] Get rid of those apostrophes. It should be just NULL. Also, I suggest you list the fields you are inserting the data into: [iCODE]$query1="INSERT INTO `class`(`field1`,`field2`,`field3`,`field4`) VALUES(NULL,'$a','$grade', NULL)";[/iCODE] Replace the field# with the actual names of the fields in your …

Member Avatar for sameeya007
0
89
Member Avatar for pamdooley

change: [iCODE]GetSQLValueString $_POST['software[]'], "text")[/iCODE] to: [iCODE]GetSQLValueString( implode(',', $_POST['software']), "text")[/iCODE]

Member Avatar for hielo
0
189
Member Avatar for debasishgang7

if you want to use just files, from what you posted earlier, try using this as your topics.php (just add more topics to the [iCODE]$topics[/iCODE] array) [CODE] <?php //FYI: the 234 and the 745 are meant to be "random". In other words, you can assign whatever numbers you want. $topics=array( …

Member Avatar for hielo
0
196
Member Avatar for skier

try: [CODE] <?php $filename = "http://www.empowergroupusa.com/cambiolabs/extension/catalog/files/inspection_886.pdf"; if (file_exists($filename)) { echo '<a href="http://www.empowergroupusa.com/cambiolabs/extension/catalog/files/inspection_886.pdf">PDF</a>'; } else { echo "The file $filename does not exist"; } ?> [/CODE]

Member Avatar for hielo
0
729
Member Avatar for mattyd

change: $result = [iCODE][COLOR="Red"]"[/COLOR]mysql_query($query)[COLOR="Red"]"[/COLOR];[/iCODE] to: $result = mysql_query($query) or die( mysql_error() );

Member Avatar for richieking
0
144
Member Avatar for dschuett

should be [iCODE]created < DATE_SUB(NOW(), INTERVAL 30 DAY)[/iCODE] ( no '<=', simply use'<' ) as for the deletion, the function is named unlink() [URL="http://us3.php.net/manual/en/function.unlink.php"]http://us3.php.net/manual/en/function.unlink.php[/URL]

Member Avatar for dschuett
0
111
Member Avatar for SunnySideUp

assuming you are NOT saving the value in [iCODE] $_SESSION['jobProfile'][/iCODE] to the DB (just using if to display on browser), then instead of: [iCODE]$_SESSION['jobProfile'] = $jobDesc;[/iCODE] try: [iCODE]$_SESSION['jobProfile'] = nl2br($trimmed['txtJobProfile']);[/iCODE]

Member Avatar for SunnySideUp
0
202
Member Avatar for gchurch

[QUOTE] <option><?php if([COLOR="Red"]$day == 32[/COLOR]){$day = 1; echo $day;}else{ echo $day;} ?></option> <!--problem--> [/QUOTE] Where did you initialize [iCODE]$day[/iCODE]? BEFORE the if clause you should have: [CODE]$day = isset($_POST['daysOfMonth']) && !empty($_POST['daysOfMonth']) ? $_POST['daysOfMonth'] : 1;[/CODE]

Member Avatar for hielo
0
81
Member Avatar for mattyd

which part are you having trouble with? I suggest you post what you have thus far and provide more details regarding your problem.

Member Avatar for mattyd
0
777
Member Avatar for keyroche

> The trouble I am having is that the variable $i in the for loop is only recognized as 0 inside of the while, but it shows as the number it is supposed to outside the while. On the first iteration (when `$i` equals zero) BEFORE the `while()` you have …

Member Avatar for keyroche
0
110
Member Avatar for public-image

[QUOTE]however, when I use a refresh on my div it does refresh but does not change the image...[/QUOTE] That's because that auto_refresh is NOT making an ajax call to the server. You should INITIALLY have an empty DIV: [iCODE]<div id="update"></div>[/iCODE] Then when you make your ajax call, upon completion you …

Member Avatar for hielo
0
172
Member Avatar for nikc121

In your ORIGINAL code, instead of [icODE]document.quiz[/iCODE], try using [iCODE]document.[color="Green"][B]forms.[/B][/color]quiz[/iCODE] (since you have [iCODE]<form id="quiz"...>[/iCODE])

Member Avatar for Airshow
0
372
Member Avatar for samarudge

at the end of your first regex you have: [iCODE]...(\#[-a-z![COLOR="Red"]//[/COLOR]\d_]*)?$/i[/iCODE] Try escaping those slashes: [iCODE]...(\#[-a-z![COLOR="Red"]\/\/[/COLOR]\d_]*)?$/i[/iCODE] ALSO, instead of: $valid_url=[color="Red"]"[/color]...[color="Red"]"[/color]; try using apostrophes: $valid_url=[color="Red"]'[/color]...[color="Red"]'[/color];

Member Avatar for pritaeas
0
173
Member Avatar for madsy

tab is already an array. If you want to see everything as a single string then you need implode() not explode()

Member Avatar for hielo
0
572
Member Avatar for Blitz-labs.com

It's because your SELECT query failed. Instead of: [iCODE]$sql_query = mysql_query("SELECT * FROM blog WHERE MATCH(title,post) AGAINST('$search_term')");[/iCODE] try using the following you you can find out WHY the error ocurred: [iCODE] $sql_query = mysql_query("SELECT * FROM blog WHERE MATCH(title,post) AGAINST('$search_term')")[COLOR="Green"][B] or die(mysql_error())[/B][/COLOR] ;[/iCODE]

Member Avatar for Blitz-labs.com
0
304
Member Avatar for miss_indie

You need to put quote around strings - words that are NOT PHP keywords - ex: [iCODE]$remark=[COLOR="Green"]"[/COLOR]Excellent[COLOR="Green"]"[/COLOR]; [/iCODE] because [B]Excellent[/B] is NOT a php keyword. The same goes for the other remarks. also, totalg IS a variable, so you MUST prefix it with a dollar sign in every instance of …

Member Avatar for miss_indie
0
104
Member Avatar for vimal hemant

after this is executed: [CODE]$r = mysql_query("select userid from dept_user where dept_id=$dept LIMIT 0, 30 ");[/CODE] $r does NOT have the userid. It "points" to "something" (a resource) which contains the actual data from the result set (assuming some result was actually returned). What you need to do is EXTRACT …

Member Avatar for hielo
0
104
Member Avatar for MDGM

If your page contains a frame, and THAT frame contains and EXTERNAL/REMOTE page that contains the javascript that is "listening" for the "H" keypress, then you will NOT be able to rebind the event. In other words, what you are trying to do is not possible. The security restrictions imposed …

Member Avatar for Airshow
0
293
Member Avatar for dennishall

try: [CODE] <?php if ( isset($_POST['seo']) && $_POST['seo'] == 'Save' ) { foreach($_POST['title'] as $index=>$value) { $title = mysql_real_escape_string(trim($_POST['title'][$index])); $description = mysql_real_escape_string(trim($_POST['description'][$index])); $keywords = mysql_real_escape_string(trim($_POST['keywords'][$index])); $res = mysql_query("UPDATE `content_en` SET `title`='$title',`description`='$description',`keywords`='$keywords' WHERE `id`=1"); if (!$res) die("Error saving the record! Mysql said: ".mysql_error()); header("Location: home.php"); exit; } } $query = mysql_query("SELECT …

Member Avatar for dennishall
0
313
Member Avatar for miss_indie

[iCODE]...SET Fname='$a' [COLOR="Red"]AND[/COLOR] Lname='$b'[/iCODE] you need to get rid of AND. To update multiple fields, you need to separate them with a comma, NOT with the keyword [COLOR="Red"]AND[/COLOR]. Try the following: [CODE=php] <?php if( isset($_POST) && !empty($_POST) ) { mysql_connect("localhost","*****","****") or die('Could not connect:<br />' . mysql_error()); mysql_select_db("*****", $con) or …

Member Avatar for hielo
0
154
Member Avatar for newprog50

when you use [iCODE]var[/iCODE] BEFORE your variable, it make that variable "private". In other words, it will NOT be visible outside your function. Thus, the variable [iCODE]allSelect[/iCODE] in line 4 is NOT the same as the one in line 8. The [iCODE]allSelect[/iCODE] variable declared in line 8 exists ONLY WITHIN …

Member Avatar for hielo
0
145
Member Avatar for as.bhanuprakash

[QUOTE]My question is whether there is any possibility for an user to override my validation and get away with an invalid entry ?[/QUOTE] No. The expression allows exactly 10 characters, of which the first MUST be a zero and the remaining nine may be any of 1...9.

Member Avatar for as.bhanuprakash
0
125
Member Avatar for idskot

On lines 37-64, you cannot have [iCODE]$DetailsRow[/iCODE] because you have NOT queried the db. It looks like what you need is the data that was just [B]POST[/B]ed. So change [iCODE]$DetailsRow[/iCODE] to [iCODE]$_POST[/iCODE]

Member Avatar for hielo
0
149
Member Avatar for dschuett

[QUOTE] ...the down side is that I have to browse to each and every picture to select it.[/QUOTE] if you rephrase that sentence to "the down side is that I have to manually select each and every picture..." then clearly you are looking for a way to select the pictures …

Member Avatar for dschuett
0
165
Member Avatar for ruwanaru

[iCODE]...var req = new Request.JSON[/iCODE] where did you define the Request object? It looks like you forgot to "include/import/ling to" a javascript file!

Member Avatar for hielo
0
155
Member Avatar for rajeesh_rsn

[QUOTE]Works fine but I cant upload more than 3MB files using this script[/QUOTE] refer to the following: [url]http://us2.php.net/manual/en/features.file-upload.post-method.php[/url] specifically, [QUOTE]...The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted by PHP...[/QUOTE] alternatively, if you have access to your php.ini …

Member Avatar for lordspace
0
227
Member Avatar for znz

[iCODE]...echo '<a href="deleted.php?id='.[COLOR="Red"]$row['id'][/COLOR].'">Delete</a>';[/iCODE] where did [COLOR="red"]$row['id'][/COLOR] come from? a. An INSERT query does NOT return any records - NOT even the auto id of the new record. b. Even [B]IF[/B] it returned records, you would still need to retrieve the actual columns with statement such as: [CODE]<?php $row=mysql_fetch_assoc($results); ?> [/CODE] …

Member Avatar for hielo
0
186
Member Avatar for jimmiller96

Try: [CODE]SELECT Country, COUNT(*) as total FROM TABLENAME GROUP BY Country[/CODE]

Member Avatar for Brillig
0
276
Member Avatar for GigsD4X

instead of: [CODE]for (item in content) [/CODE] try: [CODE] for (var item=0,limit=content.length; item < limit; ++item) [/CODE]

Member Avatar for Taywin
0
146
Member Avatar for shancq50

The name of a database, table and/or field/column, needs to be enclosed in backticks (`), NOT apostrophes('). You incorrectly used apostrophes. Try: $select_query="SELECT * FROM `deed_records` WHERE `".$_REQUEST['select']."`='".$_REQUEST['value']."' "; Also, use [iCODE][B][color=blue]... or die( mysql_error() );[/color][/B][/iCODE] whenever you execute a query so you get details about the error (if any). …

Member Avatar for hielo
0
120
Member Avatar for amulet_john

let's say that the code you posted is for a file named getImage.php. Now on page1.php you need to show the image with id=23. All you have to do in page1.php is to put this: [CODE]<img src="http://yoursite.com/imageFetcher.php?id=23" />[/CODE] Also, since you only need the `data` field, then use [iCODE]SELECT data …

Member Avatar for hielo
0
125
Member Avatar for shipy013

Let's say that page1.php includes page2.php, but you want page2.php to NOT be accessed directly. So on page1.php you define the constant: [CODE] <?php //page1.php define('RESTRICTED',1); include('page2.php'); ... ?> [/CODE] Then in page 2 you simple check to see if the constant is defined: [CODE] <?php //page2.php if(!defined('RESTRICTED'))exit('No direct script …

Member Avatar for hielo
0
7K
Member Avatar for sajohnson05

you need to add '~' as the third argument to fgetcsv(): [CODE]<?php $namefile = 'pilots.txt'; $OUTFILE = fopen($namefile, 'r') or die("Can't open $namefile for read"); $name = fgets($OUTFILE,4096); if($OUTFILE) { while (!feof($OUTFILE)) { $row=fgetcsv($OUTFILE,1024,'~'); echo sprintf('%s %s', $row[0], $row[4]); } fclose ($OUTFILE); } ?>[/CODE]

Member Avatar for hielo
0
98
Member Avatar for webwork

[QUOTE] only to find the CSS "hover" is NOT available in IE8. I've found the hover to be very useful in calling attention to links by changing their color.[/QUOTE] Are you sure about that? The code below works fine for me. If anything, the lack of support would be in …

Member Avatar for hielo
0
307
Member Avatar for dschuett

[CODE] <!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"> <html> <head> <title>Search the Database</title> <style type="text/css"> <!-- .inactive{visibility:hidden;display:none;} --> </style> <script type="text/javascript"> <!-- function toggleOptions(sel) { if(1*sel.value==2) { document.getElementById('termSearch').className='inactive'; document.getElementById('dateSearch').className=''; } else { document.getElementById('dateSearch').className='inactive'; document.getElementById('termSearch').className=''; } } //--> </script> </head> <body> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Search: …

Member Avatar for richieking
0
3K
Member Avatar for ivan3510

it's called [B]autocomplete[/B]: [iCODE]<input type="text" [COLOR="Green"]autocomplete="off"[/COLOR] .../>[/iCODE] [url]http://www.htmlcodetutorial.com/forms/_INPUT_AUTOCOMPLETE.html[/url]

Member Avatar for ivan3510
0
97
Member Avatar for JayGeePee

perhaps the parent element of the table has the relevant setting - ex: [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <style type="text/css"> <!-- #envelope{border-bottom:1px dotted black;} --> </style> </head> <body> <div id="envelope"> <table summary=""> <tr> <td>x</td> </tr> </table> </div> </body> </html> [/CODE]

Member Avatar for jwmollman
0
57
Member Avatar for prakashsd

[QUOTE]Is anything wrong in that syntax?[/QUOTE] That depends on your php configuration file. When short_open_tag is On, then [CODE=php] <? ... ?> [/CODE] is NOT a problem, but if it is Off, then you would get runtime errors. Simply add [COLOR="Green"]php[/COLOR] to the opening tag: [CODE=php] <?php ... ?> [/CODE]

Member Avatar for hielo
0
143
Member Avatar for Rated X

your submit button has name="submit", so you should be using that in $_POST, NOT 'Calculate'. You must use the NAME of the field: WRONG: [CODE] $calculate=$_POST['Calculate']; if (isset($_POST['Calculate'])) [/CODE] CORRECT: [CODE] /* after this, $calculate should be set whatever the VALUE attribute is set to. In this case Calculate */ …

Member Avatar for Rated X
0
104
Member Avatar for Clarkeez
Member Avatar for Clarkeez
0
161
Member Avatar for divyakrishnan

If your editor supports different fonts, then change your font-family to Verdana. Otherwise copy and paste your code onto a text editor (like MS Word); highlight it all then change the font-family to Verdana. Do you see the now that p1 (p followed by number one) is NOT the same …

Member Avatar for hielo
0
156
Member Avatar for lobas

[QUOTE]...for some reason it is not reflected in the url[/QUOTE] ajax requests do NOT change the url that is currently loaded/displayed in the address bar. The requests occurs "in the background". Hence the url in address bar remains unchanged. IF it did so, then the whole page/window would reload, which …

Member Avatar for hielo
0
142
Member Avatar for iammirko

put a % symbol BEFORE and AFTER the variable name: [CODE]"SELECT * FROM members WHERE name LIKE '%$searchKey%';"[/CODE]

Member Avatar for iammirko
0
101
Member Avatar for Shaswat

Assuming you are using PHP to process your form, when you create your form give all your checkboxes the same name BUT add the following suffix "[]" -ex: [CODE=html] <form method="post" ...> <input type="checkbox" name="hobbies[]" value="Reading"/> <input type="checkbox" name="hobbies[]" value="Biking"/> <input type="checkbox" name="hobbies[]" value="Traveling"/> ... </form> [/CODE] Then when you …

Member Avatar for v srinivasa rao
0
121
Member Avatar for FreddieBambino

[CODE] <HEAD> <script type="text/javascript"> function toggleElement(sel1, element1) { element1 = document.frm1.elements[element1]; //alert(element1.value); if (sel1.value == 'others') { element1.style.display = 'inline'; } else { element1.value = ''; // input text will be empty element1.style.display = 'none'; // hide text element } return; } window.onload=function(){ toggleElement(document.getElementById('city'), 'txt1') } </script> </HEAD> <BODY> <form …

Member Avatar for hielo
0
117

The End.