546 Posted Topics
Re: Set the proper height to DIV. #comment {height: 300px; overflow: auto} Will show scroll bar when the content overflow of parent (i.e, more than 300px height). | |
Re: What's the problem ? The above PHP codes are not working or are you getting errors? Showing your entire codes could not help us to says where the problem is. You should just posted the part of the code what you think that it might not work. | |
Re: I'm not clear what you're saying. You want to show the country flag when the country was changed ? Can't it be done with Javascript or jQuery with 'onchange' event to that country selector ? Your question rarely related with the client-side, not server-side. | |
Re: Use **mysql_real_escape()** function to filter the input rather than str_replace(). Or use [PDO](http://php.net/manual/en/book.pdo.php). | |
Re: Probably, you may have **XMLHTTPRequest** problem. Are you sure **crearXMLHttpRequest()** works on IE and you get new **XMLHTTPRequest** ? Should try what @pritaeas said. | |
Re: Remove your previous Apache installation is better. Otherwise, you may have port conflict which XAMPP/WAMPP use port 80 for HTTP and your previous Apache service also. So, uninstall your previous Apache and install XAMPP/WAMPP package. They already built-in with PHP, Apache, MySQL, FTP and so on. Note that if your … | |
Re: Which "**index.php**" are you referring ? Admin "**index.php**" or front-end "**index.php**" ? You should check [here](http://codex.wordpress.org/Function_Reference) first. | |
Re: **issset()** don't check for null. It just check the variable has already set or not. If the variable already defined or set, it return true, and return false otherwise. Your code will always work every time the form has submitted, because it just send empty value (it is not null) … | |
Re: You must use HEADER with proper MIME type to prompt the download immediately when you click the download button. The above @tyson567 methods just send you the new page where the image located, it'll not prompt you to download the image when you reached that page. [Here](http://www.apptools.com/phptools/force-download.php) is the example … | |
Re: What mean "**I mean it looks good, but It's erroring up...?**" You don't even check your code that it does work or not ? Post what you're trying with that codes and what problem you're getting. | |
Re: > SELECT **contact_financial_invoiceamount-contact_financial_payment** AS outstanding You must be missing comma between each field names which was bold. You should separate the query string and function. Here is readable format and less errors. > $sql = "SELECT contact_financial_invoice, amount-contact, financial_payment AS outstanding FROM contacts WHERE contact_id = ".$_GET['id']; > $result = … ![]() | |
Re: foreach ($_POST as $key => $value) { echo $value; } What's still wrong ? The above method should work. | |
Re: Post the error what you're getting. Actually, you need web server and MySQL for installing Magneto. | |
Re: Only submit button should be identified for one form. No matter how much submit buttons are you using within the same form, they've only submission of that form. Try what @Glider Pilot mentioned above. | |
Re: We need further information. Also, it is better if you have well-known about DOM for complete this case. | |
Re: Check [URL="http://php.net/manual/en/function.mail.php"]here[/URL]. | |
Re: You're using POST method, not GET. How you receive that "action" $_GET['action'] will not get any value from the form. It should be $_POST['action']; | |
Re: [CODE]<?php mysql_connect("localhost", "root", "test") or die(mysql_error()); echo "Connected to MySQL<br />"; mysql_select_db("testdb") or die(mysql_error()); ?> <?php @$username = $_POST['name']; @$country = $_POST['country']; ?>[/CODE] Put this in form.php, remove [B]include(form.php)[/B] and try. If you want to show the form again. Redirect to that page when the INSERT finished with custom message, … | |
Re: There is no one who write the code for you. Post what you've and what you got. We'll point you the correct way. | |
Re: Why you're trying to pass the value as function argument. If you know the ID of the field, then, you can easily get the value within the function. Example: [code] function goNow(){ var input = document.getElementById('theName').value; // do your statement } [/code] Binding event that function without argument [B]onClick="goNow()"[/B] It … | |
Re: I've no idea, how you're going to be complex to the easy one. If you've configuration like such. Then, you can simply change their value directly in that file as @ardav mentioned. | |
![]() | Re: [B][COLOR="Red"]datatype[/COLOR]: 'json',[/B] should be [B]dataType[/B] |
Re: If the problem solved, then mark as [B]Solved[/B]. | |
Re: [code] function verify(){ var image = new Image(); if(!document.getElementById('jim1').value().match('/[0-9]/')){ image.src = 'path/success-image.gif'; document.getElementById('jim3').appendChild(image); } else{ image.src = 'path/error-image.gif'; document.getElementById('jim3').appendChild(image); alert('Error !'); } return false; // this line will prevent the form submitted } [/code] Attach the above function to your button with onclick event. Note that it was not tested … | |
Re: [CODE=php]<?php phpinfo(); ?>[/CODE] What does it return ? Also, don't put the bracket with [B]echo[/B] statement. [code=php] <?php echo "Hello"; ?> [/code] It should be. | |
Re: @vaultdweller123, if you're W3Schools fun. Then, check this [URL="http://w3fools.com/"]http://w3fools.com/[/URL] @rubai, you should go to [URL="http://www.php.net/manual/en/index.php"]php.net[/URL] from novice to pro. | |
Re: [CODE=php]if(!function_exists('render')){ //put your render function function render(){ } }[/CODE] Try above. Anyway, what is the PHP version ? And check the system requirements for Drupal 7.12 to ensure it is compatible with your PHP version. | |
Re: You need to wrap FORM. Otherwise, use GET method to pass those values with ((param1=value1¶m2=value2) separating ampersand between them) via URL to the page you want to process. Then, you can retrieve $_GET['param1'], $_GET['param2']. But, this is stupid method and you need to do some javascript tricks. It is non-sense … | |
![]() | Re: [B]mysql_fetch_assoc($w3db)[/B], change [B][COLOR="Red"]$w3db[/COLOR] [/B] to [B]$w3[/B] or use @ardav method. It is better way. |
Re: Post your codes. We can't find the problem and help you without seeing any codes. | |
Re: Vibhadevit is right. You must use array to store for multiple checkbox values those are coming by one group. If so, you must repeat the query to retrieve the multiple values and enter to database. Vibhadevit has shown the pretty explaining with example above. If not separate the group with … | |
Re: You might have wrong db structure. Separate the user table and order table. User table should has ID numbers, names and ordered. Also, order table should has ID numbers, names and quantities. For example, if one user click cheese to order, then update the ordered field (insert the ID number … | |
Re: [CODE][B]$qtyProd= $_POST['qtySelectProd'];[/B][/CODE] - Where is [B]qtySelectProd[/B] in the form ? I don't see that field in the form. - [B]qtySelectSer[/B], you have only [B]qty[/B] value [B]qtySelectSer[/B], check your HTML option value within the loop. [QUOTE]for ($n=0; $n<11; $n++){ echo "<option value=[B][COLOR="Red"]qty[/COLOR][/B]>".$n."</option>"; }[/QUOTE] ![]() | |
Re: Check [URL="http://www.php.net/manual/en/timezones.africa.php"]this[/URL]. ![]() | |
Re: Try this: [code=php] if(isset($_POST['firstName'] && $_POST['lastName'])) { $text=$_POST['firstName']." ".$_POST['lastName']; $to="anubhavjhalani09@gmail.com"; $subject="Message from php"; //data insert into database $sql="INSERT INTO entries (contents) VALUES ('$text')"; echo $text; } [/code] | |
Re: [B]select * from [COLOR="Red"]emp1[/COLOR][/B], make sure that table name is correct, emp with 1 or l ? | |
Re: Are you concatenating the string ? I'm not sure what's before of the string you posted above. If you've already used echo for the above line, [B]echo "selected"[/B] was the problem. You cannot use [B]echo[/B] within echo function. Try with below: [code=php] if(trim($_POST['ctype2'])=="C") "selected='selected'" [/code] | |
Re: Did you include db_connection.inc file into db_connect.inc ? Perhaps, like below: [code=php] <?php include('db_connection.inc'); function db_connect () { include'db_connection.inc'; $dbh = new PDO("mysql:host=127.0.0.1;$database", $user, $password); return ($dbh); } ?> [/code] | |
Re: Try this: [code=php] <?php if (isset($_SESSION['uid']) && $_SESSION['uid']) { echo "You are already logged in, if you wish to log out, please <a href=\"./logout.php\">click here</a>!\n"; } else { if (isset($_POST['submit'])) { $user = (isset($_POST['username'])) ? $_POST['username'] : ''; $pass = (isset($_POST['password'])) ? $_POST['password'] : ''; if($user != '' && $pass … | |
Re: Here is example: [code] <html> <head> <title>What db is it going to ?</title> </head> <body> <?php if(isset($_POST['submit'])){ $name = $_POST['Exaxmple']; echo "<p>It is going to database <b>db_".$name."</b></p>"; } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="hidden" name="Example"> <input type="submit" value="What db is it going to?" name="submit" /> </form> </body> … | |
Re: First, check your mysql server is running or not like @ardav mentioned? Second, how are you using mysql_connect() function in your php? mysql_connect() needs three arguments (host, username, password). Check the above facts and post again if your problem still keep going. | |
Re: [CODE][B]action="<?php echo $_SERVER['SCRIPT_NAME'];?>[/B][/CODE] From action is wrong. $_SERVER['SCRIPT_NAME'] returns the current file name with system path, not URL. Should use '$_SERVER['PHP_SELF']' or '$_SERVER['REQUEST_URI']'. And this one should be better for error message. [code=php] if (isset($err) && $err != '') { echo "<strong>Form Error(s)</strong><br/>"; echo "<font color='#cc3300'>". nl2br($err). "</font><br/>"; } ?> … | |
Re: Try this: [code] <? if (isset($_POST['Submit'])){ $fd = fopen ($form_data, "r"); while(!feof($fd)) { $line = fgets($fd); list($data[$counter]->name, $data[$counter]->pass) = explode(',', $line); $counter++; } fclose ($fd); foreach($data as $user) { $sql = "INSERT INTO `table_name` (`field_1`, `field_2`) VALUES('$user->name', '$user->pass')"; mysql_query($sql) or die('Cannot insert the data. Error: ' . mysql_error()); } } … | |
Re: [code] <?php if($confirmation != '' || $confirmation != null) : ?> <?php echo $confirmation; ?><br/> <?php endif; ?> [/code] You can try like above perhaps. | |
Re: First of all, put the parameter 'error=1' to line 26 header("Location: http://localhost/php_template2/index.php?error=1"); And, index.php $error = isset($_GET['error']) ? $_GET['error'] : ''; if($error) { echo 'Failed login ! Try again...'; } Put the above code any place you like to display. You can specify the error type with array format. $error_message … |
The End.