Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
have an array for the pots...
-
What do you see if you do print_r($_POST) on the top of the php page? Also, you might need to use isset() since if they leave the field blank I think it will cause this error. so it would be if(isset($_POST['firstName'])){ //your cleaning code }else{ //it was left blank }
-
[SOLVED] Check if curl & file_get_contents are enabled
Jessica replied to phpcode's topic in PHP Coding Help
you can use function_exists for the file_get_contents, I guess you could do the same on curl_exec or something. -
I think the data there instead of the 0, means that the value of $recordset is an array. If it said 0 instead of array, I would think recordset is an array. *shrug* weird.
-
how to display a webpage logged in via a cURL request in an iframe
Jessica replied to arianhojat's topic in PHP Coding Help
I actually wrote the code to do this the other day. Have this as your iframe's src page: iirc, you'll need to make a cookie.txt file that has 777 permission <?php ini_set('display_errors', 1); error_reporting(E_ALL); $url = 'the login pages url '; $cookieFile = 'cookie.txt'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'the post fields go here, ie username and password'); $result = curl_exec ($ch); curl_close ($ch); $url = 'the page you want to load once you are logged in.'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result = curl_exec ($ch); curl_close ($ch); print $result; ?> -
It means there is no 'firstName' being posted. What is your form's HTML
-
So on the top of your processing page, do print_r($_POST); and click on one of the buttons. See what it says. Then go back and click on the other, and see what it says now. Also, make sure they have values as well. value="action1" and value="action2"
-
I've never seen it before, but I think that's what they have, a multidimensional array.
-
$JobID = $recordset[0]['JobID'];
-
It depends on how you're selecting which action? Do you have two submit buttons? A drop down? What?
-
you probably have getURL('url', '_blank', 'POST') in there somewhere or something like that. I think if you change '_blank' to just '' it does it in the background. Not sure if that's right but give it a shot.
-
The code you're talking about is in flash. You need to have flash call the PHP file in the background instead of going to it. Check out kirupa it is a good site for flash.
-
How is it going to do the notify? Will they have a computer with the browser open? You could just make that page constantly refresh. If they're expecting email, just have it email when the new order is placed.
-
Uhm, where is this exam?
-
What is in include ("include.php"); and use code tags! The # symbol on the editor!
-
What if you have a user who signs up as "messages". How do you tell which messages page you want, their profile or the messages page? Make the users have a distinct type of url, it will be easier.
-
You don't even need that get stuff, just update the counter each time. You could also use a txt file instead.
-
I would use a database and in the comments table, you have a parentID or something, that shows which comment it was a reply to. Then you use a recursive function like this: http://www.phpfreaks.com/forums/index.php/topic,159658.msg696481.html#msg696481 To sort them out.
-
number_format might help
-
sessions do not last between subdomains, so it is the www. You can either use a BASE_URL constant with a URL or a relative path, so they never leave the subdomain.
-
You probably want to do http://site.com/users/username/ so that you won't loose all your other pages.
-
[SOLVED] How to make default argument a class variable?
Jessica replied to Jessica's topic in PHP Coding Help
So it's just a way to set a boolean? I mean, I know JS doesn't have strong typing but what is the point in a statement that allows you to set a variable to false or a value? -
storing data for use across multiple pages...
Jessica replied to mkosmosports's topic in PHP Coding Help
If it's the same for every user just define it in a config file that you include on all pages. -
[SOLVED] How to make default argument a class variable?
Jessica replied to Jessica's topic in PHP Coding Help
if y is true, what is x? -
[SOLVED] How to make default argument a class variable?
Jessica replied to Jessica's topic in PHP Coding Help
It has everything to do with OOP, because I wanted to know if it was possible to use $this->value in the arguments of a method in that class. Wouldn't it make sense to be able to use it there? You're in the class at that point. Also, the ternary operator ought to be outlawed. Yes, it's shorter, but it gives no meaning to the code. if else is clear. ?: is not. And it's still pretty much the same as what I was doing, only using '' instead of NULL. I just wanted to know if there was a way to access the $this->value in the arguments, but unfortunately there is not.