- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
77 Posted Topics
Re: bad luck, told you not to bring your laptop to the bathroom | |
Re: Well, if you made a completely AJAX driven user interface, it would be possible. However, that also means that search engines cannot crawl your site. And you know what that means. | |
Re: Thanks for sharing :) | |
Re: You can save the randomly selected id to the session. That way you can keep track of the questions that have been selected, select only questions that have not yet been selected and navigate through them. | |
Re: [code=php]if(mysql_num_rows($result)==0){ //do this }[/code] | |
Re: [code=php] if (!preg_match("#^http://www\.[a-z0-9-_.]+\.[a-z]{2,4}$#i",$url)) { echo "wrong url"; } else { echo "ok"; } [/code] | |
Re: You can't do that with php alone without any external software, for example ffmpeg. | |
Re: As far as the software: [url]http://www.wampserver.com/en/index.php[/url] [url]http://sourceforge.net/projects/phpeclipse/[/url] | |
Re: Your query probably fails, try debugging: [php] $result = mysql_query ($query) or die(mysql_error()); [/php] | |
Re: all installed windows servers filled with easy pleasure | |
Re: >$mydate is just a date in the form 0000-00-00 pulled from somewhere else in my database. But it keeps spitting out "Resource id #8." That means $mydate is not what you expect. It's probably the result of mysql_query(). Use mysql_fetch_array() or mysql_result() to get the value. | |
Re: You've misplaced $item and $price definitions. $i that is used is not defined yet. Try rearranging things: [code] // Check if button name "Submit" is active, do this if($Update){ for($i=0;$i<$count;$i++){ //define each variable $item= mysql_real_escape_string($_POST['item'][$i]); $price = mysql_real_escape_string($_POST['price'][$i]); $sql1="UPDATE $table SET item='$item', price='$price' WHERE id='$id[$i]'"; $result1=mysql_query($sql1); mysql_error(); } } [/code] … | |
Re: On log in success you redirect to $session->referrer, which unlikely is the success page. Change it to the url of your success page. | |
Re: Or in php: [php] echo date('Y m d',strtotime($mysqldate)); [/php] | |
Re: You can try funpageexchange.com for your flash games site. I've had great results with them. | |
Re: Unless they provide an xml feed, you have to scrape the pages. Check out: [url=http://www.php.net/file_get_contents]file_get_contents[/url] [url=http://www.php.net/preg_match]preg_match[/url] for more details. | |
Re: The stork story just keeps me amazed. They shy away from human biology, yet they feel absolutely comfortable with telling animal abuse stories to their children. Keep your dirty fantasies to yourself, will ya. | |
Re: What makes you have $arrayimploded as "[0]"? Why not just 0 and use the function properly: [CODE=php]array_splice($arr[$arrayimploded], end($index), 1, $data);[/CODE] If you can avoid eval(), avoid it. | |
Re: See the error code in $_FILES['uploadedfile']['error'] and check it against [url]http://www.php.net/manual/en/features.file-upload.errors.php[/url] to find out what the error is. | |
Re: The best idea is not to use .* RewriteRule ^insurance/metatags-cat_id-([0-9]+)\.htm$ insurance/metatags.php?cat_id=$1 | |
| |
Re: Try disabling and enabling again the connection (Control Panel -> Network and Internet -> Network Sharing Center -> Manage Connections, select your connection and disable it, then enable again). That helps me when it decides not to work and none of the Diagnose and Repair stuff works. | |
Re: Actually it's the slash that causes trouble: [code=php] $info = ($info2['dirname'] == '\') ? "" : $info2['dirname']; $basedir = ($basedir == '\') ? '' : $basedir; [/code] | |
![]() | ![]() |
Re: Make sure you include it before you're trying to act on db and make sure you're using the correct path. The best idea is to use an absolute path (also see $_SERVER['DOCUMENT_ROOT']) | |
Re: $_SERVER['DOCUMENT_ROOT'] is not defined in IIS, check this user comment on PHP Manual: [url]http://www.php.net/manual/en/reserved.variables.php#59409[/url] | |
Re: Check the permissions; if you have the read permissions on the source file and write permissions on the destination directory. | |
Re: No, that's not the case. The session id is saved in a cookie, which is browser specific. Thus opening a new browser starts another session. The workaround would be saving the session id in a database along with an ip. That way you can pick the session by an ip, … | |
Re: [php] chdir("path/to/directory"); $files=glob("*"); foreach ($files as $file){ $result=mysql_query("select * from files where file_name='".mysql_real_escape_string($file)."'"); if(mysql_num_rows($result)==0){ echo "$file is not in use"; } } [/php] | |
Re: The trick is to set the upload path from as $_POST['path'] instead of a fixed one: [php] $replace=array("../","./",";"); $path=str_replace($replace,"",$_POST['path']); move_uploaded_file($_FILES['file']['tmp_name'],$path."/".$_FILES['file']['name']); [/php] If you need to dynamically load the directories to select, check out [url=http://www.php.net/glob]glob()[/url]. | |
Re: You have echo "t"; which causes header() not to work, thus no redirect occurs (plus warning should be issued, you'd see it if you had error reporting on). Also, are you trying to pass $_POST['redirect'] to another page? That won't work, $_POST is available only in the page the form … | |
Re: You may also wanna check out: [url]http://www.php.net/manual/en/function.number-format.php[/url] | |
Re: The owner of the directory should be php, not apache. Also: [php] if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "File". basename($_FILES['uploadedfile'] ['name']). "uploaded succesfully"; } else { echo "An error occured. Error code: ".$_FILES['uploadedfile']['error']; } [/php] And check the code against [url]http://www.php.net/manual/en/features.file-upload.errors.php[/url] | |
Re: Here's the idea: [php] $id=(int)$_GET['id']; mysql_query("UPDATE walls SET wall_views=wall_views+1 WHERE id=$id"); [/php] | |
Re: Since the unchecked checkboxes are not submitted to php, you loose the index of the selected row. So for example if you select a single row, the index will always be 0, no matter which row is that. You need to specify the index explicitly: [code]<input type=\"checkbox\" name=\"choice[$i]\" value=\"A001\">[/code] Be … | |
Re: Might be the current working directory issue. Try specifying absolute path when copying the uploaded file. | |
Re: [QUOTE=crazynp;307329][code]if empty($_POST['question1']){ die(" Please Select an option."); } else{ .....process the form } [/code] [/quote] You've got a syntax error there. [code=php]if (empty($_POST['question1'])) { die(" Please Select an option."); } else{ //.....process the form } [/code] Off topic: Use your signature for links to your site. The mods may be … | |
Re: [quote=wikipedia] Unicode is an industry standard designed to allow text and symbols from all of the writing systems of the world to be consistently represented and manipulated by computers. [url=http://en.wikipedia.org/wiki/Unicode][*][/url] [/quote] To give you a real life example, utf-8 is usually used to encode the data in xml documents. In … | |
Re: If you tried to debug it: [php] $query = mysql_query("SELECT * FROM $user_table WHERE userid=$id") or die(mysql_error()); [/php] You'd probably get the error in sql query syntax. Most likely becaues $id is not defined unless it is in one of the above includes, which I doubt. You're probably trying to … | |
Re: Assuming the generated page is stored in a variable $page: [code=php] echo '<textarea name="source">'.htmlspecialchars($page).'</textarea>'; [/code] | |
Re: What's the code for validation? Can you post it here? | |
Re: There's sendmail_from setting in php.ini, but it's only used on Windows. | |
Re: The easiest way is using database to store the last form submit time by an IP. Here's the idea: [code] create table timer( ip varchar(255), timestamp int ) [/code] [php] $ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $time=time(); $timeout=time()-5*60; mysql_query("DELETE FROM timer WHERE timestamp<$time"); $r=mysql_query("SELECT * FROM timer WHERE ip='$ip'"); if(mysql_num_rows($r)>0) { die("You've already submitted this … | |
Re: As the warning suggests, use ini_set(): [php] ini_set("smtp_port","25"); [/php] change the port to required. | |
Re: [QUOTE=egoleo;156769]Thank you all for ur help. But i did this and is still not working. HTML CODE ......... <form action="testcheckbox.php" method="POST" name="form1"> <p>Name : <input type="text" name="textfield"> </p> <p>Course: <input type="text" name="textfield"> </p> <p>Tel No: <input type="text" name="textfield"> </p> <p> <input type="checkbox" name="cd[]" value="¢20"> JAVA<br> <input type="checkbox" name="cd[]" value="¢30"> PERL<br> … |
The End.