ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
Why do you have the IF/ELSEIF statement at all? Why not delete the whole thing and use the HTTP_REFERRER directly in the header?
-
Problem with white spaces on image file upload?
ManiacDan replied to simmsy's topic in PHP Coding Help
What do you mean they don't show up in the browser? -
header reditect and http_referrers are full URLs.
-
Inside your while loops, check to see if the value. if it's empty, don't echo.
-
This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=352281.0
-
Within these lines that you posted, scatter echo or var_dump statements that show the contents of the variables. Check to see if they're what you think they're supposed to be. Make sure the query is correct.
-
There's two things wrong with it: 1) There's no error-handling code 2) Nobody tried to debug it. Are you absolutely 100% certain that the value coming into this function is a number? Are you sure you even have error_reporting turned on?
-
You're probably not even serving the file through a script. You can just download and use a log file analyzer to show you the apache logs to see how many times each URL has been requested.
-
Can i include login from aspx site into php web page?
ManiacDan replied to rich_traff's topic in PHP Coding Help
Look at single-sign-on implementations like SAML and other SSO. -
Kinda did already. Hope you check this thread soon sir. Since he went 6 hours without noticing his db creds in public, I killed them. OP, you absolutely 100% must change your database password the instant you read this. Right now, stop reading and go change your password.
-
Fix the app so it works for normal computer resolutions, or lock down the machines properly so they can't change their resolutions. Yes, a company is able to change the resolutions on their own hardware: Send the IT guy to click the button himself, or use Domain rules to lock them to a specific configuration. And it's generally not a good idea to ask someone if you can do something stupid, and then tell them to calm down when they're emphatic. The reason you can't use a web site to change the user's resolution is because 99.999% of web pages are not private intranet pages. The 1% comment is also pretty stupid on a site that was blacked out for SOPA yesterday. I'm just going to ignore you from now on.
-
You absolutely cannot do that. Change the hardware settings from a web page? No. What if it's a cell phone with a fixed resolution? What if it's my grandmother, whose monitor doesn't support more than 1024?
-
He said they go to his form and paste a large text block. The assumption is, then, that he has a textarea inside a form. The post method doesn't matter to the question.
-
I assume the output (being in label: value syntax) is being generated from another program which cannot be modified to do this post automatically.
-
Managers have to pick two of these three options: Fast, cheap, good. (It's called the Project Triangle) If they choose fast and cheap, I give them joomla. If they choose fast and good, I'll hire more people and utilize an existing framework and re-use old application code as much as possible. If they choose cheap and good, it will take a while because I'll write the whole thing myself and take my time. I am currently maintaining three entire websites for my company, and they actually fall into the three categories: 1) The main web application: Fast and good. We need this done yesterday, but it has to be perfect. The whole existing team plus a team of contractors are writing the whole thing from scratch built on symfony 2 (a rapid development framework) and propel (a database ORM solution) 2) A documentation website: Fast and cheap. We had to kick something out the door for competitive reasons, but it didn't have to be good. It just had to exist. I slapped together a quick symfony module to handle some of the hairier bits and a junior dev stood up a joomla instance and styled it in a week. 3) A one-off solution for a customer: Cheap and good. We need to fully satisfy the customer but we don't want to spend too much money on it, so we're getting their requirements banged out whenever we have a spare hour, using whichever developer is free. Using the tool that's appropriate for the job is the majority of decision making in programming.
-
Use the code I gave, and only use the value of $foo[2][$k] if the value of $label is in the list of what you want.
-
$input = 'First Name: Lincoln Last Name: Coe Address: 1234 Easy St, Perfectville, PV 00000 Telephone: 0000000000'; preg_match_all('/^([^:]+):\s*(.+)$/m', $input, $foo); foreach ( $foo[1] as $k => $label ) { echo "The value of {$label} is {$foo[2][$k]} <br />\n"; }
-
Make all of your member variables private, and then __get will always be called when you access a member variable from outside the class. have __get check to see if the value is empty.
-
You don't want to learn PHP yet you need custom software written. Break out the wallet.
-
Those two arrays have nothing to do with each other. If you're asking how to get the newlines and spacing, echo a <pre> tag before your print_r and that will maintain the format of pre-formatted text. -Dan
-
Scripts do not end after header redirects, so open connections are not closed and sessions are not written and closed. If you want the script to end, you have to die(). Header() is used for more than just redirects, it doesn't automatically die.
-
Welcome to the forums. Please note that you've posted your database credentials in public and now you need to change your password. Now.
-
Or, instead of putting them in useless functions that you won't use, put them in files and include() those files. I've thought of two other ways to do this without using the (incredibly stupid and dangerous) eval()
-
If you think it's the only want to do it, either you're wrong or there's a better way to do what you're trying to do. For instance, call these functions (and write them properly) instead of loading them as a string and eval'ing them.