Support Forums

update Display in SQL..need session for ID

This is a discussion on update Display in SQL..need session for ID within the Technical Support forums, part of the Technical Support Forums category; I made a code to complete the status of a listing. CODE: <?php //je require statement // Make a MySQL ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 10-01-2009, 06:36 PM   #1
Junior Member
 
Join Date: Sep 2009
Location: Netherlands
Posts: 19
Rep Power: 10
PimMC is on a distinguished road
Default update Display in SQL..need session for ID

I made a code to complete the status of a listing.

CODE:

<?php
//je require statement
// Make a MySQL Connection
mysql_connect("localhost", "(username)", "(your password)") or die(mysql_error());
mysql_select_db("(your databasename)") or die(mysql_error());


function mysqlOne($query)
{
$result = mysql_query($query);
$row = mysql_fetch_row($result);
return $row[0];
}
if($_POST['display'] != ""){
mysql_query("UPDATE class_listings SET display='".$_POST['display']."' WHERE display='N'") or die(mysql_error());
$_POST['display'] = "";
}
?>
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST"><br>
<input name="display" value="Y" size="10" maxlength="1" type="hidden"/>
<br><br>
<input type="submit" value="SET LISTING STATUS: ONLINE">
</form>


If the connection to your database is successfull, and you click on the button that shows on this page (if you use this code in an php file and upload it).
The DISPLAY field in SQL database will set to "Y", so ALL the listings wil be online. (status: Completed)

But the scripts looks now for 'display'-field setting "N".

What I want:

A cookie session from the checkout page where I get an listingid so I will tell the database, that he just only set the 'display'-field from that listing ($listingid) to "Y".

Can anybody help me?

Last edited by PimMC; 10-01-2009 at 06:39 PM.
PimMC is offline  
Old 10-01-2009, 06:41 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

And what if the user does not accept cookies from your site?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 10-01-2009, 06:56 PM   #3
Junior Member
 
Join Date: Sep 2009
Location: Netherlands
Posts: 19
Rep Power: 10
PimMC is on a distinguished road
Default

If I post a new listing, when generates the listingid??? At step7 ? or in Thanks.php?gateway=....?
PimMC is offline  
Old 10-01-2009, 07:05 PM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

There are listings and orders generated long before step 7. whan an listing becomes visible depends on the type of listing (ie free or paid etc).

I am not sure what you are trying to accomplish here BUT I highly recommend you have a very thorough understanding of the checkout process and what takes place WHEN, WHERE and HOW before you start overriding stuff or you likely will expose yourself to all sorts of abuse or pissibly mess up your database horribly.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 10-01-2009, 07:17 PM   #5
Junior Member
 
Join Date: Sep 2009
Location: Netherlands
Posts: 19
Rep Power: 10
PimMC is on a distinguished road
Default

Ok, i understand.
But what I'll try to do with this script is to get a listingstatus "COMPLETED".
Because, i'm running a sms / telephone payment script, but it needs a fallback link when the payment is done.

But the payment system is stand alone, so i just want to get de 'display' of the listing which is payed, to "Y" (completed).

I'm not an expert in scripting (english language neather), so that's why i'm asking it here
PimMC is offline  
Old 10-01-2009, 08:39 PM   #6
Developer & Moderator
 
Mike-N-Tosh's Avatar
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,427
Rep Power: 75
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I think you should visit the payment API documentation. You should use the built in scripting and variables as defined in the payment gateways. If your payment gateway is standalone, then call it from your custom sr.php file for your custom gateway. You'll probably need to do some variable conversions from your stand alone system to match the expected variables for the script.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline  
Old 10-02-2009, 02:20 AM   #7
Junior Member
 
Join Date: Sep 2009
Location: Netherlands
Posts: 19
Rep Power: 10
PimMC is on a distinguished road
Default

I've read that documentation about API to integrate the gateway.
But I don't know where to start with.
The new payment gateway has different files and one class file.

I just need some help with that script. I tought just to set up a script to change 'display' in the database.


Can I send somebody my code, and have a quick look.
I just wanna know where I must start integrate in the php files.
PimMC is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update to v4.1.5 question .... MrGForce Technical Support 2 08-07-2009 09:45 PM
Session IDs anna245 Technical Support 6 06-12-2008 10:11 PM


All times are GMT -4. The time now is 06:25 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0