Search the Community
Showing results for tags 'urls'.
-
I am having trouble with having my page remember a POST item. What I'm trying to do is to have the data updated message to include a link using a userid, a random number that's used to find things in the database. I've tried several ways but still having trouble. Below are 2 such ways (along with others). I keep getting a page where the userid doesn't show up. It doesn't make sense though because it gets inserted into the database. Could someone take a look? Instead of coming up with a link like this: http://www.mynewpage.com/visitdetails.php?userid=113555588701606e973.42256784 It looks like this and I get a page doesn't exist error. http://www.mynewpage.com/visitDetails.php?userid= connection info here..... $today = date("F j, Y, g:i a"); $careComments = htmlspecialchars("$_POST[careComments]", ENT_QUOTES); $feedComments = htmlspecialchars("$_POST[feedComments]", ENT_QUOTES); $waterComments = htmlspecialchars("$_POST[waterComments]", ENT_QUOTES); $ventilationComments = htmlspecialchars("$_POST[ventilationComments]", ENT_QUOTES); $recordsComments = htmlspecialchars("$_POST[recordsComments]", ENT_QUOTES); $invNotes = htmlspecialchars("$_POST[invNotes]", ENT_QUOTES); $facilityComments = htmlspecialchars("$_POST[facilityComments]", ENT_QUOTES); $summaryComments = htmlspecialchars("$_POST[summaryComments]", ENT_QUOTES); $deads = "$_POST[deads]"; $start = "$_POST[start]"; $mortality = $deads/$start*100; $userid = "$_POST[userid]"; $sql="INSERT INTO visitNotes (id,today,userid,date,site,name,groupID,caretaker,reason,careComments,cough,looseness,sorting,treating,walking,med1,med2,euthanasia,biosecurity,feed,feedComments,adjustments,tickets,water,waterComments,cleanwater,meter,temps,ventilationComments,humidity,fans,curtains,inlets,hilo,alarm,backup,pitLevel,recordsComments,medRecords,rodent,testAlarm,lp,lpLevels,genFuel,genFuelLevel,genHoursRecord,genHours,invRecords,invNotes,currentInv,start,deads,mortality,cleanOffice,facilityComments,mow,gates,chute,lights,deadDisp,summaryComments) VALUES ('$_POST[id]','$today','$_POST[userid]','$_POST[date]','$_POST[site]','$_POST[name]','$_POST[groupID]','$_POST[caretaker]','$_POST[reason]','$careComments','$_POST[cough]','$_POST[looseness]','$_POST[sorting]','$_POST[treating]','$_POST[walking]','$_POST[med1]','$_POST[med2]','$_POST[euthanasia]','$_POST[biosecurity]','$_POST[feed]','$feedComments','$_POST[adjustments]','$_POST[tickets]','$_POST[water]','$waterComments','$_POST[cleanwater]','$_POST[meter]','$_POST[temps]','$ventilationComments','$_POST[humidity]','$_POST[fans]','$_POST[curtains]','$_POST[inlets]','$_POST[hilo]','$_POST[alarm]','$_POST[backup]','$_POST[pitLevel]','$recordsComments','$_POST[medRecords]','$_POST[rodent]','$_POST[testAlarm]','$_POST[lp]','$_POST[lpLevels]','$_POST[genFuel]','$_POST[genFuelLevel]','$_POST[genHoursRecord]','$_POST[genHours]','$_POST[invRecords]','$invNotes','$_POST[currentInv]','$_POST[start]','$_POST[deads]','$mortality','$_POST[cleanOffice]','$facilityComments','$_POST[mow]','$_POST[gates]','$_POST[chute]','$_POST[lights]','$_POST[deadDisp]','$summaryComments')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added <br>"; echo "<a href='visitDetails.php?userid='$_POST[userid]'>Email Visit Results</a>"; echo "<br><br><a href='visitDetails.php?userid='" . $userid . "'>Visit Results</a>"; mysqli_close($con); ?>
-
Hi, Please excuse my lack of pre-existing knowledge on the matter; this is some prepatory work I am doing before I speak with my PHP developer (I just know I'll get farther if I go in with some background knowledge) Here's the scenario: Using our website's search engine you can build all kinds of different URLs (we have many parameters) In some cases you can create the same set of parameters but the order of them can vary, producing the same content but with different URLs (not desired) What I'd like to do is recommend that we assign a placement hierarchy to the parameters so that we can be assured that if we're showing a particular set of results, the URL will always be the same, i.e. they will reorder themselves or "get in line" Is this totally out in left field? Or is it doable? I would also really appreciate any hints or examples that I can share with my developer to lead him in the right direction Thanks very much
-
I'm fairly new to developing sites with dynamically generated pages and have just built my first CMS. Currently all pages come off the index and are pulled from its ID number and their URLs are like this mydomain.com/directory/index.php?subj=1 Its still in production so i only have three pages; Home, Events and Contact. Each one is represented by ID 1, 2 and 3. I have managed to create an .htaccess file and have successfully changed the URL to mydomain.com/directory/1/ (although i think im going to remove that trailing slash). But what i really want to do is pull the page title (except for home which should come off the root) but i just cant seem to get my head around it. If anyone could point me in the right direction I would be very grateful. Basically I need the URL to look something like this mydomain.com/directory/contact At the moment my .htsccess file looks like this RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^([a-zA-Z0-9]+)/$ index.php?subj=$1 Cheers
- 4 replies
-
- htaccess
- mod_rewrite
-
(and 3 more)
Tagged with: