Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 05-23-2005, 10:00 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
k, if i'm understanding you correctly, you want the person to be sent to a new page, based on a hidden form field, right??

Do you want information displayed before they are redirected?
Reply With Quote
  #22  
Old 05-23-2005, 10:06 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ok, to avoid confusion I will post it according to the basics in my mind of how it is going to work.

What is going to happen is I am going to have a search page on my tutorial section. The search page will search our tutorial script for matches and will have a check box that you can check if you want it to search our forums too.

What I need to do is either:
1. Find something in Javascript that can interpret the form before it is submitted. When the box is checked it will change the action URL to the search page for the forum. If not then it will go to our search script.
2. Make a page that will forward you to the appropriate place after the form is submitted.
__________________
Reply With Quote
  #23  
Old 05-23-2005, 10:26 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
ok, so lets try number 2:

PHP Code:
<?php

//assume that the submitted variables have already been extracted
//I don't know off the top of my head the values submited for a checked check box

if ($action=="searchforum"){
header('location: forumshearchpage.php?searchstring=$keywords');
} else {
//search the tutorials section

}
just a quick off the top of my head possibility, you would have to properly format the forumsearch url to pass the forum data to the search page.


Haven't tried it, but in theory it should work:/

note: the header() function will fail if any thing has been outputted before it was called

IcI
Reply With Quote
  #24  
Old 05-23-2005, 05:30 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Alright, I will see if I can pull all the info tonight.
__________________
Reply With Quote
  #25  
Old 05-24-2005, 07:58 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

if that doesn't work just do a refer.php page: and go if($_POST['whatever'] == "this"){ echo'<meta refresh>';}?>

just an idea
Reply With Quote
  #26  
Old 05-24-2005, 08:18 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
The problem with the meta refresh is that it has to be in the header. So he will have to out put a header, and use an if - else statement to determine wether or not to add the meta refresh stuff to the header.
Reply With Quote
  #27  
Old 05-24-2005, 12:49 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ack you guys are confusing me.

I will post the stuff and you can tell me what is the best way.

I have one more class today and when it is over I will post what I have so far!
__________________
Reply With Quote
  #28  
Old 05-24-2005, 02:33 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
lol
Reply With Quote
  #29  
Old 05-28-2005, 09:27 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Hey panther,

I just read this about using the extract() function:

Quoted from php.net from their Warning Box

"Do not use extract() on untrusted data, like user-input ($_GET, ...). If you do, for example, if you want to run old code that relies on register_globals temporarily, make sure you use one of the non-overwriting extract_type values such as EXTR_SKIP and be aware that you should extract $_SERVER, $_SESSION, $_COOKIE, $_POST and $_GET in that order."

You ever run into any thing like that?

IcI
Reply With Quote
  #30  
Old 05-29-2005, 09:17 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Over my head...but you already know that.

Right now I am trying to work the different sections out.

This script is going to rock...I think I will make it availible if anyone wants it....or wants to mod what I screwed up on.
__________________
Reply With Quote
  #31  
Old 05-30-2005, 01:21 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,924

Yes, I actually use EXTR skip anywhere that I am extracting data that a user could possibly modify.. Like on $_POST i would use EXTR_SKIP, extract($_POST,EXTR_SKIP);

all it does it makes sure values that are already set cannot be overwritten...

$table_name="tbl_name";

extract($_POST);

well now if someone posts a form, and makes up there own field name of table_name, it will be over written with whatever data the user chooses..

EXTR_SKIP will disallow that to happen, because $table_name was set before the extract..

suck at explaining but that's what I get outa it..
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #32  
Old 05-30-2005, 07:18 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Well you guys, I have the viewing and submission part done. All I have to do is make the admin panel and user thing.

What is the best thing to use in a login script? Sessions or cookies and do you know a good place that explains it since I have not been able to find one.
__________________
Reply With Quote
  #33  
Old 05-30-2005, 08:42 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,924

why not use both?
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #34  
Old 05-30-2005, 11:35 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ok, how do I use em both? I have no idea. You know of a good site that explains them? I don't really care for php.org.
__________________
Reply With Quote
  #35  
Old 05-31-2005, 12:38 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

i.e. like have a check box that says save logiin, set_cookie("loggedin","char",time()+3600"); ... if it isn't checked $_SESSION['loggeidn'] = $username; or whatever
Reply With Quote
  #36  
Old 05-31-2005, 12:39 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

Quote:
Originally posted by atholon
Ok, how do I use em both? I have no idea. You know of a good site that explains them? I don't really care for php.org.
and you mean php.net I used to be like you...but i quickly figured out that it is actually a perfect place. I can refrence any functions/anything else, get examples and find user comments. You just have to go more in depth than the examples
Reply With Quote
  #37  
Old 05-31-2005, 01:01 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ok, what is the main differences between the two. That is something I never really got. I know how to pull the user information out of the database but I don't know how to make it so once the password matches the one in SQL to set a cookie or use the cookie for other user variables.
__________________
Reply With Quote
  #38  
Old 05-31-2005, 01:57 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

I got a tutorial on it @ www.wghq.net/php/ in the tutorials section check it out ... all though it doesn't go into cookies much you should figure it out fast
Reply With Quote
  #39  
Old 06-01-2005, 11:57 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Alright, I will big yah when I get on later.
__________________
Reply With Quote
  #40  
Old 06-02-2005, 08:32 AM
SilentTrigger is offline SilentTrigger
-1PARA-

Join Date: Sep 2002
Location: Sweden
Posts: 3,972

Start checking php.net.

For example, cookies:

http://se2.php.net/manual/sv/function.setcookie.php
__________________
-1PARA-AlexKall

My photography website



Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:12 PM.




Powered by vBulletin®