Jump to content

JustMike

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

0 Neutral

About JustMike

  • Rank
    Newbie
  • Birthday 04/15/1992

Contact Methods

  • Website URL
    http://invata-programare.ro/
  • Yahoo
    cedry2k1992

Profile Information

  • Location
    Bucharest, Romania
  • Interests
    PHP, SQL, Java, C++, HTML5, CSS3, JavaScript, laravel
  1. I changed my jquery code and now I have this: $(document).ready(function(){$('.ajaxForm').each(function (){if( $(this).attr('data-id') == $('.postStreamComment').attr('data-id') ) { $('.postStreamComment').click(function(e){ e.preventDefault(); $.post( '/stream/post-comment', { commentText:$('.comment-'+$(this).attr('data-id')).val(), stream_id:$(this).attr('data-id') }, function( data ){ $('.comment-'+$(this).attr('data-id')).val('') }, 'json'
  2. In the network tab i get this in the general section: And this in the form data section: Now it sends the correct id/text to the db but it redirects me to http://localscript.dev/stream/post-comment ...
  3. Sorry, the typo was repaired in my file (just after posting this and I forgot to correct here too), but in the database is inserted only the id of the the last post. I'm a jquery beginner (so... probably I'm wrong, because i'm still learning), but I think it should be something like this: $(document).ready(function(){ $('.postStreamComment').click(function(){ // e.preventDefault(); $.ajax({ url: 'stream/post-comment', type: "post", data: { $('.ajaxForm').each(function(){ 'commentText':$('input[name=commentText]').val(), 'stream_id
  4. Hi, I have a problem with ajax posting into db, the post_id is not inserted into db, instead is inserted 0. In the firebug console i get this message: POST http://localscript.dev/stream/post-comment 200 OK If i inspect the element with firebug the hidden input with the id is correct. I have a form looking like this: <form action="stream/post-comment" method="POST" class="ajaxForm"> <inpu type="hidden" name="stream_id" value="<?php echo $stream['id']; ?>"> <div class="col-md-10" style="padding-left: 0px;"> <input type="text" name="commentText" class="form
  5. Thanks, I solved the problem. There was a error in the __construct (I had the same name for two variables) and one in the createbackup method... the final mysqldump command is this: $actualCreateBackup = "mysqldump --opt --host=".$this->dbHost." --user=".$this->user." --password=".$this->password." ".$this->dbName." > ".$this->sqlFile;
  6. Hi, I'm trying to create a php class that creates a database backup but the result is an empty file. Here is my code so far: Note: The uploadBackup() method is not ready yet, I'm still trying to figure out the createbackup() method... <?phpclass dropboxbackup{ // temp directiry public $tempDir; // MySQL DB connection data (username, password, database, host and prefix) private $user; private $password; private $dbName; private $dbHost; //DropBox Information private $dropbox_user; private $dropbox_pass; private $dropbox_loc;
  7. I don't know what happened, but I deleted the entire source code and uploaded it again without the .htaccess file and now works perfectly. Anyway, thanks for your help!
  8. This is the code, and on the first line is the php opening tag, <?php And on the second line is this exact code require_once "include/code.php"; I changet the " with ' but it shows the same error. I checked my core.php file for errors and works, now I deleted the content of the .htaccess file and now shows a blank page what page I'm trying to access.
  9. I deleted that line and now I can see only this in the browser:
  10. Hi, I have a problem after I moved a site froma a webhosting company to another. After I finished moving the files and the database I had the surprise to see the php code in the browser. For example, this is my home.php file: <?phprequire_once "include/code.php";loggedinorreturn();if($USER){ if ($_SERVER["REQUEST_METHOD"] === "POST" && $USER) { $choice = mysql_real_escape_string(htmlspecialchars($_POST["choice"])); if ($USER && $choice != "" && $choice < 256 && $choice == floor($choice)){ $res = sql_query("SELECT id FROM polls ORDER BY added D
  11. I know, it's a weird thing,but the hosting is free (from a friend with a server home) and I don't use this thing just a few days a year....anyway, I,ll put my full code when I get home...maybe other users needs this thing too.
  12. I don't have acces to cron jobs on the server where the website is hosted. I was thinking that I can check if the $row['date']+86400<time() or somthing similar will work but it seems that I can't figure it out.I forgot to mention, the xmas table looks like this: `id` int(11) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, `gift` varchar(255) NOT NULL, I think I found a solution, I don't know if this is the best option but here is my new code: I changed the type of date in the database to DATE and here is my new code: $day = date('Y-m-d');$lastGift = $row['date'];$disabled = 0; if
  13. Hi, I'm just started to learn PHP and now I encountered a problem. I'm trying to show a message every 24h but I can't figure it out. Here is my code: $link = mysql_connect('localhost', 'root', '');if (!$link) { die('Not connected : ' . mysql_error());}$db_selected = mysql_select_db('gifts', $link);if (!$db_selected) { die ('Can't use foo : ' . mysql_error());}$sel = mysql_query("SELECT * FROM xmas") or die(mysql_error()); $row = mysql_fetch_assoc($sel); $time_now = date('y-m-d h:i:s', time());//var_dump($time_now); if($time_now>$row['date']){ echo "here's your gift "; }else{
  14. Try something like this: @font-face { font-family:'lottepaperfang'; src: url('./fonts/lottepaperfang.ttf');}@font-face { font-family:'ASTRONAU'; src: url('./fonts/ASTRONAU.ttf');}@font-face { font-family:'MarketDeco'; src: url('./fonts/Market_Deco.ttf');} My ttf files are saved in site_directory/fonts
  15. JustMike

    button error

    I don't know about your php code, but your HTML code had a lot of errors. Here is the corrected HTML code: <!DOCTYPE html><html><head> <title>Page Title</title> <meta charset="UTF-8"> </head><body> <form action="resultaat.php" method="post"> <table> <tr> <td>getal 1:</td><td> <input type="text" name="getal_1"></td> </tr> <tr> <td>bewerking (+-/*)</td><td> <input type="text" name="bewerking"></td> </tr> <tr> <td>getal 2:
×
×
  • Create New...