516 Posted Topics
Re: Sounds like you need to put single quotes around the x: [code=php] $x = escapeshellarg( $_GET['x'] ); [/code] | |
Re: Your probably not previewing the file via through the server. What testing server are you using? Make sure your url is something like with [url]http://localhost/filename.php[/url]. Where filename.php is your file. Also make sure the file is saved in your htdocs folder. | |
| |
Re: This is a common problem, as text is so small. There is very little area to define where the mousover stops and the mouseout starts. So the display constantly toggles as the mouse wont sit perfectly still. In Flash, this is often cured by creating an invisible box to place … | |
Re: Well are you trying to compare the value of $lengths[2] to 25 or set $lengths[2] equal to 25? [code=php] if ($lengths[2] = 25) { [/code] This code is resetting the value of $lengths[2] to 25 and will result in the if statement being true every time. If you want to … | |
Re: Use the exec function. [url]http://us2.php.net/function.exec[/url] | |
Re: You could include it as a client or server side include. Are you wanting to call it before, during, or after the page is loaded? | |
Re: PayPal provides Instant Payment Notification (IPN). [url]https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/ipn-intro-outside&[/url] They have a demo on the site to show how it works. Once PayPal sends the server a verified status, you can enable the button. | |
Re: PHP variables are case sensitive. [icode]$Othernames[/icode] is not the same as [icode]$OtherNames[/icode] and [icode]$dateofbirth[/icode] is not the same as [icode]$Dateofbirth[/icode]. There are also some syntax issues. So [code=php]if mail'('$Surname, $Othernames, $dateofbirth, $age, $sex')' [/code] should be [code=php]if(mail($Surname, $OtherNames, $Dateofbirth, $age, $sex)) [/code] Also, please surround your code with [noparse][code=php]php code … | |
Re: You need to integrate a server side language such as php/asp/jsp/coldfusion to automatically update the database. You shouldn't be creating a new page for each user. You should have one template filled with variables that are populated by the database. | |
Re: I believe you'll need to use the complete host information:[code=php] $fp = fsockopen("alertbox.in", 80); [/code] should be [code=php] $fp = fsockopen($host, 80); [/code] | |
Re: If you want to lower the file size, make it web accessible, and add a preloader, convert the ppt to flash. If your not familiar with Flash, just Google [URL="http://www.google.com/search?q=powerpoint+to+flash"]powerpoint to flash[/URL]. | |
Re: Try: [code=php] <?php $file=".htaccess"; $fp=fopen($file, "a"); $text ="\r\nRewriteEngine on \r\nRewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]"; fwrite($fp, $text); fclose($fp); ?> [/code] | |
Re: You could use str_replace function to replace "//" with "/". [code=php] $uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/'; $uploadsDirectory = str_replace("//","/",$uploadsDirectory); [/code] There are many other ways of fixing the problem. str_replace just seems the easiest to me. | |
Re: Look into using sessions for authentication. Basically the idea is: [code=php] <?php session_start(); if($_SESSION['loggedIn']==true){ echo "This content will only be viewable for users who are logged in"; } else{ echo "You are not logged in"; }?>[/code] | |
Re: PayPal. You only want to sell 3 products right? | |
Re: Your javascript is really overkill. You have 3 functions that could be condensed into one. Also, the 3 divs, Des_pic1-3, could be condensed since only one is displayed at a time. All of these things would also help condense the css. | |
Re: You'll want to format the date back prior to doing the insert. So, in the script you use to process the form data, use strtotime to convert the string to a timestamp. Then insert the data. | |
Re: How is the cart stored? Browser cookies? A session on the server? | |
Re: Can you not set the field to auto-increment in the database? | |
Re: If the user_id data type is numeric, then it won't need single quotes in the sql. [code=php] $sql = mysql_query("INSERT INTO shoutbox (index, user_id, username, message) VALUES(' ', $user_id, '$username', '$message')"); [/code] This could also apply to the index, however since you are inserting an empty value, I would assume … | |
![]() | Re: You could start off with basic data validation. Pumping all of the fields into the db without checking even one of them? That's just asking for injection. ![]() |
Re: Are you asking how to make a social networking site? | |
Re: What about something like:[code=php]<?php function makeBold($var){ return (ereg_replace("[a|b]+[a-z]+[a-z]","<b>\\0</b>",$var)); } $row = "You are the best"; echo makeBold($row); ?> [/code] Outputs: You <b>are</b> the <b>best</b> | |
Re: Post in the appropriate forum. This is not a php issue. If it were, the calendar wouldn't work on any browser. | |
Re: Also, if you have phpmyadmin, you can just upload the csv instead of writing a script. | |
Re: [icode]if($uid=$_GET['u'] && $pid=$_GET['p'] && $t=$_GET['ti'] && $type=$_GET['typ'])[/icode] You are setting values instead of comparing them. To compare, use [icode]if($uid==$_GET['u'] && $pid==$_GET['p'] && $t==$_GET['ti'] && $type==$_GET['typ'])[/icode] | |
Re: Yeah, you don't want to prevent a page refresh. That takes quite a bit of JavaScript and quite frankly would annoy users. They don't want you to change their browsers behavior. Fix your code logic. Don't mess with browser hacks. | |
Re: [code=php] <?php $oldDate="2007-06-26"; $newDate=date("m-d-Y",strtotime($oldDate)); echo $newDate; ?> [/code] outputs: 06-26-2007 For more info, see the php date manual: [url]http://us3.php.net/date[/url] | |
Re: Set a field called verified in the database with a default value of 0 or False. Then after admin verifies, have him/her set the value to 1 or True. | |
Re: Try the CFFormProtect: [url]http://cfformprotect.riaforge.org/[/url] | |
Re: The border-radius attribute isn't yet supported by many browsers, like IE. I would recommend using FireWorks or Photoshop to make your buttons, since border-radius is only supported by Firefox, Safari, and a few others. | |
Re: Fireworks is for making vector graphics to be used in web pages. It has a lot of default styles to use for fast creation of custom dropdowns, buttons, and navigation bars. All of the neat little graphics found on DaniWeb can be created using FireWorks. If you use Firefox, right … | |
Re: Set $theHash equal to empy before the for loop. Also, I think you'll want to poulate $theHash like this:[code=php] $theHash=""; for($i=0;$i<strlen($theMD5);$i++) { $tmp1 = ord($theMD5[$i]) / 16; $tmp2 = ord($theMD5[$i]) % 16; $theHash.= $hexArr[$tmp1] . $hexArr[$tmp2]; }[/code] | |
Re: Why do you need AJAX for this? [QUOTE]Once the next page has loaded, display that variable using GET[/QUOTE] AJAX is typically used to perform functions without a page load. If the page is going to load anyway, it would be much simpler just to use a server side script. [QUOTE]I'd … | |
Re: Please wrap your code in code tags: [noparse][code=html] Put code here[/code][/noparse] | |
Re: For starters, <php is not a valid delimiter. Use <?php to start the code and ?> to end it. Is Apache and php configured correctly? Have you tried a simple [icode]<?php echo "It works.";?>[/icode] type script to test the server? | |
Re: [url]http://www.atksolutions.com/articles/install_php_mysql_iis.html[/url] | |
Re: Looks like manish.s beat me too it. Just remember that your checkbox group is an array, and they have to be extracted with a loop. Also, a radio button may be better for the service if you only want one possible value. | |
Re: Have you tried using a header? [code=php]header('Location:index.php'); [/code] This will only work if nothing has been outputted to the client yet. | |
Re: Do the customers know you are storing there credit card numbers? Do the credit card companies know about this? I think that both parties would have a problem with you storing this information without their knowing and without you having the proper security credentials. | |
Re: [code=php]<?php $page = file_get_contents('http://www.google.com'); $num = md5(uniqid()); $filename = $num; $filename .=".html"; $handle=fopen($filename,"x+"); fwrite($handle,$page); ?>[/code] | |
Re: Yes the http.conf shouldn't have to be modified for simple read and write of text files. The http.conf is more used for things like enabling advanced functions like mod_rewrite that aren't normally enabled by default. Look into [URL="http://us.php.net/fopen"]fopen[/URL], [URL="http://us.php.net/manual/en/function.fwrite.php"]fwrite[/URL], and [URL="http://us.php.net/manual/en/function.fread.php"]fread[/URL]. Also if you run into trouble, DaniWeb has one … ![]() | |
Re: Apache is normally not configured to parse a .inc file so, if a user views the file, the source code will be revealed as plain text. However, if the users views the php file, the server will parse everything and the user will only see html. | |
Re: You could also cleanse the complete post array: [code=php] <?php @extract($_POST); foreach($_POST as $key => $value){ mysql_real_escape_string($value); } //now do specific cleansing and insert query [/code] | |
Re: Yes, just open the db and save as .mdb. Then modify the DSN to reflect the changes. | |
Re: Here you go: [code=javascript] <script type="text/javascript"> function validator(){ var valid = true; if (document.form1.textMessage.value=='') { document.getElementById('tobeVisible').style.visibility='visible'; valid=false; } return valid; } </script> [/code] | |
Re: Your code is a complete mess. You're trying to echo static html and it doesn't have any <?php delimiters. The delimiters tell the server which parts of the code to parse. Without them, all of your code gets delivered to the browser without being parsed in plain text. You are … | |
Re: Use php strtotime() function on the $fridate variable prior to the insert. [url]http://us3.php.net/strtotime[/url] |
The End.