Jump to content

m3bik

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

About m3bik

  • Birthday 05/31/1987

Profile Information

  • Gender
    Male

m3bik's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Isn't that why they have CAPTCHAs?
  2. What does your changeEmployee1 javascript function do, exactly? That appears to be what's called when the field is clicked, correct?
  3. Looking at your original post, see this code: if ($step == 2) <div>LOGIN WELCOME</div> <div> HERE IS YOUR USER DATA:<br /> <label class="data">username:'; <?php echo $_SESSION['username'] ?> <br> password: <?php echo $_SESSION['password'] ?> <br></label> HERE IS YOUR SESSION DATA:<br /> <label class="data"> <?php echo (session_name().": ".session_id()) ?><br> <?php echo ("SESSION DATA: ".session_encode() )?> </label> </div>index.php?step=3">Logoff</a></div> } You didn't include an echo, print, or close the php interpreter.. That should be more like this: if ($step == 2) ?> <div>LOGIN WELCOME</div> <div> HERE IS YOUR USER DATA:<br /> <label class="data">username:'; <?php echo $_SESSION['username'] ?> <br> password: <?php echo $_SESSION['password'] ?> <br></label> HERE IS YOUR SESSION DATA:<br /> <label class="data"> <?php echo (session_name().": ".session_id()) ?><br> <?php echo ("SESSION DATA: ".session_encode() )?> </label> </div>index.php?step=3">Logoff</a></div> <?php }
  4. Well I do like your logic... but I need the ads to view in order for each user separately. Sorry that I didn't specify that in the beginning. So when I view the ads, it starts from the beginning and goes in order for me.. and if you view the ads around the same time, it starts from the beginning and goes in order for you (not starting where I left off)
  5. Not sure if this helps, but I'd run something like this: $arr = array('aaaa','bbbb','cccc'); foreach($arr as $search_needle) They $key isn't required since there's no key in the array, just values..
  6. I'm working on a simple ad server and would like to display the ads in order (not random). I'm fairly certain I can do something like this: // Get the last ad id, or becomes 0 if not available $lastid = ($_GET['lastid'] == '') ? '0' : $_GET['lastid']; // Get the next ad in order, or get the first one available mysql_query("SELECT adcode FROM ads WHERE zone='$zoneid' AND id > $lastid ORDER BY id ASC LIMIT 1"); The above code would get the first ad or the next ad in order.. How do I go back to the beginning when I run out of ads to show?
  7. Did you include session_start(); at the beginning of your script? http://php.net/manual/en/function.session-start.php
  8. As a reference here, I eventually changed the user that apache runs under to the user name in question.. and it works without sudo now.
  9. Thanks for pointing that out, thorpe. I will look into it, but as a proof of concept sort of deal, I got it working.. That makes me happy.
  10. Thanks kicken! That did the trick! I did have to add the www-data user to the sudoers file because it wasn't working without "sudo" but here's my end result: putenv('DISPLAY=:0'); exec('sudo oowriter');
  11. Well I've verified that the error reporting is turned on, but I don't actually get any errors when loading the webpage.. I have tried adding the www-data to the video group with no luck. I've also tried adding the www-data user to the user group running on the desktop, but still nothing. I do have success running "php ./myfile.php" in the command line. It does open the application on the local user's screen.. but for some reason when I access the page on the web, I get nothing
  12. I'm working on a light use/kiosk system. I have apache2 and php5 installed on Ubuntu 10.04 and I have the browser open the localhost web page by default. I would like to include a link on this page to open oowriter (open office writer) for the end user on the machine. I've tried exec('oowriter'); with no luck. I've also tried setting the DISPLAY value before the command like exec('DISPLAY=:0 oowriter'); with no success. I don't mind have the www-data user in the sudoers file if I have to sudo the command or something, but is this possible to do?? I'm not having any luck at all!
  13. I'm new to python in general, but I have a python program that loads a web page. I'm using a slightly altered code I found at http://kmandla.wordpress.com/2010/05...rowser-script/ for a simple python gtk browser. I would like for when the user clicks a link on the page loaded in the python program to open in the actual browser (not the same program). I've found that "webbrowser.open" does this for certain things if I "import webbrowser" but I can't seem to make it happen when the user clicks a link.. #!/usr/bin/env python import sys import gtk import webkit import webbrowser DEFAULT_URL = 'http://www.google.com' class SimpleBrowser: # needs GTK, Python, Webkit-GTK def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.window.connect('delete_event', self.close_application) self.window.set_default_size(350, 20) vbox = gtk.VBox(spacing=5) vbox.set_border_width(5) self.txt_url = gtk.Entry() self.txt_url.connect('activate', self._txt_url_activate) self.scrolled_window = gtk.ScrolledWindow() self.webview = webkit.WebView() self.scrolled_window.add(self.webview) vbox.pack_start(self.scrolled_window, fill=True, expand=True) self.window.add(vbox) def _txt_url_activate(self, entry): self._load(entry.get_text()) # I've tried replacing this with webbrowser.open(entry.get_text()) with no luck def _load(self, url): self.webview.open(url) def open(self, url): self.txt_url.set_text(url) self.window.set_title('%s' % url) self._load(url) def show(self): self.window.show_all() def close_application(self, widget, event, data=None): gtk.main_quit() if __name__ == '__main__': if len(sys.argv) > 1: url = sys.argv[1] else: url = DEFAULT_URL gtk.gdk.threads_init() browser = SimpleBrowser() browser.open(url) browser.show() gtk.main() Any help would be appreciated! Thanks!
  14. Ok, thanks. I'll admit I was being a bit lazy. I didn't want to have to create a new row for the same information, just a different time... But it looks like I'm headed in that direction.
  15. Not sure how well I can describe my situation, but I'll try... I'm trying to create a reminder program for myself (I forget a lot). I have a mysql table set up where it stores the hour it's supposed to remind me and the description of the reminder... I want to have some reminders with multiple hours, like it's supposed to remind me at "2,5,12". I can't just select the row where HOUR=2 because it has several other numbers in the same row, and I can't select the row where HOUR like '2' because then it might select the rows with 12 (which isn't 2). Is there a way I can select the rows where HOUR=2 and where HOUR has a 2 in the commas? Or do I have to just select the rows where HOUR like '2' and then sort through it with more code?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.