pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
Where do you define this variable? $row_get_.$pag If it is outside of the function, you probably have a scope issue. Show more code that shows where that variable is defined, and it will be easier to help you.
-
When you give out a link, you can store it in the database along with the date you gave it out. Then setup a cron that will delete all the links in the database that are 24+ hours old each day. When a user goes to a link, check if that link exists in the DB, and if it doesn't, it gives them an error.
-
Avoid buuton back and page refresh double insertation ??
pocobueno1388 replied to Coldman's topic in PHP Coding Help
I think the only way you can go, is to check if you have that information in the database already, and if you do, give them an error. So once they add the item to the cart and press refresh, instead of adding the item again, it will give them an error saying that the item has already been added. -
Honestly, I've never really understood the point of a MySQL class...isn't it easy enough already to do what you want with it?
-
Use nl2br() www.php.net/nl2br
-
You never closed the brackets to your class. <?php class calendar{ var $year; var $month; var $endDay; function calendar($y,$m) { $this->year = $y; $this->month = $m; $this->startDate=mktime(12,0,0,$this->month,1,$this->year); $this->andDay = date('t',$this->startDate); $this->allTime = getdate($this->startDate); } function displayCells() { for ($count=0; $count < (6*7); $count++) { if (($count%7)==0) { if ($this->allTime['mon'] != $this->month) { break; } else { echo '<tr></tr>'; } } } } } $cal = new calendar(2007,10); echo '<table border="2"><tr>'; $cal->displayCells(); echo '</tr></table>'; ?>
-
You can keep adding to the query like this: <?php $query = "SELECT * FROM tablem WHERE 1=1"; if(conditon){ $query .= " AND blah='$blah'" } if(conditon){ $query .= " AND whatever='$whatever'" } ?> Is that what your trying to do?
-
List please? SQL Injections, XSS attacks, etc.
pocobueno1388 replied to verdrm's topic in PHP Coding Help
Here is a very useful class you can use when you are allowing users to freely input a large amount of text that allows HTML and Javascript. http://htmlpurifier.org/ Always make sure to use mysql_real_escape_string() on ALL variables being used in a query. If you search Google on PHP security topics, you will find plenty of articles. -
Avoid buuton back and page refresh double insertation ??
pocobueno1388 replied to Coldman's topic in PHP Coding Help
Do you have a file that is included at the top of every script you write? That is called the header file. If you don't have one, then your going to have to put this at the top of all your scripts. -
PHP can't do this, so your going to have to stick with javascript. PHP only works server-side meaning it requires a page refresh.
-
Is this even PHP?
-
Avoid buuton back and page refresh double insertation ??
pocobueno1388 replied to Coldman's topic in PHP Coding Help
In your header file, put this line of code at the top header("Cache-control: private"); -
I don't follow...explain more.
-
[SOLVED] Please help PHP n00b email something
pocobueno1388 replied to SajanParikh's topic in PHP Coding Help
You would get all that into one variable, like this <?php $var = "<TR CLASS=\"MYTABLE\">"; $var .= "<TD CLASS=\"MYTABLE\">" . $id . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">" . $date . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">" . $rooms . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $tax . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $misc . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $total1 . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\"> </TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $cash . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $bankcard . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $amex . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $directbill . "</TD>"; $var .= "<TD CLASS=\"MYTABLE\">$" . $total2 . "</TD>"; $var .= "</TR>"; ?> Now the $var variable contains the entire table. -
[SOLVED] While($row = mysql_fetch) only doing first row?
pocobueno1388 replied to cooldude832's topic in PHP Coding Help
Check your phpinfo() to see if magic_quotes_gpc is on or off. If it is on, do this: ini_set('magic_quotes_gpc', 'off'); -
[SOLVED] While($row = mysql_fetch) only doing first row?
pocobueno1388 replied to cooldude832's topic in PHP Coding Help
Exactly, and they are being redefined in his script. -
[SOLVED] While($row = mysql_fetch) only doing first row?
pocobueno1388 replied to cooldude832's topic in PHP Coding Help
Maybe your overwriting the past queries since you are using the same variable names. Try changing the $q and $r inside the loop to different letters. -
I'm thinking it's because this line is in the for loop: insert_location($thumb); That is the function that generates the success message. Maybe you could do something like this. First take out the success message from the function, then change the for loop chunk of code to this: <?php for ($i = 0; $i < count($_FILES['image']['tmp_name']); $i++) { $fileName = $_FILES['image']['name'][$i]; copy($_FILES['image']['tmp_name'][$i], IMAGE_FULL . $fileName); $thumb = new GallerySizer(); if ($thumb->getLocation($_FILES['image']['name'][$i])) { if ($thumb->loadImage()) { if ($thumb->getSize()) { if ($thumb->setThumbnail()) { if ($thumb->copyThumbImage()) { if ($thumb->resizeImage()) { $thumb->copyResizedImage(); } } } } } else { echo("Invalid image/file has been uploaded. Please upload a supported file-type (JPEG/PNG)"); unlink(IMAGE_FULL . $fileName); die(); } //insert image if (insert_location($thumb)) { $success = TRUE; } } } if (isset($success)){ $msg .= " Upload OK. The page will now Refresh!<br />"; displayPage($msg, "Upload OK!"); } ?> I'm not positive that will work, but you can give it it a try.
-
onClick is a javascript thing. I'm not very good with javaScript, so I can't give you much help. This site should be helpful http://www.tizag.com/javascriptT/ It shows you how to work with dates, onlick, etc. So try finding your answer there. If you can't, then I would post this in the JavaScript forum.
-
[SOLVED] PHP contact form--blank subject when form is sent
pocobueno1388 replied to chomick's topic in PHP Coding Help
Try to use a lowercase 's' with the $subject variable. That is the way you have it in your form. mail($YourEmail, $subject, stripslashes($Message), $headers); -
This would be done with JavaScript.
-
You probably have that message in a loop. Take it out. We would have to see your code to help you more.
-
[quote author=TheFilmGod link=topic=119164.msg675348#msg675348 date=1187573496] Seriously, you don't make good money as a php programmer. 60 grand tops. [/quote] Uhhh....I don't know about anyone else, but I would consider that to be very good money, I would be happy with it :)
-
How do you feel when your webhost goes offline?
pocobueno1388 replied to MasterACE14's topic in Miscellaneous
What kind of question is this?! I don't think your going to find anyone that doesn't get the least bit angry. -
Take a look at this http://www.search-this.com/2007/03/12/no-margin-for-error/