-
-
TideSDK Hiding php database passwords
Just letting you know, i fixed this issue. I re-packed the .exe and dependancies into a new .exe so... app.exe runs the_real_app.exe within itself. (Like a virtualbox). That way, all dependant folders are hidden.
-
Selecting multiple values from a database
Ideally, you should always use an auto_increment ID on table items. Even if your not using it, it will come in handy at one point or another. See below for examples on sql joins. http://www.w3schools.com/sql/sql_join.asp
-
TideSDK Hiding php database passwords
Hey there, I have started an application using TideSDK (If you have not heard of it, it is awesome! Check it out!) Bascially, it uses web programming to compile a native desktop application. So, i am writing an application to login to a website from the application. What i have done, is allowed access remotely to the database and have successfully connected with the app. I can do the usual stuff but then realised that when the application is compiled, on a mac you can open package contents. This then shows the resources folder which shows the raw PHP files where the connection variables are clearly viewable. I am just looking for options on what i can do to stop this being possible to keep the database as secure as possible from intrusion as it will eventually contain A LOT of information. Thanks in advance!
-
Primary Key Duplicate Entry - User Message (mysqli.errno)
$res = mysqli_query($GLOBALS["___mysqli_ston"], $check); $count = mysqli_num_rows($res); if ($count>1){ echo 'Sorry, this gamertag already exists'; } Missed a bracket on line 1. Unexpected double arrow on line 3. This now works on my system as the code is. (Not tested the whole function)
-
Primary Key Duplicate Entry - User Message (mysqli.errno)
What are the errors? Post the output please?
-
-
Primary Key Duplicate Entry - User Message (mysqli.errno)
Ah, sorry.. i read the post wrong slightly.. okay... <?php $conn = ($GLOBALS["___mysqli_ston"] = mysqli_connect("HOST", "USER-NAME", "PASSWORD!")); $db = ((bool)mysqli_query($conn, "USE DATEBASE NAME")); ?> <?php $yourname = mysql_real_escape_string($_POST['user-name']); $xboxgamertag = mysql_real_escape_string($_POST['xbox-gamertag']); $game1 = mysql_real_escape_string($_POST['game1']); $game2 = mysql_real_escape_string($_POST['game2']); $game3 = mysql_real_escape_string($_POST['game3']); $check = "SELECT xboxgamertag FROM yourtable WHERE xboxgamertag = $xboxgamertag"; $res = mysqli_query($GLOBALS["___mysqli_ston"], $check; $count = mysqli_num_rows($res); if ($count=>1){ echo 'Sorry, this gamertag already exists'; } else { $sql = "INSERT into xbox values('$yourname','$xboxgamertag','$game1','$game2','$game1')"; $qury = mysqli_query($GLOBALS["___mysqli_ston"], $sql); if(!$qury) echo ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)) ; else { echo "Success, $yourname! Your now added to GamerTag Finder with the gamertag $xboxgamertag and want people to add you for $game1, $game2 and $game3."; echo "<a href='xboxgamertags.php'>View Xbox GamerTags</a>"; } } ?> Not tested i am afriad but you get the general idea. just do a query on the database for the new username being added and if the amount of rows is more than 1, do nothing.. if its not.. then add it in.
-
PHP Include file within another included file
Had to change is slightly to: include(__DIR__ . '/../file2.php'); But it worked! Thank you very much!!
-
-
Declaring all variables at start of program
When i first saw this thread.. $var1 = 'hi'; $var2 = 'hi2'; $var3 = "hi3"; $var4 = "hi4"; etc etc etc.. I chuckled.
-
displaying images in a webpage using php
Ahhh, i see what your saying now.. by "hard coding" i was thinking.. "wah?, looks dynamic to me.." then realised your adding in the id of the image to be pulled out. <td><img src="showimage2.php?id=5" title="tan" width="150"height="150"/></td> Just stick in a while loop. Then add a link to the image for a full view. while($row = mysql_fetch_assoc($result){ echo '<a href="/showimahe2.php?id='.$row['id'].'"><img src="/showimahe2.php?id='.$row['id'].'"/></a>'; }
-
Primary Key Duplicate Entry - User Message (mysqli.errno)
Any chance you can post your mysql table structure? I suspect your primary key is an incorrect data type.
-
Tex0gen reacted to a post in a topic:
Warning: Cannot modify header information PHP Warning(Heres How to fix)
-
PHP Include file within another included file
Okay, so this is going to sound like the most amature question ever. I remember needing to do something like this years ago but never figured it out, so here i am. I have a structure like the following: ------------- index.php (Includes file1.php FOLDER1 > file1.php (This includes file2.php) FOLDER2 > file2.php -------------- So, index.php includes file1.php perfectly. But then errors out with file2.php. It says it cannot open stream. File not found. I have changed file.php to the following configs but with no success... include('../FOLDER2/file2.php'); include('FOLDER2/file2.php'); include('/FOLDER2/file2.php'); include('../../FOLDER2/file2.php'); Any idea how i can go about this? Thanks in advance!
-
Lithium Framework (PHP) Session based links
I checked out Laravel 4. Completely agree with the documentation. Lithium lacks detailed documentation. To be honest, i found CakePHP to be pretty much the same framework as Lithium and much better documented so i have now moved over to CakePHP. Thank you for the heads up though!
-
Lithium Framework (PHP) Session based links
Solved, for future ref, heres how i did it. In Layouts default.html.php: <?php if($this->user->connected()){ echo '<a href="/lithium/lithgit/logout">Logout</a>'; } else { echo '<a href="/lithium/lithgit/login">Login</a>'; } ?> And then created a Helper called user.php and added the following: <?php namespace app\extensions\helper; use lithium\security\Auth; class User extends \lithium\template\helper { public function connected() { return Auth::check('default', $this->_context->_config['request']); } } Thanks guys.
-
Holiday misery...
I hate drinking full stop. I don't touch the stuff so i am with you on that one! But the clubs.. everyone loves music surely! And.. (unless you bat for the other team) the women! I would say those alone are enough for me to just be in bliss.. let alone the sunshine. Have to say (minus the idiots) i am jealous! You get all the pros and none of the cons. Wake up, chill, go out, meet the girls, rave to the tunes, go to bed.. and the next day.. all over again hangover free!
-
What is pet name?
I have 3 cats, Moochie, Pugsley and Lilley.