- Strength to Increase Rep
- +13
- Strength to Decrease Rep
- -3
- Upvotes Received
- 91
- Posts with Upvotes
- 77
- Upvoting Members
- 60
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
708 Posted Topics
Re: If you are trying to stop users from manipulating the url, you can use a csm of the url to validate it. I have been using this method for years, to prevent people from changing the id in a url to edit a record that they shouldn't be editing (I … | |
Re: Yes. Everything you need can be found using google. I have answered several similar questions on daniweb so make sure you search the site as well. | |
Re: ok sounds pretty easy. how do you want the images displayed on the page? in a table? | |
Re: Here is one I made last Saturday for a current project of mine. This one allows for a lot of control over how its displayed. [code=php] <?php class calendar { private $time = null; private $adjusted_time = null; private $select_date = array(); private $current_date = array(); private $last_day = null; … ![]() | |
Re: Depends on the gateway you want to use. Which one are you talking about? | |
Re: you need to use a constuctor [code] <?php class test { var $name = array(); //this function used to make class PHP4 compatible function test() { $this->__construct(); } function __construct() { $this->name = array('john','jenny'); } function getName() { return $this->name; } } ?> [/code] | |
Re: You could try this: [code] <?php if ( isset( $_POST['submit'] ) ) { //Check if form was submitted $name = 'image'; $allowed_extns = array('jpg','jpeg','gif','png'); if ( !isset( $_FILES[$name] ) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK || empty( $_FILES[$name]['name'] ) ) { echo 'Please choose a file to upload'; //File was not uploaded … | |
Re: Here is a login system example I created awhile ago: [url]http://www.daniweb.com/forums/post832028-20.html[/url] and [url]http://www.daniweb.com/forums/post832231-23.html[/url] See if that helps you. Its secure and a good script to learn from. | |
Re: Not possible without a third party (unless you own your own wireless company with their own network) | |
Re: Code is usually helpful. Post some and we should be able to help. | |
Re: Use: [code] echo $_POST['security1']; [/code] and get rid of the or die() statement as that is not how its suppose to be used. Don't use: [code] if ($_POST['security1']) { [/code] You need to use isset() otherwise you will get errors. | |
Re: how exactly is the manual set up. Is it a webpage; is it seperate document, what? can you give me link to it so i can see what we're working with? | |
Re: I recommend a prebuilt library for that. Trying to setup the headers yourself, which will work across many different mail servers and clients is not easy. You could try PHPMailer or Swiftmailer. There are plenty of libraries that will make this easy to do. | |
Re: that doesn't do anything. php is putting that to the browser, not the javascript. view the source of the page. there will be nothing in the write function of the javascript. how about you accept the truth. its how php works. you would think if that was possible you wouldn't … | |
Re: sometimes i found that the form will submit the field with nothing and add it to post array. you need to check and make sure the username is also not empty. you can do this by comparing it to an empty string or use the empty() function. example: [code] if … | |
I recently applied for a PHP programming job and they required me to do a coding challenge. One of the challenges involved simulating the card game war which I found intriguing. I "over-engineered" it as they requested, but I still don't think it was good enough for them. Is there … | |
Re: You need to add your functions parameters to the function in the interface. [code] interface db { public function connect($server,$username,$pasword); public function close(); public function error(); } [/code] | |
Re: Please at least google your question before posting here. [url]http://www.google.com/#hl=en&q=create+folder+with+php&btnG=Google+Search&aq=f&oq=create+folder+with+php&fp=OlAWEoQSgPM[/url] mkdir() is the function you are looking for. | |
Re: A playlist of Breaking Benjamin, Stone Sour, Sevendust, Three Days Grace, and some T-Pain to change it up. | |
Re: Date formats of the date() function need to be wrapped in quotes: `$blah = date('m-d-Y');` | |
Re: What version of php are you using? Also what have you changed in the script, because what you have there is not the same as the files I downloaded for the site you just gave. | |
Re: Use `if ( isset( $_POST['submit'] ) ) {` | |
Re: The only way to get them to work together is to copy exactly how joomla hashes their password. I would say, find the JUserHelper class and look how the getCryptedPassword function is working. | |
Re: Is that javascript? If so, then I don't think there is much of a difference. I personally use `var blah = [];` to define an array. | |
Re: The best way to handle this is by processing the payment on your website directly. If you have to use an external payment gateway, the best way to handle that would be to create the reservation before sending them to the payment gateway. After they complete the payment, using a … | |
Re: Something basic I just wrote: <?php $data = file_get_contents('url here'); $lines = explode( '<br />',$data ); foreach( $lines as $line ) { $line = explode( '|',$line ); $datum = array(); foreach( $line as $part ) { list( $key,$value ) = explode( '=',$part,2 ); $datum[$key] = $value; } //insert query here … ![]() | |
Re: If you wanting to allow some html I recommend the HTML Purifier library. Kind of bulky but does the job. The other way to prevent it from breaking your site, is to run the text through htmlentities so it will display as text no matter what. | |
Re: Is this a homework assignment? If so, we will not just give you the answer. I will, however, help you find the answer yourself. You will need the functions range(), shuffle(), and sort(). Look these up on php.net. | |
Re: Looks good. The only things I would add is caching and css/js minification for faster loading times. I implemented this into my framework a few years ago and it has worked quite well. Makes debugging a little harder but worth it. | |
Re: Shouldn't `/(?!=` at the beginning be `/(?!`? Not a regular expression expert, but I don't remember the != together. Haven't used lookarounds in awhile. | |
Re: Do you have this code online where I can look at the source. Due to formatting issues, the code you posted is very hard to read, which is making it hard to help solve the problem. As an alternative, could you attach the source code? | |
Re: There is a typo in the update query inside the while loop. imprssions should be impressions. | |
Re: In my experience `is_null` doesn't work for values pulled from a database. MySQL null is not equivelent to PHP null. Null column values come across as an empty string so checking it against an empty string like below should help you out: if ( $row['photo'] !== '' ) { //image … | |
Re: I would use the short hand if statement: `$page = ( isset( $_GET['page'] ) && is_numeric( $_GET['page'] ) ? (int) $_GET['page'] : 1 );` to keep it short and not feel dirty. | |
Re: Do you have `session_start();` at the beginning of your script on every page the session data is needed? | |
Re: You are running into scope issues. Variables created in a anonymous function are not available outside the function unless they are defined first outside the function (which defeats the purpose of what you are trying to do). Try this maybe: for( key in map ) { eval('var ' + key … | |
Re: Pretty much mysql_real_escape_string() is all you need. | |
Re: Why are you using javascript to redirect? Just use [icode]header('Location: http://somesite.com/page.html');[/icode]. You can use a relative url as well. Make sure you have nothing being echoed to the browser before calling that. If you are still getting an internal server error, post more code because that function will not cause … | |
Re: No, that does not seem possible. But I might not be understanding your question well enough. To handle hotlinking: The way I have seen this done and actually done myself a few times is to have a php script handle all image requests. You have php check for the referrer … | |
Re: I have ran into this problem and I solve it by using php to handle this. Pretty much you send the entire url to a php page in a url variable. Ex. [code] RewriteRule ^(.*)$ your_page.php?_url_=$1 [/code] Then with php you get the data and parse it yourself. [code] if … | |
Re: This is a regular expression that will match the 111 (111) 1112 number in the string. You can modify it to work with others. [code] $string = 'Phone 111 (111) 1112 to get this for 75% off - Call Now. Offer open to 5pm only full price after 5.'; if … | |
Re: To do this in a simple manner: [code=php] if ( isset( $_GET['letter'] ) ) { $query = mysql_query("SELECT `name` FROM `users` WHERE `name` LIKE '" . mysql_real_escape_string( strtoupper( $_GET['letter'] ) ) . "%'"); //do what you want with query result } [/code] | |
Re: Cookies cannot be used for security purposes like you mentioned. Those are out of the question. Why can't these sites just be subdomains of the same domain? This would solve your problem. The only way to really do this is with the url. This is really insecure, but there are … | |
Re: I would do this: [code=php] $query = mysql_query('SELECT `email`,COUNT(`email`) AS `count` FROM `table` GROUP BY `email`'); if ( mysql_num_rows( $query ) > 0 ) { while( list( $email,$count ) = mysql_fetch_row( $query ) ) { echo "{$email} has {$count} occurrences<br />"; } } [/code] | |
Re: [code] RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^example6/([^/]+)$ example6.php?id=$1 [L] [/code] Does that work? Haven't tested it so I might of forgotten something. Just wrote it from memory. | |
Re: Remove the error suppression (@) from the mail function on line 98. After this, run a test and see if you get any errors. If the above didn't help, try putting this at the top of your code: [code=php] error_reporting(-1); ini_set('display_errors','On'); [/code] and let us know what comes up. | |
Re: I would store just an id in the session. Storing info in a session causes some problems, especially when debugging. For example you store the users information in a session, but they update it. Now you have to modify the session and the database. This next example comes from a … | |
Re: why not just use implode [code] $styles = implode( ',',$_POST['work_style'] ); [/code] | |
Re: session_register and session_is_registered are depreciated. use the $_SESSION array instead. md5 isn't secure anymore. you should use something like sha1 with a random salt. | |
![]() | Re: did you set an out parameter on the procedure? |
The End.