- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 10
- Posts with Upvotes
- 10
- Upvoting Members
- 9
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Someone who's learning as he goes along
- Interests
- Fingerstyle Guitar, Anime, Movies, Video Games
127 Posted Topics
Re: okay... thanks for the tutorial? ![]() | |
Re: hmm... to replace all white space and special characters you could do something like this [CODE] //removes everything except letters preg_replace( '~[^a-zA-Z]~', '', $str ); //removes white space only str_replace(' ', '', $str); //specfic characters like . and ! remember to escape it preg_replace( '~[\.!]~', '', $str ); [/CODE] | |
Re: I had a similar problem due to weird characters, make sure that every character in your password is correct. | |
Re: by doing a google search [CODE] function getDocHeight() { var D = document; return Math.max( Math.max(D.body.scrollHeight, D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight) ); } console.log(getDocHeight()); [/CODE] | |
Re: Depending on your html form you use to update. If you have a drop down with all the category names and ids you could just do a simple insert. ex: [CODE] //assuming $_POST['category'] as the category ID $query = "INSERT INTO products (prodName, categoryID) VALUES ( '{$_POST['prodName']}', '{$_POST['category']}' )"; //else … | |
Re: [CODE] <html> <head> <link rel="stylesheet" type="text/css" href="fh.css" /> </head> <body> <?php if (isset($_POST['user']) && isset($_POST['pass'])) { $user=""; $pass=""; // this variable is anything you enter in the uname and password fields $user=$_POST['user']; $pass=$_POST['pass']; // authenticate if (($user=="Enter") && ($pass=="12345")) echo "Access Granted"; else die("Access Denied"); } ?> <form action='forms.php' method='post'> … | |
Re: I'm still a little bit unsure as to what exactly you want to do but I'll try to help. Are you passing the the ending time directly into the javascript function? You could just display all the timers first but hide it with css and have the javascript show the … ![]() | |
Re: the problem lies with your query. You only have 3 fields specified but 4 values. it should be something like this [CODE] INSERT INTO blog (title, specialization, message, user) VALUES (%s, %s, %s, ".$_SESSION['MM_Username'].") [/CODE] I'm not sure what the field is for but replace user with what ever field … | |
Re: That just moves the uploaded files to the upload folder, it doesn't record anything to the database, at least not with the code you presented. | |
Re: what is this part for? [CODE]var col = $(this).parent().children().index($(this));[/CODE] looks like you are trying to get the same td again which ultimately is $(this). [CODE] $('td').click(function(){ //$(this) would be the clicked td. }); [/CODE] | |
Re: [url]http://phpmaster.com/[/url] has alot of sweet articles [url]http://phpro.org/[/url] is where I learnt most of the advance stuff in PHP | |
![]() | Re: since ALL fields are required it would be best to validate it with javascript but still have PHP validate just in case the user has javascript turned off. The way you are validating right now is valid but don't forget to sanitize it. since ALL fields are required you could … |
Re: try this query [CODE] $sqlGetLoginCode="SELECT lastLogin FROM usersLoginHistory WHERE userId=".mysql_insert_id()." ORDER BY id DESC LIMIT 1"; [/CODE] | |
Re: either echo the url into an image tag or do a file_get_contents() on the image, send the correct headers to display an image and than echo it. | |
Re: could you try using taget="_BLANK" in your link? ![]() | |
Re: protected values can only be accessed by the class or any class that extends. [CODE] class foo{ protected $value = 'test'; //only this class can call privates ^_^ private $val2 = 'hohoho'; public function getVal () { return $this->value; } } class bar extends foo{ public function getFooVal(){ return $this->value; … ![]() | |
Re: I'm guessing you are saving the image as a blob in the database and outputting it with image headers()? Personally I haven't done this before but here's my 2 cents. [CODE] $url= 'imageFile.php'; $img = 'your/desired/folder/image.jpg'; //note: allow_url_fopen has to be true if you are entering a url file_put_contents($img, file_get_contents($url)); … | |
Re: Which part of the code are you having problems in? Don't just post your entire code at first, just snippets of parts that have errors or parts you can't figure out. If you just want to put text in an element after you calculate the sub total just use .innerHTML | |
Re: [CODE] $class = 'otherRow'; echo '<ul>'; while($info = mysql_fetch_array( $data )) { if ($class == 'otherRow') $class = ''; else $class = 'otherRow'; echo "<li class='$class'></li>"; } echo '</ul>'; [/CODE] | |
Re: So essentially this is more of a permissions issue? If that's the case having your database store permissions is probably the best way to go. Have a database table for users and roles. The roles table will most likely contain the permission's level and will be the reference table for … | |
Re: here ya go [CODE] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Actor insert form</title> </head> <body> <form name="ActorForm" action="Actor_Insert.php" onSubmit="return valForm()" method="post"> Person ID: <input type="text" name="actorid" /> Required<br /> <input type="radio" name="actorgender" value="male" /> Male<br /> <input type="radio" name="actorgender" value="female" /> Female<br /> First Name: <input type="text" name="actorfname" /><br … | |
Re: the session will throw an error if there is content being outputted before it get's started, try putting the session on the first line. | |
Re: \1 or $1 is the first pattern that gets match ex [CODE] $pattern = "~(\<a)(.*)(/a\>)~i"; //$1 will equal <a //$2 = everything after <a and before /a> etc... [/CODE] a good way to know what values gets passed to $n is to do a preg_match($pattern, $str, $match) and do a … ![]() | |
Re: could you give us the table structure? it's hard to write a query without knowing what the fields are. any more details will help. | |
Re: if it's a blank page, there's most likely errors, try putting a error_reporting(E_ALL ^E_NOTICE) on the top of the script | |
![]() | Re: [CODE]echo preg_replace('~[^aeiou]~i', '', 'i love you')[/CODE] should remove all non vowel character. I haven't tested it yet but I might be start. |
Re: Try the following, hope it helps 1) construct the drop down properly. [CODE] $dropDown = "<select>"; while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ){ $dropDown .= "<option value='{$row['Group_ID']}'>{$row['Group_ID']}</option>"; } $dropDown .= "</select>"; //echo $dropdown [/CODE] 2) draw the in the markup and hide it visibly or display none, and rather than … | |
Re: Could you post whatever code you've done so that we can get a clearer picture? if you want all of the radio in one array that you may have to make it a multidimensional array. ex: the input name option[home][] and option[away][] | |
Re: Your answer has been answered here [URL="http://stackoverflow.com/a/1270960/1076048"]http://stackoverflow.com/a/1270960/1076048[/URL] | |
Re: like cereal said, since the error you are getting get's set if mysql fails, it's probably your query. Here's what you can do to debug it -echo the $sql and run that in your mysql console or phpmyadmin or query browser -echo the mysql_error() to see what specific error you … | |
Re: I'll try to answer what I can. your post was a bit long so... essentially you want to load certain js depending on your views? You seem to understand the idea behind MVC so I'll skip over that. [QUOTE]So I need from index.php file get 2 values $_GET["controller"] and $_GET["action"] … | |
Re: do a var_dump on the session variable, if it returns NULL that means it's undefined. I know you said that you have session_start() declared above. also make sure that session_start() is declared everywhere else where $_SESSION is useds ex: File1.php [CODE]session_start(); $_SESSION['foo'] = 'bar'; [/CODE] File2.php [CODE]session_start(); echo $_SESSION['foo']; //outputs: … ![]() | |
Re: Here's my two cents php mailer is pretty good for sending mail with attachments and other cool stuff [URL="http://phpmailer.worxware.com/index.php?pg=phpmailer"] http://phpmailer.worxware.com/index.php?pg=phpmailer[/URL] Additionally, here's something I wrote as a wrapper class of the mail function to add attachments [CODE] <?php class xmail{ protected $body = array( 'doctype' => '<!DOCTYPE html PUBLIC "-//W3C//DTD … | |
Re: array merges combines an array based on the keys. so if you have $_GET['test1'] = 'foo' and $_POST['test1'] = 'bar'... easier said in an example [CODE] $_GET['test1'] = 'foo'; $_POST['test1'] = 'bar'; $array = array_merge($_GET['test1'], $_POST['test1']); //$array['test1'] becomes bar //here's how I usually use array_merge class foo{ protected $_config = … ![]() | |
Re: yeah, it's kinda hard to tell where the problem lies, try echoing the query itself and running it in mysql. | |
Re: Just for clarification's sake, you want to add another Field/Column onto you table and NOT add another row? Adding another field/column would mean that you will create another column with a data type, for example.. the fields in you table would be ID, ProductName, Quantity and if you were to … | |
So I've been doing some reading on what the model view controller is and from what I understand, it is pretty much a way to structure your application but I'm still not that sure and I need some help knowing if I understand the concept correctly. If I start making … ![]() | |
I have spent about a couple of hours trying to read the pcre regex syntax on the php.net manual but I can't for the love of god grasp the concept of it. If anyone can help me it would be greatly appreciated. I'm trying to split some strings into an … | |
Re: like saadsaidi said, we need more information. are you getting an error? Has the code met the condition if($ele == 'txtbox') to display the textbox? | |
Re: It's kinda hard to tell how the tab script works, is it a PHP script that generates the HTML and Javascript or is it just a javascript script that you need to pass the value to? | |
Re: Answering in the forums feels more like a hobby than anything else. I also get to learn new stuff | |
Re: there are several ways you can do this, Here's some I can think of: - Use hidden fields [CODE] //on the first form <form action = 'form2.php' method = 'post'> //on the second form <form action = 'form3.php' method = 'post'> //put the value from the prev form <input type='hidden' … | |
Re: I'm no expert at e commerce but one tip I can give you is to purchase an SSL certificate to make a site secure. If you go to a website like amazon, you'll see the URL containing [url]https://example.com[/url] during purchases. [url]https://www.verisign.com/[/url] Verisign is one of the companies that provide SSL … | |
Re: You could reassign the session on update to the new email address | |
Re: If you have data in the database that's saved as a string PHP will still read it as a string even if the data is written as an array. If you have data in the database written like this 'word1, word2, word3' then you can always use the explode function … ![]() | |
Re: if you want to send data back to the server without submitting the page, you can always use Asynchronous JavaScript and XML(AJAX). don't be fooled by the name, AJAX is not a new programming language, but a new way to use existing standards. | |
Re: you'll get an undefined index for $_POST['Sex'] if it doesn't exist in the $_POST array when the user fails to select it. you can add some sort of validation for it like so. [CODE]if(isset( $_POST['Sex'] )){ //filter }[/CODE] Or you could set the checked attribute to be checked by default, … | |
Re: I've always had trouble dealing with contact forms, I usually use PHPMailer class to send my mail, you might want to check it out [url]http://phpmailer.worxware.com/[/url] If you don't like using someone else's code then make sure you have the sendmail binary installed. [url]http://www.cyberciti.biz/tips/howto-setup-sendmail-php-mail-chrooted-apache-lighttpd.html[/url] might help if you're with a hosting … | |
Re: 1 syntax I see right away is your query, UPDATE doesn't use FROM, it's just UPDATE table1 SET etc... |
The End.