scootstah
Staff Alumni-
Posts
3,858 -
Joined
-
Last visited
-
Days Won
29
Everything posted by scootstah
-
Which PHP Editor do you think is the best? [v2]
scootstah replied to Daniel0's topic in Miscellaneous
Have you tried an IDE? I used to think a simple text editor was all I needed too, but then I tried an IDE. The only time I use a regular text editor now is just for real quick edits, or stuff that I don't want to make into a project in my IDE. -
The code keeps executing after the header() until the script ends. So why not unset on the results page?
-
I was thinking something along the lines of assigning a unique token to each company. In the email include a url that's something like, register.php?token=asdi934tsjdk5lqaw45j. You could make it so they have to enter their email on the page to make sure it matches. I dunno, just pondering. Your approach really depends on how much work you want each company to go through.
-
Why does it matter if it's AJAX or a normal request?
-
Maybe generate a username/password for each one and then send it in the email? Or send them a link in which they can create their own username/password. You could use some kind of token to make sure only the recipient of the email can view the page.
-
Did you check that the data received by PHP matches the data that you sent?
-
Not really. :/ Can you give me an example with pseudo code or something? I'm still not sure what you're trying to do.
-
You have to tell Apache how to handle PHP files. There's a lot of configuration involved. If you don't know what you're doing, just download XAMPP. XAMPP is a pre-configured WAMP (Windows Apache Mysql PHP) stack that works right out of the box, no configuration needed.
-
Just because it works in other browsers doesn't mean anything. Other browsers may handle infinite loops differently than mozilla. Since it only happens with Mozilla, download the Firebug addon and use the Net tab to do what Adam said.
-
It doesn't change your URL, you have to do that. It changes what the URL does, where the request goes. You need to have some kind of logic in your index.php file to further route traffic. For example, you can now do this: example.com/view/some-article/17. $_SERVER['REQUEST_URI'] will now return "index.php/view/some-article/17". If you explode it by a forward-slash you can split up the segments and use them accordingly. $segments = explode('/', $_SERVER['REQUEST_URI']); // get rid of the "index.php" segment array_shift($segments); // you are left with : array( view, some-article, 17 ) // we'll assume the first segment is for a page, so lets get that require $segments[0] . '.php'; // inside "view.php" we can then access the other segments to load an article and use pagination This is crudely basic and has a lot of limitations, but you can extend the functionality with more advanced routing. Read the docs for the CodeIgniter router to get a better understanding of how it works. The code handleing CodeIgniters routing is very simplistic, I would recommend you check it out and use it to come up with your own solution. The code is located in /system/core/Router.php. The actual routing takes place in the "_parse_routes" method; function _parse_routes() { // Turn the segment array into a URI string $uri = implode('/', $this->uri->segments); // Is there a literal match? If so we're done if (isset($this->routes[$uri])) { return $this->_set_request(explode('/', $this->routes[$uri])); } // Loop through the route array looking for wild-cards foreach ($this->routes as $key => $val) { // Convert wild-cards to RegEx $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); // Does the RegEx match? if (preg_match('#^'.$key.'$#', $uri)) { // Do we have a back-reference? if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) { $val = preg_replace('#^'.$key.'$#', $val, $uri); } return $this->_set_request(explode('/', $val)); } } // If we got this far it means we didn't encounter a // matching route so we'll set the site default route $this->_set_request($this->uri->segments); } This way, you can have all sorts of powerful dynamic URL's and easily accomplish your original problem.
-
What needs to go into sub folders?
-
Lots of Javascript. http://code.google.com/p/jquery-form-builder-plugin/ You'll also have to save any validation rules to be processed through when the form is filled out.
-
Like I said, that rewrite rule filters all traffic through the index.php file. So example.com/something becomes example.com/index.php/something. You can't echo arrays, you need to use something like print_r or var_dump. Also, you need to explode it by a slash, /. print_r(explode('/', $_SERVER['REQUEST_URI']));
-
Usually it's something like <IfModule mod_rewrite.c> RewriteEngine on Options +FollowSymLinks -Indexes RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> All requests will go through index.php and then you throw some logic in there to direct traffic. Your links would look like example.com/segment1/segment2/segment3 ... etc You can access them by exploding $_SERVER['REQUEST_URI']
-
You can send a cookie with cURL, but whether or not that helps you I'm not sure.
-
I wasn't trying to be condescending. I apologize if I came across as such. Do you have a screenshot or something to show what it looks like now and what it is supposed to look like?
-
By using mod_rewrite rules or with URI routing.
-
Tables are for tabular data, not for layouts. Use proper markup and CSS.
-
This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=356234.0
-
Either turn off IIS or configure the virtual host in Apache to have a different port.
-
It's common to see tabs for indentation and spaces for alignment. This is what I do.
-
Then you probably can't do whatever you're trying to do. What is that exactly, anyway?
-
There's nothing wrong with that code. You are not calling that later are you?
-
Did you install Apache or some other HTTP server?