Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
So what's the next step?
-
See below.
-
I'd first unset $_GET['sort'], then use implode() with the $_GET array to make the variable string after the ?, minus the sort. Then add it to your page URL. That is your desired link. (plus the new sort type) However, if you have ?sort=a&sort=b, $_GET['sort'] should ONLY be b.
-
That the server needs to be online. That you have to write the code yourself. By praying to garden gnomes. :D Ah, I love this place.
-
Complete newbie - probability based on an argument?
Jessica replied to ladyath's topic in PHP Coding Help
If I understand your desired result, I'd use a switch. Can you elaborate on what you're doing or display some code? -
Also, this.
-
No one is answering because you can find this information here: http://lmgtfy.com/?q=PHP+file+upload If you have specific code problems or a scenario you're attempting which is not working, we can help.
-
I think it's a personal preference. For the code you posted, I'd actually do ?> <strong><img src="img.jpg" /></strong> <?php Which actually still makes little sense semantically, why are you bolding an image? If there's more HTML than PHP, I exit the PHP if I can. If not, one long variable. Lately I've been using more Heredocs as well. It really depends on your code design and what you're attempting. Someone probably can say "THIS IS BEST" but it won't always be so.
-
PHP array.. checkboxes and an if statement ...easy?
Jessica replied to ben_johnson1991's topic in PHP Coding Help
then use explode() to separate the various IDs and loop through them as well. Or explode() and use in_array(). Well duh -
Make a row increase every time the same value is added to the table?
Jessica replied to dominod's topic in PHP Coding Help
Another way to do this would be using the COUNT(field) when later needing to know how many of each value there is. That way you could keep unique records of who suggested what, to prevent duplicates or "spam". You could also do it in PHP using array_count_values. -
Seriously....PHP has this awesome manual.... :-P
-
PHP array.. checkboxes and an if statement ...easy?
Jessica replied to ben_johnson1991's topic in PHP Coding Help
if then use explode() to separate the various IDs and loop through them as well. -
You'll need to do some checking to build your SQL statement. If someone enters both a first and last, you need to use AND. If someone only enters first OR last, only query for the one they entered (no OR)
-
Before trying to process the code, put this at the top and see what it displays: print_r($_POST); And put that here.
-
Haha don't you hate when that happens? Glad you got it
-
My first thought is can you have a table start with a number? Try surrounding the table with tick marks. INSERT INTO `404s`
-
Just out of curiosity, you've done this for IE too right?
-
That will take them off of the current page though, correct?
-
That's where I'm confused, I didn't think you could do a PHP header on a page like that, where it's inside existing HTML. I put this in the page being returned via AJAX header('Loction: http://google.com'); print 'test'; die(); And my div gets populated with . I guess I'm not explaining it correctly, since no one seems to get the problem....
-
Do you think this will work with an AJAX page? The page that would have the do the redirect is loaded only via AJAX. That is why I used a popup? I'll try to do what you suggest later today but I don't understand how it will work...
-
There's NO perfect layout, css, website. IMO, you need to immediately stop thinking in BOXES and go check out some of the fun creative designs out there to see how you can make cross-browser and OS websites that look awesome. GL.
-
I did, it doesn't close the window. Although I think you must mean window.close() unless you're using some other code? What I'm asking is why would you send javascript after an excel file contents? I mean, it makes no sense to me that it would work, the content type isn't text/html. How does "header('Content-Type: application/vnd.ms-excel');" allow you to include javascript? header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename="'.$this->title.'.xls"'); header('Cache-Control: max-age=0'); //PHP to echo Excel output here. echo '<script type="text/javascript"> window.close(); </script>'; It looks to me there's not a way to accomplish it this route. One option I can do is generate the file and save it on the server before displaying the link to download it, but then if they didn't want to download it I'd have to delete it later. The page displayed via ajax contains several options, the download is only one, and we only really need to generate the file if they request it. So that's why it's going to a popup. I don't want them to click the link, to generate the file and then give them another download link. That'd be annoying and counter-intuitive to the user. Anyone else have any ideas?
-
Try number_format()
-
To use the tags highlight your code and click the button that has php written on it. You need to make a link for DAY for one thing. <a href="dayPage.php?date=<?php echo $date; ?>">DAY</a>