Author Topic: Web project problems.  (Read 12149 times)

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #30 on: May 03, 2010, 02:27:26 PM »
Quote from: adam
Like, how do I search the database and bring back results for it? Wink

Does that make sense, if not which parts don't make sense?  Just trying to give you a 1,000 foot view of things, then you can test which part is working by printing out a variable, taking a look at the HTTP requests, etc.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #31 on: May 04, 2010, 07:14:36 AM »
It made sense reaper yeah, but I'm completely limited to using ASP Classic and Access 2000/3 for this project. It's not an assignment as such it's a literal project for a client, except as part of the course we have to do it for free :P I managed to get the search database working, only by name but nevertheless that's enough for now. I'll post the code later in case anyone is interested, it's similar but not quite what you suggested peewee.

Now all I have left to struggle with is REPORTS!  :raincloud:

thanks all
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #32 on: May 04, 2010, 09:49:43 AM »
nice, there's nothing wrong with ASP it's like PHP.  Once you look at the request, or see what's going on it's easier.  If you had your own server that would help, there's not much to installing the .NET framework, and there are differences in the configuration.  For instance in CGI PHP has server variables like $servername, where installed on the web server in ISAPI mode it doesn't.  You just need Windows server and you can install this anywhere.  the thing with Access is that for some reason it always needs to be compacted and repaired when it grows, you also have to renindex databass sometimes with other databases, but it's more of a problem with Access on the web.  I really like sqlite,  I've used it a few times and i've seen some applications like teamspeak use it.  With MS-SQL you can use Microsoft reporting server, you can probably still use Crystal Reports there is a free version, it looks like Access does reports as well. 
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #33 on: May 04, 2010, 10:41:33 AM »
Ugh, Tom is having some trouble with the following if anyone has any idea;

We have a date drop down menu on the input form. DD/MM/YYYY as three seperate drop downs. We need this to, when a date is selected and the form submitted as a whole, to shove the three individual drop downs in to one database field, txtDate. Naturally it would be a fuck-tonne easier to just have an open field and copypasta all the other open fields, but our client is insistent on using as many drop downs as possible :dohdohdoh:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #34 on: May 04, 2010, 10:47:03 AM »
Ugh, Tom is having some trouble with the following if anyone has any idea;

We have a date drop down menu on the input form. DD/MM/YYYY as three seperate drop downs. We need this to, when a date is selected and the form submitted as a whole, to shove the three individual drop downs in to one database field, txtDate. Naturally it would be a fuck-tonne easier to just have an open field and copypasta all the other open fields, but our client is insistent on using as many drop downs as possible :dohdohdoh:

This should be pretty simple. you can fill the dropdown controls with the data that you are expecting. 01-31 for day, 01-12 for month, and a sample of years. This can be done with for loops easily. Just have a trailer that goes from 0-31 and convert it to a string and format it however is needed. Then your submit button just does string concats.


(actually people seem to prefer advanced calender controls. You should try to convince them to use one, providing you get it working. Most allow for directly typing in your own date, picking from a pop-out calendar, and will allow you to format the value any way that you need to send it back to the DB)
« Last Edit: May 04, 2010, 10:49:54 AM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #35 on: May 08, 2010, 02:34:36 PM »
WOW!!!!!!!!!!!! (scream that, high pitched voice, thats how its meant to be done)

I'm having two major fucknut problems with it, and they're oh-so-simple! but I can't get them to work properly for the life of me and all the examples, tutorials yada yada use a two page system for what im trying to achieve, all I want is the following:

DELETE and to a lesser extent UPDATE. The SQL is simple. DELETE * FROM users WHERE X = "textbox" now a smaller problem here is I don't think any of the fields can be unique, theres possibly gonna be duplicates in every field and thats not what we want, but I guess let's say we're adding a temporary field autonumber called "Session ID", and that the view recent/search pages are going to spit this out from the database into my table so the staff can look up their individual number for their entry.

Basically like I said above, I need: Delete function that works within one page (or if it MUST, two :( ) that deletes a number in textbox, another sql example of this could be
Code: [Select]
delete* from users where sessionid = " 'request.form(texboxname)' " but how do I implement this and actually have it work? one I got working sort of, but it comes back to the one page issue (and I couldnt get the two page ways to work), but what it did was keep the response.write viewable on the page at all times so it constantly said Record successfully deleted, and I got frustrated and ragedeleted that attempt :P

Update is similar, but I care a little less about it since if they delete the record they can just re-put in the entry from the normal form, but if its easy enough I guess the same thing, but I can see this being troublesome. updates are generally not something I see done through the web.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #36 on: May 08, 2010, 08:12:41 PM »
So are you saying you understand what you would run directly against the database, in other words you know the SQL?

If you know the SQL, you just replace the variable (or if you didn't use a variable, your value), with the variable learned the web browser/user.  You really need to run your own web server for development so you know the configuration, otherwise in the future you won't know what's going on.

For example, through the HTML web form you would accept input from the user and send an HTTP GET, and the URL would look like:
adamsucks.com/?p=10&x=blah
This gives your ASP script access to variables p with a value of 10 , and x with a value of blah
You could also use the HTTP POST method where you won't see the variables in the URL, but they will be in the HTTP response

Then on your ASP script, instead of putting the value in the SQL, you put $p or $x.  Now when you have single quotes, the single quotes are used to prevent shell expansion, meaning special characters have meanings, like "$" denotes a variable etc.  Now if you have the SQL built, then learn how to build it with a local variable in your script, then make sure you are getting the right value to your script from the HTML form, by printing the value.  When you know you have the right value, add it to your SQL.  Personally I don't know the syntax of any of this, so I can't help you with the exact details, and it may be a good idea to tell us if your script has the right values for the form variables, etc.

Also remember quadz cartoon with johny tables, you're taking input from the user and passing it into your SQL.  So when you take a date, only take a date.  This way you won't get owned in the future.  See: http://en.wikipedia.org/wiki/SQL_injection

 :yessign:




« Last Edit: May 08, 2010, 08:45:30 PM by reaper »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #37 on: May 09, 2010, 02:42:18 AM »
that's what im sayin! we've had good teaching in SQL, inadequate teaching in ASP and none in how to combine the two as one beautiful little bundle. thanks reaper, helpful stuff.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #38 on: May 09, 2010, 06:39:51 AM »
that's what im sayin! we've had good teaching in SQL, inadequate teaching in ASP and none in how to combine the two as one beautiful little bundle. thanks reaper, helpful stuff.

First thing, delete * shouldn't work. Delete takes an entire row, specifying which properties is improper syntax.

Second, are you submiting your DB changes? The way a DBO works in ASP is it makes a local copy of all of your queries. It never actually makes changes to the database until you run a submit command. In our schema, (and I'm not sure if it is part of the DB object we are using or the LinQ extensions) you have to use a db.deleteOnSubmit(); command. So for inserts and updates you may use db.submit(); and for deletes you may have to use something like db.updateAndDelete();


As for one page at a time, I'm not sure what you mean. What is your criteria for each page? Remember that a delete statement is almost exactly the same as a select: IE:

select a few rows
Code: [Select]
select * from users where username = 'Im gonna party' and date like '%/1999';delete those same rows
Code: [Select]
delete from users where username = 'Im gonna party' and date like '%/1999';
So whatever conditions are used on your select statement can also be added as conditions to your delete statement
« Last Edit: May 09, 2010, 06:46:15 AM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #39 on: May 09, 2010, 06:54:18 AM »
I don't get what you mean by submitting the database changes, all I know is when the form is submitted it sticks the data from the form in there. currently not using anything like db.submit and stuff.

what I mean by one page is most examples/tutorials have a delete.asp and delete.html file, the html has the text field then when you run the delete, it takes you to the delete.asp page with a response.write saying record succesfsully deleted, what im after is this happening on just one page without needing 2.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Web project problems.
« Reply #40 on: May 09, 2010, 12:46:26 PM »
Gah! What's wrong with this. I just want to delete by the fucking autonumbered field, SessionID when people type a number into the damn text box.

<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Deleting records in a database table</title>
</head>
<body>
<form name="form1" method="post" action="">
  <label>Input Session ID
  <input type="text" name="deleterec" id="deleterec">
  </label>
</form>

  <%
'declare your variables
Dim connection, sSQL, sConnString

'declare SQL statement that will query the database
sSQL = "DELETE FROM users WHERE SessionID=" & request.form("del") & ""

'create an ADO connection object
Set connection = Server.CreateObject("ADODB.connection")

'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("deleteme.mdb")


'Open the connection to the database
Connection.Open sConnString

'Execute the SQL statement
Connection.Execute sSQL

'Now close the connection object
connection.Close
Set connection = Nothing
%>
</p>
</body>
</html>
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Web project problems.
« Reply #41 on: May 10, 2010, 12:39:15 PM »
Your ASP script has a variable deleterec learned from the value input from the form and sent in an HTTP POST, but you never reference that variable in your SQL below.

You should do something like:
"response.write sSQL & "<br>" & vbNewLine" to see what SQL you are generating.

First few things you should do is:
run your own web server for development purposes
find out where error logs are for web server, and how errors are controlled for the web server
find out where the error logs are, and how errors are controlled for ASP
find out where the error logs are, and how errors are controlled for the database

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

 

El Box de Shoutamente

Last 10 Shouts:

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 23, 2024, 11:24:29 PM

Login with username, password and session length