PHP - Trying To Find A Way To Create A Key System
Well so far i've found myself in a hole on a few different methods, basically my system is sold with a key.
The issue i am having is, everyone that is purchasing the software uses free hosting, basically no PHP Curl allowed, and no file_get_contents with urls allowed. Now, i thought i had it and i was happy for a day. until i moved it to a different server just to find Javascript was not my answer by getting content from an iframe due to security issues its not allowed...yay.. So is there any other way i can get around this? i mean there are tons of scripts out there with key systems set, so if the key is changed on the users site or the website url is not the same as the installed url. then it blanks the website to text. Everything works fine, the functions are 100% go. i just can't get content from a url if the hosts won't allow it. there needs to be some other way this has to be possible? PHPCurl, is a no go, 80% free hosts block this. file_get_contents won't work if you place url's in majority of the free webservers. [stuck] Similar TutorialsHere's what I'm trying to do. 1. A user creates a calendar that shows which dates he's available. This calendar could showcase availability for up to a year. 2. Other users can do a search for a user that's available on a set date. For e.g. July 1st. 3. All the users available on July 1st will show up in the search results.
There is no booking for appointments involved. It simply needs to show the users available on set dates. I am wondering what's the best way to create this calendar feature? Hi Guys, have you got an idea how I can create a user management system with login and pw, please? I tried the below, but when I click on the "ADD NEW USER" button nothing happens <div> <fieldset> <legend>USER DETAILS</legend> <table> <tr> <td align="right"><a title='NAME' href='user_edit.php?id=1'>NAME</a></td> <td> <input class="norm" type="text" name="name" id="name" /></div> </td> <td align="right"><a title='SURNAME' href='user_edit.php?id=2'>SURNAME</a></td> <td> <input class="norm" type="text" name="surname" id="surname" /></div> </td> </tr> <tr> <td align="right"><a title='E-MAIL ADDRESS' href='user_edit.php?id=3'>E-MAIL ADDRESS</a></td> <td colspan="4"> <input class="norm" type="text" size="57" name="e-mail" id="e-mail" /></div> </td> </tr> <tr> <td align="right"><a title='LOGIN' href='user_edit.php?id=4'>LOGIN</a></td> <td> <input type="text" name="login" id="login" /></div> </td> <td align="right"><a title='PASSWORD' href='user_edit.php?id=5'>PASSWORD</a></td> <td> <input class="norm" type="text" name="password" id="password" /></div> </td> </tr> </table> </fieldset> </div> <br /> <div> <fieldset> <input type='submit' name='delete' value='DELETE USER' onclick='confirm("ARE YOU SURE?");'/> <input type='submit' name='add' value='ADD NEW USER'/> </fieldset> </div> cheers, ozzo Hi guys, I am thinking of create an free email system by sending an messages using with a username. Would I have to store the messages via in mysql? If I can do that, then I just curious that how would a user delete their messages if their messages is display on php page? What method would I have to use? I currently have a MyBB forum and I'm going to attempt to create a top list for it, but I'd like users that have already registered on my forum to be able to log into the top list area and either add or edit their website on the top list. How would I go about creating a login script with an already existing MySQL database that contains my MyBB users? hello dear PHP-Fans - greetings to you - and a happy new year!! i set up a WAMP-System on my openSuse 11.4 system. In order to learn as much as i can bout PHP i want to do some tests and write some scripts. Well the WAMP is allready up and running. Now i try to give the writing access to the folder mkdir /srv/www/ where the php-scripts should go in... i want to give write permission to all to all files in /srv/www As root I generally: mkdir /srv/www/ chown <webmaster usrername> /srv/www/ /srv/www/ should be readable and traversable by all, but only writeable by it's owner (the user designated as the webmaster.) can i do this like mentioned above,... Love to hear from you greetings db1 Hello everyone, I am working on a form that is similar to a shopping cart system and I am thinking of creating a button that submits the checked value and saves them to a $_SESSION variable. And also a link that links to a cart.html that takes the values of a $_SESSION variable. I am have trouble figuring what tag/attribute should I use in order to achieve that.
Right now my code attached below submits the checked values to cart.html directly. However I want my submit button to save the checked box to a $_SESSION variable and STAY on the same page. And then I will implement a <a> to link to the cart.php.
I researched a little bit about this subject and I know it's somewhat related to ajax/jquery. I just wanted to know more about it from you guys. I appreciate your attention for reading the post and Thanks!
Below is the form that I currently have:
<form name= "finalForm" method="POST" action="cart.php"> <input type="Submit" name="finalSelected"/> <?php foreach($FinalName as $key => $item) {?> <tr> <td><input type="checkbox" name="fSelected[]" value="<?php echo htmlspecialchars($FinalID[$key])?>" /> <?php echo "$FinalID[$key] & $item";?> </td> </tr> <?php } ;?>Below is the code for cart.php <?php require ('connect_db.php'); if(isset($_POST['finalSelected'])) { if(!empty($_POST['fSelected'])) { $chosen = $_POST['fSelected']; foreach ($chosen as $item) echo "aID selected: $item </br>"; $delimit = implode(", ", $chosen); print_r($delimit); } } if(isset($delimit)) { $cartSQL = "SELECT * from article where aID in ($delimit)"; $cartQuery = mysqli_query($dbc, $cartSQL) or die (mysqli_error($dbc)); while($row = mysqli_fetch_array($cartQuery, MYSQLI_BOTH)) { $aTitle[] = $row[ 'name' ]; } } ?> <table> <?php if(isset($delimit)) { $c=0; foreach($aTitle as $item) {?> <tr> <td> <?php echo $aTitle[$c]; $c++;?> </td> </tr> <?php }}?> </table> Hi I downloaded a PHP script, copied at localhost and when I run it, it will not display all results instruction says that Globals should be off in PHP.ini and scripts should work while Globals are off. but I can't find php.ini in XAMPP. I tried xampp/apache/bin but I didn't find php.ini what should I do? Hey, What function / how would I find if a string has something? Say I have a string like: $string = 'Hello their! This is my post :) btw, my name is Justin.'; Say I wanted to find out if my name "Justin" is inside that string.. so: whateverfunction('Justin', $string) So I think you should get my idea now though Thanks a lot! The issue I'm having is that this query won't find a max value record if it has less than 5 votes. It'll only show the results of an entry has 5 or greater votes. Why is that? $contest_id = 5; $category_id = 8; $find_entries = $db->prepare("SELECT entry_id, user_id, votes FROM contest_entries WHERE contest_id = :contest_id AND category_id = :category_id AND e_status = :e_status AND votes = (SELECT MAX(votes) FROM contest_entries) LIMIT 1"); $find_entries->bindParam(':contest_id', $contest_id); $find_entries->bindParam(':category_id', $category_id); $find_entries->bindValue(':e_status', 0); $find_entries->execute(); $result_entries = $find_entries->fetchAll(PDO::FETCH_ASSOC); if(count($result_entries) > 0) { foreach($result_entries as $row) { $entry_id = $row['entry_id']; $user_id = $row['user_id']; $votes = $row['votes']; } echo $entry_id; } else { echo 'nothing'; } Edited June 26, 2019 by imgrooot Hi, This piece of code below stops site loading, can't find the problem Please help. If i remove the whole of this the site loads but does not function correct. Code: [Select] if ( $_GET[sssess] ) { session_id( $_GET[sssess] ); } session_start( ); header( "cache-control: private" ); if ( isset( $_GET[redeempoints] ) && $_GET[redeempoints] == "Y" ) { $_SESSION[redeemer] = "Y"; } if ( $_POST[purchaseorder] ) { $_SESSION[po] = "{$_POST['purchaseorder']}"; } if ( !$_SESSION[loginemail] ) { $_SESSION[loginemail] = "noemail@site"; } if ( !$_SESSION[adminemail] ) { $_SESSION[adminemail] = "noadmin@site"; } if ( $_POST[discode] ) { $_SESSION[discode] = trim( "{$_POST['discode']}" ); } $auth_ok_check = md5( "{$_SESSION['loginemail']}.{$hash}" ); $admin_ok_check = md5( "{$_SESSION['adminemail']}.{$hash}" ); if ( isset( $_GET['oidref'] ) ) { $GLOBALS['_GET']['oidref'] = mysql_real_escape_string( $_GET['oidref'] ); $sql = "SELECT o_id FROM order_list WHERE ref='".$_GET['oidref']."' AND unh='{$_GET['oidref']}'"; if ( !( $result = @mysql_query( $sql, $connection ) ) ) { exit( "**COULD NOT GET COPYRIGHT KEYS**" ); } if ( $row = mysql_fetch_array( $result ) ) { $_SESSION['unh'] = $_GET['oidref']; header( "location: ".$sshopurl."orderdetails_os.php?o_id={$row['o_id']}" ); exit( ); } if ( $_SESSION['auth_ok'] == $auth_ok_check ) { header( "location: ".$sshopurl."secure/orders.php" ); exit( ); } header( "location: ".$sshopurl."secure/login.php?next=orders.php" ); exit( ); } if ( preg_match( "/secure/", "{$_SERVER['PHP_SELF']}" ) && !preg_match( "/doqreg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/qreg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/voicepaycallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/secpaysecpagecallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/vps_handle_protx_response.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protx/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protxformcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protxcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/worldpaycallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/securetradingcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/barclayscpicallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/paypalcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/moneybookerscallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/nochexcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/offlinecallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/doregister.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/register.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/doprereg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/login.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/dologin.php/", "{$_SERVER['PHP_SELF']}" ) ) { if ( $auth_ok_check != $_SESSION[auth_ok] ) { header( "Location: ".$sshopurl."secure/login.php?next={$_GET['next']}&shk&p={$_SERVER['PHP_SELF']}" ); exit( ); } if ( preg_match( "/secure/", "{$_SERVER['PHP_SELF']}" ) ) { $isaccount = "1"; } } if ( preg_match( "/".$adminDir."/", "{$_SERVER['PHP_SELF']}" ) && !preg_match( "/adlogin.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/forgetful.php/", "{$_SERVER['PHP_SELF']}" ) ) { if ( $admin_ok_check != $_SESSION[admin_ok] ) { header( "Location: ".$adminurl."adlogin.php" ); exit( ); } if ( preg_match( "/".$adminDir."/", "{$_SERVER['PHP_SELF']}" ) ) { $isadmin = "1"; } } $noadirs = count( $admin_dirs ); $i = 0; for ( ; $i <= $noadirs; ++$i ) { if ( !preg_match( "/admin\\/".$admin_dirs[$i]."/", "{$_SERVER['PHP_SELF']}" ) && preg_match( "/".$admin_dirs[$i]."/", "{$_SESSION['admin_type']}" ) ) { continue; } header( "Location: ".$adminurl."perms.php?noperm={$admin_dirs[$i]}" ); exit( ); } if ( !$_SESSION[shopper_type] ) { $_SESSION[shopper_type] = "1"; } if ( $_GET[setcurrency] == 1 ) { if ( $_GET[new_currency_id] ) { $GLOBALS['_POST'][new_currency_id] = $_GET[new_currency_id]; } $_SESSION['currency_id'] = $_POST[new_currency_id]; } if ( $_GET[clearptid] == Y ) { session_unregister( "ptid" ); } if ( $_GET[selectpostage] == 1 ) { if ( $_POST[selptid] == Free || $_POST[selptid] == free ) { session_unregister( "ptid" ); } else if ( isset( $_POST[selptid] ) ) { $_SESSION['ptid'] = $_POST[selptid]; } else { session_unregister( "ptid" ); } $GLOBALS['_POST'][selptid] = mysql_real_escape_string( $_POST[selptid] ); $sql1 = "UPDATE basket SET ptid='".$_POST['selptid']."' WHERE session_id='".session_id( )."'"; if ( !( $result1 = @mysql_query( $sql1, $connection ) ) ) { exit( "Couldn't execute request 1" ); } } I can not find the problem with this script I wrote. I am trying to show a web page provided that the $_GET['reg'] is registered by the user. I am trying to check that the $_GET['reg'] is registered by the user before the page with specific details is shown. For some reason even if the email address equals the email address in the DB the output still shows: <?php echo "I am sorry but this '$_GET[reg]' does not seem to be registered by you!"; ?> Can anyone see where I am going wrong - there is more than one 'reg' for each email address in the DB. Thanks <?php $email = $_POST['email']; $sql = "SELECT reg FROM sales WHERE email='$email'"; $result = mysqli_query($cxn,$sql) or die ("Couldn't execute query"); $data = array(); //This way we can hold multiple results $i = 0; //The index of the array to add the result to while($row = mysqli_fetch_assoc($result)) { if ($row['reg'] == $_GET['reg'] ) { //Why use two if statements? $data[$i] = $row['reg']; $i++; //increase the array index for the next while loop } else { echo "I am sorry but this '$_GET[reg]' does not seem to be registered by you!"; exit(); } } // THIS IS WHERE THE PAGE CONTENT IS ...................... ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <?php // Connect to database================================================== include("connect_db.php"); // sending query =========================================================== $result = mysql_query("SELECT * FROM members Order By last") or die(mysql_error()); if (!$result) { die("Query to show fields from table failed"); } echo "<br />"; echo "<p>MEMBERS LIST</p>"; echo "<table border='10' cellpadding='3' cellspacing='2'>"; echo "<tr><th>First Name</th><th>Last Name</th>><th>Phone</th><th>Email</th></tr>"; // keeps getting the next row until there are no more to get ================ while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table ========================== echo "<tr><td>"; echo $row['first']; echo "</td><td>"; echo $row['last']; echo "</td><td>"; echo $row['phone']; echo "</td><td>"; echo $row['email']; echo "</td></tr>"; } echo "</table>"; ?> </body> </html> This is the output. MEMBERS LIST > First Last Phone Email data data data data ect............................................................... I cannot find where the > (greater than) sign is coming from. There is a space after MEMBERS LIST but I could not get it to work in this display. Hello I am new thought I would ask help here as I was not getting much help on another forum. I have this code Code: [Select] <?php header("content-type: text/xml"); $rssfeed = '<?xml version="1.0" encoding="UTF-8"?>'; $rssfeed .= '<rss version="2.0">'; $rssfeed .= '<channel>'; $rssfeed .= '<title>My Price Savings Coupons.com Feed</title>'; $rssfeed .= '<link>http://www.mypricesavings.com</link>'; $rssfeed .= '<description>This is coupons.com feed</description>'; $rssfeed .= '<language>en-us</language>'; $rssfeed .= '<copyright>Copyright (C) 2011 mypricesavings.com</copyright>'; function compareFeeds($a, $b){ //this function will compare the "val" array element of each $itemRSS if ($a["val"] == $b["val"]) { return 0; } return ($a["val"] < $b["val"]) ? -1 : 1; } $doc = new DOMDocument(); $doc->load('http://rss.coupons.com/xmlserve.asp?go=14520kk5210'); $arrFeeds = array(); foreach ($doc->getElementsByTagName('item') as $node) { $itemRSS = array ( 'val' => $node->getElementsByTagName('value')->item(0)->nodeValue, 'image' => $node->getElementsByTagName('image')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'exp' => $node->getElementsByTagName('activedate')->item(0)->nodeValue ); array_push($arrFeeds, $itemRSS); } usort($arrFeeds, 'compareFeeds'); foreach($arrFeeds as $itemRSS){ $descrip = '<![CDATA[ <p><a href="'.$itemRSS["link"].'"><img src="'. $itemRSS["image"].'" align="left" border="0" height="80" width="80" alt="'.$itemRSS["desc"].'"/></a></p>]]>'; $descrip .= '' .$itemRSS["desc"]; $rssfeed .= '<item>'; $rssfeed .= '<title>' . $itemRSS["desc"] . '</title>'; $rssfeed .= '<link>' . $itemRSS["link"] . '</link>'; $rssfeed .= '<pubDate>' . $itemRSS["exp"] . '</pubDate>'; $rssfeed .= '<description>'. $descrip . '</description>'; $rssfeed .= '</item>'; } $rssfeed .= '</channel>'; $rssfeed .= '</rss>'; echo $rssfeed; ?> The purpose of this code is to take http://rss.coupons.com/xmlserve.asp?go=14520kk5210 and turn it into a true RSS Feed. I currently have the php above at mypricesavings.com/coupons/couponsfeed.php I receive the error in google chrome on mac, however, in safari it does work, If I were to use RSS Graffiti on facebook it also errors Thank you for any help, Also, If there is a better more efficient way to accomplish what I am trying to do, please share with me so I may learn better Derrick hello I've some code and I want find and cut url from it using php. this url link between 1 - 5 link. this mean some times 1 URL in the code sometimes 2 url in the code and ... can anyone help me? Code: [Select] MB</div><br/> <br/> <br/> <b><br/> DOWNLOAD<br/> <br/> <a href="http://uploading.com/files/c2182562/LIBERO%252B24%252BLUGLIO%252B2010.pdf/" target="_blank" rel="nofollow">http://uploading.com/files/c2182562/LIBERO%2B24%2BLUGLIO%2B2010.pdf/</a><br/> <br/> <br/> <br/> <br/> <a href="http://rapidshare.com/files/408736098/LIBERO_24_LUGLIO_2010.pdf.html" target="_blank" rel="nofollow">http://rapidshare.com/files/408736098/LIBERO_24_LUGLIO_2010.pdf.html</a></b> </div> <table class='file-express' width='100%'> <tr> <td style='text-align: left; color: #B2AC94; font-size: 3'><br>titletm= LIBERO 24 LUGLIO 2010 LIBERO 24 LUGLIO 2010 :found<br><font color="blue">2</font>http://www.avaxhome.ws/magazines/everyday_practical_electronics_vol_33_no_5_2004.html<br>File exists.dllink'MB</div><br/> <br/> <br/> I have rows being generated in a foreach loop. I need to find the time in the row before it (or maybe after it if my logic is screwed up) to see if the times are equal. If they are equal, I need to see if the next row after that is equal. If it is not equal then stop. mysql user id time action 1 5 bought 1 5 purchased 1 5 sold 1 4 created Code: [Select] foreach($newsfeed as $k => $news) { if ($news['time'] == $news['time'] of $k--) { echo " you bought purchased and created"; } else { echo $news['action']; } } The program found here http://www.myadtoolz.com/download/cpuid.zip shows a cpuid? I dont know what that is but it seems unique for every system, I feel this could be the way to have scripts that I sell verify with the user, how would I make a script to find that cpuid? thanks Hello PHPFreaks, Im looking to make a script that can find sertend text or numbers in mysql database and can change it. The only problem is that the database also contains same text and numbers that dont need to be changed. So only for example within [39,10] the , has to be changed into a . and only between the [ ] Anyone got script for this or can help me make one cause im new to php. Please help...I'm going blind!!! I am trying to set up a simple feedback form on a website. The form is at www.hotelguestdirect.com if you need to see that. This is the error I get...Parse error: syntax error, unexpected ',' in /home/content/h/o/t/hotelguestdir/html/survey.php on line 160 Here is my code <?php // Field Mapping $sFirstName = $_POST["txtFirstName"]; $sLastName = $_POST["txtLastName"]; $sHomeCity = $_POST["txtHomeCity"]; $sHomeState = $_POST["selHomeState"]; $sCountry = $_POST["selCountry"]; $sHotel = $_POST["txtHotel"]; $sCity = $_POST["txtCity"]; $sState = $_POST["selState"]; $sStayLength = $_POST["selStayLength"]; $sHowHelpful = $_POST["txtHowHelpful"]; $sImprovements = $_POST["txtImprovements"]; if (($sHotel == "") || ($sCity == "") || ($sState == "") || ($sStayLength == "") || ($sFirstName == "")) { print('<span style="color:#333; font-size:14px;">Please complete the required fields <a style="color:#333" href="index.html" onClick="history.go(-1);">Click here to go back</a></span>'); } else { $sMailFrom = 'info@hotelguestdirect.com'; $sMailTo = 'graphics.hgd@gmail.com'; $sMailSubject = 'Guest Survey - Key Holder Brochures'; $sMailBody = '<p>Guest Response Survey</p> <b>Hotel: </b>' . $sName . '<br /> <b>City: </b>' . $sCity . '<br /> <b>State: </b>' . $sState . '<br /> <b>Lenth of Stay </b> ' . $sStayLength . '<br /> <b>How was the brochure helpful: </b>' . $sHowHelpful . '<br /> <b>Input or Improvements: </b>' . $sImprovements . '<br />'; $sMailHeaders = "From: $sMailFrom\n"; $sMailHeaders = "Content-Type: text/html; charset=iso-8859-1\r\n"; if (mail($sMailTo, $sMailSubject, $sMailBody, $sMailHeaders)) { print('<span style="color:#333; font-size:14px;"><div align="center"><br /><br />Thank you, your information has been emailed!</div></span>'); } else { print('<span style="color:#333; font-size:14px;"><div align="center"><br /><br />Could not send e-mail, please contact the webmaster!</div></span>'); } } ?> Hi There, I have ported my website over to another hosting provider and I cannot get this one thing working! We have images on our site, which this PHP Script should resize, but it can't find the Imagick.php script. I am convinced that it resides in a different path. Here is the error i get when trying to access one of the images : Warning: require_once(include/classes/Imagick.php) [function.require-once]: failed to open stream: No such file or directory in /hermes/bosweb/web128/b1282/ipg.accommodateruralcom/include/global.php on line 29 Fatal error: require_once() [function.require]: Failed opening required 'include/classes/Imagick.php' (include_path='.:/usr/local/lib/php-5.2.17/lib/php:/home/users/web/b1282/ipg.accommodateruralcom') in /hermes/bosweb/web128/b1282/ipg.accommodateruralcom/include/global.php on line 29 I contacted my hosting support about that and they said that the Imagick.php resides in the following directory : /usr/local/lib/ImageMagick I can appreciate that there may be references to this everywhere and anywhere. I have PHP files called imageResize, Global etc...just let me know which ones to post and ill do that. I really appreciate the help. [attachment deleted by admin] |